Open 1c7 opened 9 years ago
文件目录
配置文件路径在 /etc/nginx/sites-available/default
server {
listen 80;
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name example.com;
location / {
try_files $uri $uri/ /index.html;
autoindex on;
}
重点是加上 autoindex on;
LNMP = Linux Nginx MySQL PHP
1. 安装 Nginx
2. 安装 MySQL
3. 安装 PHP
1.1 检查 Nginx 是否正在运行
1.2 检查 Nginx 是否已经安装
which nginx 命令应该管用
安装
askubuntu.com/questions/134666/what-is-the-easiest-way-to-enable-php-on-nginx https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04
Nginx 和 PHP 整合:
location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; }
Where signal may be one of the following:
Nginx 官方文档 https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
Nginx 官网: http://nginx.org/en/download.html 2015-8月 1.9.4是最新版本
参考资料
http://stackoverflow.com/questions/14045720/nginx-configure-error-ubuntu-12-04 https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04 https://www.digitalocean.com/community/tutorials/how-to-install-the-latest-version-of-nginx-on-ubuntu-12-10