LNMP (linux+nginx+mysql+php)

  

There has been no time to organize the installation and configuration of LNMP. Today, I have time to sort out the process of installing LNMP in person:

I installed it through yum.

1. Install nginx: nginx installation is not much to pull

2. Install Mysql: #yum install mysql-server -y

3. Install php:# Yum install php -y

4. Install spawn-fcgi: Before you need to install lightwd to get spawn-fcgi to manage in FastCGI mode, now spawn-fcgi has become a stand-alone project. Download spawn-fcgi:#wget http://www.lighttpd.net/download/spawn-fcgi-1.6.0.tar.gz and get the spawn-fcgi by compiling and installing.

5. Modify the nginx configuration file

server {listen 80;server_name 192.168.18.142;

#charset koi8-r;#access_log logs/host.access.log main ;

location /{root /usr/html;index index.php index/index.htm;}location ~ .*\\.php5?$ {root /usr/html;fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;include fastcgi_params;}

error_page 500 502 503 504 /50x/;location = /50x/{root html;}}6.Start mysql:service mysqld start7 Start php+fastcgi:/usr/local/spawn-cgi/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C (uppercase) 5 -f /usr/bin/php-cgi, of course before our Nginx has started. Of course, this is a simple and crude description of the installation and configuration process, which is equal to the start, the next process is difficult and long. .

Copyright © Windows knowledge All Rights Reserved