标签:
一:集群
[root@linux-node1 ~]# uname -r -m
3.10.0-229.20.1.el7.x86_64 x86_64
[root@linux-node1 ~]# cat /etc/hostname
linux-node1.oldboyedu.com
[root@linux-node1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.11 linux-node1.oldboyedu.com linux-node1
192.168.56.12 linux-node2.oldboyedu.com linux-node2
[root@linux-node1 ~]# rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
[root@linux-node1 ~]# yum install -y gcc glibc gcc-c++ make screen tree lrzsz
[root@linux-node1 ~]# yum install -y httpd
[root@linux-node1 ~]# sed -i ‘s/Listen 80/Listen 8080/g‘ /etc/httpd/conf/httpd.conf
[root@linux-node1 ~]# systemctl start httpd
[root@linux-node1 ~]# echo "cgt-test1" > /var/www/html/index.html
[root@linux-node1 ~]# curl http://192.168.56.11:8080/
cgt-test1
[root@linux-node1 ~]# useradd -s /sbin/nologin -M www
[root@linux-node1 ~]# yum -y install pcre-devel openssl-devel
[root@linux-node1 ~]# cd /usr/local/src
[root@linux-node1 ~]# wget http://nginx.org/download/nginx-1.9.12.tar.gz
[root@linux-node1 src]# tar zxf nginx-1.9.12.tar.gz
[root@linux-node1 src]# cd nginx-1.9.12
[root@linux-node1 nginx-1.9.12]#./configure --prefix=/usr/local/nginx-1.9.12 \
--user=www --group=www --with-http_ssl_module \
--with-http_stub_status_module --with-file-aio
[root@linux-node1 nginx-1.9.12]# make && make install
[root@linux-node1 nginx-1.9.12]# ln -s /usr/local/nginx-1.9.12/ /usr/local/nginx
[root@linux-node1 nginx-1.9.12]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.9.12/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.9.12/conf/nginx.conf test is successful
[root@linux-node1 nginx-1.9.12]# /usr/local/nginx/sbin/nginx
[root@linux-node1 nginx-1.9.12]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 8161 root 6u IPv4 20793 0t0 TCP *:http (LISTEN)
nginx 8162 www 6u IPv4 20793 0t0 TCP *:http (LISTEN)
[root@linux-node1 ~]# useradd -s /sbin/nologin -M www
[root@linux-node1 ~]# yum -y install pcre-devel openssl-devel
[root@linux-node1 ~]# cd /usr/local/src
[root@linux-node1 ~]# wget http://nginx.org/download/nginx-1.9.12.tar.gz
[root@linux-node1 src]# tar zxf nginx-1.9.12.tar.gz
[root@linux-node1 src]# cd nginx-1.9.12
[root@linux-node1 nginx-1.9.12]#./configure --prefix=/usr/local/nginx-1.9.12 \
--user=www --group=www --with-http_ssl_module \
--with-http_stub_status_module --with-file-aio
[root@linux-node1 nginx-1.9.12]# make && make install
[root@linux-node1 nginx-1.9.12]# ln -s /usr/local/nginx-1.9.12/ /usr/local/nginx
[root@linux-node1 nginx-1.9.12]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx-1.9.12/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx-1.9.12/conf/nginx.conf test is successful
[root@linux-node1 nginx-1.9.12]# /usr/local/nginx/sbin/nginx
[root@linux-node1 nginx-1.9.12]# lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 8161 root 6u IPv4 20793 0t0 TCP *:http (LISTEN)
nginx 8162 www 6u IPv4 20793 0t0 TCP *:http (LISTEN)
标签:
原文地址:http://www.cnblogs.com/caoxiaojian/p/5443217.html