1.yum解决编译nginx所需的依赖包,之后你的nginx就不会报错了
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel openssl openssl-devel -
y
2.安装配置nginx软件,下载源代码
wget -c https:
//nginx.org/download/nginx-1.12.0.tar.gz
3.解压缩源码,编译且安装
tar -zxvf nginx-
1.12.
0.tar.gz
切换源码目录
./configure --prefix=/opt/nginx112/
make &&
make install
4.进入nginx的工作目录
cd /opt/ngin112/
5.查看gninx的工作目录
[root@localhost nginx112]# ls
conf 配置文件目录
html 网页根目录,你的index.html就放在这里,然后通过域名访问 pythonav.cn/index.html html/
index.html
logs 日志
sbin 存放nginx可执行命令的
6.定制自己的nginx网站
修改/opt/nginx112/html/
index.html 这是nginx网页根文件,清空内容写入自己的html标签
7.启动nginx服务器
/opt/nginx112/sbin/
nginx 直接回车执行
8.检查nginx服务端口
ps -ef|
grep nginx
9.通过windows访问nginx web服务
浏览器 访问http://192.168.13.79
转载于:https://www.cnblogs.com/RootEvils/p/10211687.html
相关资源:Nginx入门到实践 Nginx 中间件