Blogger Information
Blog 11
fans 0
comment 0
visits 8055
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
linux学习之第三步nginx安装
四火同学的博客
Original
804 people have browsed it

在前面的memcached配置安装过程中出现几个小问题,基本上靠查资料解决了。接下来的nginx安装稍微麻烦点,因为在安装过程中nginx需要配置安装的组件比较多。一般这种情况可以先使用yum直接安装需要的组件不需要一步步等编译的报错后再去下载相关源码--with pcre=/**/** 等等太过于耗费时间。因此可以先

yum install pcre pcre-devel 先下载安装相关的拓展,避免后续浪费过多的时间进行编译。
yum install zlib zlib-devel

下载nginx源码:https://nginx.org/download/nginx-1.12.1.tar.gz

cd /usr/local/src
wget 
tar vfxz nginx-1.12.1.tar.gz
cd nginx-1.12.1
./configure --prefix=/usr/local/nginx 
make && make install

启动nginx:

cd /usr/local/nginx
./sbin/nginx

在客户端ping 服务器ip。 win7界面选择执行->cmd

ping 192.168.83.128 80

ping的结果又数据返回连接成功,浏览器地址栏输入192.168.83.128,页面无法识别。考虑是防火墙的问题;

找了很多的资料,centos 6含6之前的版本防火墙使用的是iptables。centos7使用的防火墙命令为:

firewall-cmd --zone=public --add-port=80/tcp --permanent

命令含义:

–zone #作用域

–add-port=80/tcp #添加端口,格式为:端口/通讯协议

–permanent #永久生效,没有此参数重启后失效

重启防火墙:

systemctl stop firewalld.service 
systemctl start firewalld.service

再次刷新就可以了。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!