您的位置:首页 > 运维架构 > Nginx

centos nginx 架设操作记录

2015-12-29 11:36 543 查看
安装nginx

1、CentOS 6,先执行:

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2,查看yum的nginx信息

yum info nginx

3,安装并启动nignx

[root@server ~]# yum install nginx

[root@server ~]# service nginx start

Starting nginx: [ OK ]

4,然后进入浏览器,输入http://192.168.0.161/测试,如果看到

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.
就是OK了

看不到,要设置下防火墙

5 查看服务

chkconfig --list

6.防火墙 开启80 端口

vi /etc/sysconfig/iptables

加入:-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

7 重新启动服务:

service iptables restart

8 查看端口使用

netstat -tunlp
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: