預備安裝環境
yum -y install proc* openssl* pcre*
其他相關套件一起裝一下
yum -y install telnet ntpdate sntp unzip wget mlocate net-tools mailx iftop id3lib libid3tag
nginx_tcp_proxy_module
達到代理或是 Load balance 的目的喔!!~yum -y install proc* openssl* pcre*
yum -y install telnet ntpdate sntp unzip wget mlocate net-tools mailx iftop id3lib libid3tag
wget http://nginx.org/download/nginx-1.9.4.tar.gz tar zxvf nginx-1.9.4.tar.gz
cd nginx-1.9.4 ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' make; make install
user nobody; worker_processes 1; events { worker_connections 1024; } stream { server { listen 443; proxy_pass admin; } upstream admin { server admin.uim.cloud:443; } }
server { listen 53 udp; proxy_pass DNS; } upstream DNS{ server 8.8.8.8:53; }
vi /usr/lib/systemd/system/nginx.service
[Unit] Description=nginx After=network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/var/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf ExecReload=/usr/sbin/nginx -s reload ExecStop=/usr/sbin/nginx -s stop ExecQuit=/usr/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user.target
systemctl enable nginx
systemctl start nginx
firewall-cmd --permanent --add-port=443/tcp firewall-cmd --reload