nginx服务器:
(1)通过xftp工具从本地(Win10)上传到服务器(Centos7);
本地目录下的nginx文件传到CentOS7下的/home/water/nginx/目录
su root
cd /home/water/nginx/
ls
(2)解压文件
tar -xvf nginx-1.10.3.tar.gz
(3)安装nginx
cd /home/water/nginx/nginx-1.10.3
ls
// 执行命令
./configure
// 执行make命令
make
// 执行make install命令
make install
(4)配置nginx.conf
// 查看配置文件nginx.conf
cat /usr/local/nginx/conf/nginx.conf
// 修改配置文件nginx.conf
vim /usr/local/nginx/conf/nginx.confserver {
#监听端口
listen 80;
#指定网站域名
server_name localhost;#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
(5)查看nginx进程是否启动:
ps -ef | grep nginx
(6)启动nginx服务器
// 进入目录
cd /usr/local/nginx/sbin./nginx 启动
./nginx -s stop 关闭
./nginx -s reload 重启
(7)再查看nginx进程是否启动:
ps -ef | grep nginx
root 10097 1 0 12:54 ? 00:00:00 nginx: master process ./nginx
nobody 10098 10097 0 12:54 ? 00:00:00 nginx: worker process
root 11117 9652 0 14:35 pts/1 00:00:00 grep --color=auto nginx
(8)关闭CentOS7防火墙
systemctl stop firewalld.service
(9)访问服务器ip查看
192.168.2.6
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.Thank you for using nginx.
成功
CentOS7安装配置Nginx服务器
原创
©著作权归作者所有:来自51CTO博客作者闭关苦炼内功的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
CentOS7配置nginx自启动
配置Nginx服务开机启动
nginx linux nginx安装 配置文件 重启 -
Centos7 配置Nginx实现HTTPS
本文主要简单介绍了nginx怎么实现https加密!
nginx 搭建 https -
CentOS7 配置Nginx域名HTTPS
【代码】CentOS7 配置Nginx域名HTTPS。
nginx https 运维 Nginx SSL