标签:types load help lin name conf url roo disable
[root@xzwserver tools]# cat /etc/centos-release
CentOS release 6.7 (Final)
[root@xzwserver tools]# uname -r
2.6.32-573.el6.x86_64
[root@xzwserver tools]# rpm -qa pcre pcre-devel gcc gcc-c++
pcre-7.8-7.el6.x86_64
[root@xzwserver tools]# yum -y install pcre-devel pcre
[root@xzwserver tools]# rpm -qa openssl openssl-devel
openssl-1.0.1e-42.el6.x86_64
[root@xzwserver tools]# yum install -y openssl openssl-devel
mkdir -p /home/tools
cd /home/tools
wget -q http://nginx.org/download/nginx-1.12.0.tar.gz
[root@xzwserver tools]# useradd nginx -s /sbin/nologin -M
[root@xzwserver tools]# tar xf nginx-1.12.0.tar.gz
cd nginx-1.12.0
[root@xzwserver nginx-1.12.0]# ./configure --user=nginx --group=nginx --prefix=/application/nginx-1.12.0/ --with-http_stub_status_module --with-http_ssl_module
[root@xzwserver nginx-1.12.0]# ./configure --help
make
make install
[root@xzwserver nginx-1.12.0]# ln -s /application/nginx-1.12.0/ /application/nginx
[root@xzwserver nginx-1.12.0]# ll /application/nginx
lrwxrwxrwx. 1 root root 26 May 8 16:31 /application/nginx -> /application/nginx-1.12.0/
[root@xzwserver nginx-1.12.0]# /application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-1.12.0//conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.12.0//conf/nginx.conf test is successful
[root@xzwserver nginx-1.12.0]# /application/nginx/sbin/nginx
[root@xzwserver nginx-1.12.0]# netstat -anptu | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4359/nginx
[root@xzwserver nginx-1.12.0]# wget 127.0.0.1 或者 [root@xzwserver nginx-1.12.0]# curl 127.0.0.1
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config
grep ‘SELINUX=disabled‘ /etc/selinux/config
setenforce 0
getenforce
vim /etc/rc.d/rc.local 开机自启
mkdir html/www -p
252 echo "http://www.etiantian.org" > html/www/index.html
253 cat html/www/index.html
257 egrep -v ‘#|^$‘ conf/nginx.conf.default > conf/nginx.conf
258 vim conf/nginx.conf
259 sbin/nginx -t
260 sbin/nginx -s reload
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name www.etiantian.org;
location / {
root html/www;
index index.html index.htm;
}
}
}
~
标签:types load help lin name conf url roo disable
原文地址:http://www.cnblogs.com/linux985/p/7221678.html