- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
1、安装Nginx所需的pcre包和openssl-devel包
yum install pcre pcre-devel -y
yum install openssl openssl-devel -y
或者
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
tar zxf pcre-8.30.tar.gz
cd pcre-8.30
./configure
make
make install
安装完检查结果
rpm -qa pcre pcre-devel
rpm -qa openssl openssl-devel
2、开始安装Nginx
cd /home/chenct/tools
wget
useradd nginx -s /sbin/nologin -M
tar zxf nginx-1.2.9.tar.gz
cd nginx-1.2.9
./configure --user=nginx --group=nginx --prefix=/application/nginx-1.2.9 --with-http_stub_status_module --with-http_ssl_module
make && make install
ln -s /application/nginx-1.2.9 /application/nginx
ll /application/nginx
3、启动Nginx
启动前检查配置文件语法
/application/nginx/sbin/nginx -t
启动Nginx服务
/application/nginx/sbin/nginx
4、检查是否启动成功
查看Nginx对应服务端口是否启动成功
[root@chonter ~]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 1893 root 6u IPv4 12136 0t0 TCP *:http (LISTEN)
nginx 1894 nginx 6u IPv4 12136 0t0 TCP *:http (LISTEN)
You have new mail in /var/spool/mail/root
[root@chonter ~]# netstat -lnt|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
5、测试访问浏览器输入ip地址,出现“welcome to nginx!”表示安装成功。
6、LINUX下可通过wget 192.168.10.109命令检测是否启动成功。
[root@chonter ~]# wget 192.168.10.109
--2017-04-27 13:58:57-- http://www.landui.com/
正在连接 192.168.10.109:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:612 [text/html]
正在保存至: “index.html.2”
100%[================================================================>] 612 --.-K/s in 0s
2017-04-27 13:58:57 (66.5 MB/s) - 已保存 “index.html.2” [612/612])
7、或者用curl命令检测
[root@chonter ~]# curl 192.168.10.109
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://www.landui.com/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://www.landui.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
售前咨询
售后咨询
备案咨询
二维码
TOP