博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
unbuntu 安装nginx
阅读量:4696 次
发布时间:2019-06-09

本文共 814 字,大约阅读时间需要 2 分钟。

apt-get -y install nginx

service nginx start

浏览器输入localhost会显示欢迎界面

 修改配置文件使其支持PHP环境

cd /etc/nginx/sites-available
vi default
server {        listen       80;        server_name localhost;        root /var/www/html;        index index.php index.html;        location / {                try_files $uri $uri/ =404;        }        error_page 404 /404.html;        error_page 500 502 503 504 /50x.html;        location = /50x.html {                root /var/www/html;        }        location ~ \.php$ {                try_files $uri =404;                fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;                fastcgi_index index.php;                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        include fastcgi_params;        }}

 

转载于:https://www.cnblogs.com/lotus-white/p/7693542.html

你可能感兴趣的文章
在 Visual Studio 调试器中指定符号 (.pdb) 和源文件
查看>>
直接量
查看>>
leetcode 115. 不同的子序列(Distinct Subsequences)
查看>>
三元表达式
查看>>
Go初接触之libjpeg-turbo
查看>>
UVa 11300 Spreading the Wealth 分金币
查看>>
[leetcode] Happy Number
查看>>
Java第五周学习总结
查看>>
j.c.Warnsdorff马踏棋盘算法
查看>>
the openning
查看>>
python 字符串 和 print
查看>>
MAC OS下安装Minizip
查看>>
Java_Certificates does not conform to algorithm constraints
查看>>
PAT 1027. Colors in Mars
查看>>
linux定时执行脚本
查看>>
Oauth支持的5类 grant_type 及说明
查看>>
ASP.NET 5 DNX SDK删除旧版本
查看>>
Android ListView 九大重要属性详细分析
查看>>
CC++中sizeof函数的用法
查看>>
SPFA 算法详解( 强大图解,不会都难!) (转)
查看>>