nginx安装方法
2017-04-29 14:35
85 查看
nginx安装
准备安装包
pcre-8.40.tar.gz
nginx-1.8.0.tar.gz
[root@localhost soft]# tar -zxf pcre-8.40.tar.gz
cd pcre-8.40
./configure && make && make install
[root@localhost soft]# tar -zxf nginx-1.8.0.tar.gz
[root@localhost soft]# useradd nginx -s /sbin/nologin -M
cd nginx-1.8.0
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module
检查语法
[root@localhost local]# ./nginx/sbin/nginx -t
libpcre.so 没有指定这个库
[root@localhost local]# find / -name libpcre.so*
[root@localhost local]# find / -name libpcre.so*
/soft/pcre-8.40/.libs/libpcre.so.1
/soft/pcre-8.40/.libs/libpcre.so.1.2.8
/soft/pcre-8.40/.libs/libpcre.so
/usr/local/pcre/lib/libpcre.so.0.0.1
/usr/local/pcre/lib/libpcre.so.0
/usr/local/pcre/lib/libpcre.so
/usr/local/lib/libpcre.so.1
/usr/local/lib/libpcre.so.1.2.8
/usr/local/lib/libpcre.so
/tar/pcre-8.10/.libs/libpcre.so.0.0.1
/tar/pcre-8.10/.libs/libpcre.so.0
/tar/pcre-8.10/.libs/libpcre.so
/lib/libpcre.so.0.0.1
/lib/libpcre.so.0
[root@localhost local]# vim /etc/ld.so.conf
/usr/local/lib
wq
ldconfig #使用库文件再次生效
[root@localhost local]# ./nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
启动nginx注意
[root@localhost local]# ./nginx/sbin/nginx
[root@localhost local]# ps -ef | grep ngins
root 11957 1679 0 19:30 pts/0 00:00:00 grep ngins
[root@localhost local]# ps -ef | grep nginx
root 11954 1 0 19:30 ? 00:00:00 nginx: master process ./nginx/sbin/nginx
nginx 11955 11954 0 19:30 ? 00:00:00 nginx: worker process
root 11959 1679 0 19:30 pts/0 00:00:00 grep nginx
[root@localhost local]# lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 11954 root 6u IPv4 32485 0t0 TCP *:http (LISTEN)
nginx 11955 nginx 6u IPv4 32485 0t0 TCP *:http (LISTEN)
[root@localhost local]# curl -I 172.20.100.134
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Mon, 24 Apr 2017 11:33:10 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 24 Apr 2017 11:21:55 GMT
Connection: keep-alive
ETag: "58fddfd3-264"
Accept-Ranges: bytes
安装完成 HTTP/1.1 200 OK
准备安装包
pcre-8.40.tar.gz
nginx-1.8.0.tar.gz
[root@localhost soft]# tar -zxf pcre-8.40.tar.gz
cd pcre-8.40
./configure && make && make install
[root@localhost soft]# tar -zxf nginx-1.8.0.tar.gz
[root@localhost soft]# useradd nginx -s /sbin/nologin -M
cd nginx-1.8.0
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module
检查语法
[root@localhost local]# ./nginx/sbin/nginx -t
libpcre.so 没有指定这个库
[root@localhost local]# find / -name libpcre.so*
[root@localhost local]# find / -name libpcre.so*
/soft/pcre-8.40/.libs/libpcre.so.1
/soft/pcre-8.40/.libs/libpcre.so.1.2.8
/soft/pcre-8.40/.libs/libpcre.so
/usr/local/pcre/lib/libpcre.so.0.0.1
/usr/local/pcre/lib/libpcre.so.0
/usr/local/pcre/lib/libpcre.so
/usr/local/lib/libpcre.so.1
/usr/local/lib/libpcre.so.1.2.8
/usr/local/lib/libpcre.so
/tar/pcre-8.10/.libs/libpcre.so.0.0.1
/tar/pcre-8.10/.libs/libpcre.so.0
/tar/pcre-8.10/.libs/libpcre.so
/lib/libpcre.so.0.0.1
/lib/libpcre.so.0
[root@localhost local]# vim /etc/ld.so.conf
/usr/local/lib
wq
ldconfig #使用库文件再次生效
[root@localhost local]# ./nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
启动nginx注意
[root@localhost local]# ./nginx/sbin/nginx
[root@localhost local]# ps -ef | grep ngins
root 11957 1679 0 19:30 pts/0 00:00:00 grep ngins
[root@localhost local]# ps -ef | grep nginx
root 11954 1 0 19:30 ? 00:00:00 nginx: master process ./nginx/sbin/nginx
nginx 11955 11954 0 19:30 ? 00:00:00 nginx: worker process
root 11959 1679 0 19:30 pts/0 00:00:00 grep nginx
[root@localhost local]# lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 11954 root 6u IPv4 32485 0t0 TCP *:http (LISTEN)
nginx 11955 nginx 6u IPv4 32485 0t0 TCP *:http (LISTEN)
[root@localhost local]# curl -I 172.20.100.134
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Mon, 24 Apr 2017 11:33:10 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Mon, 24 Apr 2017 11:21:55 GMT
Connection: keep-alive
ETag: "58fddfd3-264"
Accept-Ranges: bytes
安装完成 HTTP/1.1 200 OK
相关文章推荐
- linux 下安装nginx经常出现 make[2]: Leaving directory `/usr/local/ssl' 或make[2]: Leaving directory `/usr/local/openssl' 找不到的情况解决方法
- Centos Nginx + Svbversion配置安装方法分享
- nginx安装方法
- Nginx 安装成Windows 服务方法
- ubunut 安装nginx基本目录结构介绍和配置使用方法
- 安装Nginx+MySQL+PHP后执行.php程序后产生的错误解决方法:
- LNMP一键安装包的Nginx 502 Bad Gateway错误可能原因及解决方法
- centos安装nginx+mysql+php+fastcgi+memcache最简单方法
- RHEL5.8下在线安装nginx的方法
- CentOS6.5安装nginx1.5.8时出现“cp: "conf/koi-win" 与"/usr/local/nginx/conf/koi-win" 为同一文件”的解决方法
- centos5 源码安装Nginx + mysql + apache + php的方法
- Nginx安装BugFree后/site/login 不能访问的问题解决方法--Nginx启用rewrite
- centos5 源码安装Nginx + mysql + apache + php的方法
- nginx + nginx-gridfs 安装方法
- nginx服务器的安装和配置的方法介绍
- centos安装nginx+mysql+php+fastcgi+memcache最简单方法
- ubunut11.0安装nginx基本目录结构介绍和配置使用方法
- 安装nginx 报“./configure: error: the HTTP gzip module requires the zlib library.”解决方法
- VPS配置安装nginx和vsftpd方法详解
- lnmp一键安装包nginx 502错误解决方法汇总