歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> LNMP(linux+nginx+mysql+php)

LNMP(linux+nginx+mysql+php)

日期:2017/3/2 9:44:56   编辑:關於Linux

一直沒有時間整理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已經啟動了。
當然這只是簡單粗略的講了下自己的安裝配置過程,等於開始起跑,接下來的過程是困難而有漫長的。。

Copyright © Linux教程網 All Rights Reserved