当前第2页 返回上一页
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | [root@centos7-1 nginx-1.12.0]# vim /etc/init.d/nginx
#!/bin/bash
# chkconfig: - 99 20
# description: Nginx Service Control Script
PROG= "/usr/local/nginx/sbin/nginx"
PIDF= "/usr/local/nginx/logs/nginx.pid"
case "$1" in
start)
$PROG
;;
stop)
kill -s QUIT $(cat $PIDF )
;;
restart)
$0 stop
$0 start
;;
reload)
kill -s HUP $(cat $PIDF )
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
exit 0
|
1 2 3 | [root@centos7-1 nginx-1.12.0]# chmod +x /etc/init.d/nginx
[root@centos7-1 nginx-1.12.0]# chkconfig --add nginx
[root@centos7-1 nginx-1.12.0]# systemctl start nginx.service
|
确认Nginx服务是否正常运行
通过检查Nginx程序的监听状态,或者在浏览器中访问此Web服务,默认页面将显示“Welcome to nginx!”
1 2 3 4 | [root@centos7-1 nginx-1.12.0]# netstat -antp | grep nginx
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 54386/nginx: master
[root@centos7-1 nginx-1.12.0]# yum install elinks -y
[root@centos7-1 nginx-1.12.0]# elinks http:
|

以上就是怎么实现nginx访问的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
nginx怎么解决跨域
nginx启动失败怎么解决
nginx如何添加stream模块
如何实现nginx高可用
nginx是什么,做什么用的?
你知道nginx怎样查看并发连接数么
nginx反向代理是什么
阿里云服务器端口怎么开放
nginx如何防止ssl证书过期
apache和nginx可以装一起吗
更多相关阅读请进入《nginx》频道 >>
转载请注明出处:木庄网络博客 » 怎么实现nginx访问