分类:
2010-11-18 08:51:10
To build a perfect LNMP with those packages: Ubuntu 10.04 LTS, Nginx, MySQL, Php5
The nginx web server is a fast, lightweight server designed to efficiently handle the needs of both low and high traffic websites. Although commonly used to serve static content, it's quite capable of handling dynamic pages as well. This guide will help you get nginx up and running with PHP and FastCGI on your Ubuntu 10.04 LTS (Lucid) Linux VPS.
We assume you've already followed the steps outlined in our . These steps should be performed via a root login to your Linode VPS over SSH.
These instructions work with the Linode platform. If you don't have a Linode yet, sign up for a and get started today.
Issue the following commands to update your system and install the nginx web server, PHP, and MySQL Server packages:
# apt-get update # apt-get upgrade # apt-get install nginx php5-cli php5-cgi spawn-fcgi php5-mysql mysql-server # echo "console output" >> /etc/init.d/nginx # update-rc.d nginx defaults # /etc/init.d/nginx start
Various additional dependency packages will be installed along with the ones we requested, and will ask you to input password for the root user of Mysql. Once the installation process finishes, you may wish to make sure nginx is running by browsing to your IP address, take this for example: You should get the default ngnix page.
In this guide, we'll be using the domain "bambookites.com" as our example site. You should substitute your own domain name in the configuration steps that follow. First, we'll need to create directories to hold our content and log files:
# mkdir -p /var/www/dajiamaicom # cat > /var/www/dajiamaicom/index.php <Welcome to nginx! Welcome to nginx!