首页 > 技术文章 > nginx 安装

webttt 2019-01-22 16:12 原文

 一、windows

参考网址:https://www.cnblogs.com/jiangwangxiang/p/8481661.html

1、下载安装包

http://nginx.org/en/download.html 

2、解压

3、双击 nginx.exe启动

4、查看http://127.0.0.1:80

4、配置端口

nginx的配置文件是conf目录下的nginx.conf,默认配置的nginx监听的端口为80

修改了nginx的配置文件nginx.conf 时,执行命令 nginx -s reload 即可让改动生效

5、关闭nginx

CMD命令窗口 nginx -s stop(快速停止nginx)  或  nginx -s quit(完整有序的停止nginx)

二、linux

参考网址:http://www.runoob.com/linux/nginx-install-setup.html

补充:Nginx与PHP配置

1、#vim /usr/local/webserver/nginx/conf/nginx.conf     <==进入NGINX配置文件

 

 

2、#cd  /usr/local/webserver/nginx/html      <==进入站点目录

3、# vim test.php                            <==新建测试网页

4、写入内容

<?php

phpinfo();

?>

5、访问页面

http://127.0.0.1:81/test.php

 

 

推荐阅读