LNMP(linux+nginx+mysql+php)

一直没有时间整理LNMP的安装配置,今天有时间来整理下亲身安装LNMP的过程:

我是通过yum安装的。

1.安装nginx:nginx的安装就不多扯了

2.安装Mysql:#yum install mysql-server -y

3.安装php:#yum install php -y

4.安装spawn-fcgi:之前是需要通过安装lighttpd来得到spawn-fcgi进行 FastCGI 模式下的管理工作的,现在spawn-fcgi已成为独立项目了。下载spawn-fcgi:#wget http://www.lighttpd.net/download/spawn-fcgi-1.6.0.tar.gz,然后通过编译安装得到spawn-fcgi。

5.修改nginx配置文件

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.启动mysql:service mysqld start
7.启动php+fastcgi:/usr/local/spawn-cgi/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C(大写) 5 -f /usr/bin/php-cgi,当然这之前我们的nginx已经启动了。
 当然这只是简单粗略的讲了下自己的安装配置过程,等于开始起跑,接下来的过程是困难而有漫长的。。

本文由812120608.qzone.qq.com奉献,版权归原作者所有。
如若复制、转载请注明原文地址:http://mtoou.info/lnmp-linux-nginx-mysql-php/

匿名进行回复 取消回复

邮箱地址不会被公开。 必填项已用*标注