叢集二nginx
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel gd gd-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers pcre pcre-devel ImageMagick ImageMagick-devel git
wget http://nginx.org/download/nginx-1.10.2.tar.gz
useradd -s /sbin/nologin -M nginx
tar zxf nginx-1.10.2.tar.gz
cd nginx-1.10.2/
./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-http_slice_module
–with-mail
–with-mail_ssl_module
–with-file-aio
–with-http_v2_module
–with-ipv6
–add-module=/hequan/ngx_log_if
make && make install
mkdir -p /var/tmp/nginx/{client,proxy,fastcgi,uwsgi,scgi}
mkdir -p /var/cache/nginx/client_temp
vim /lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
systemctl enable nginx.service
systemctl start nginx.service
vim /usr/local/nginx/conf/nginx.conf
server {
listen 80;
root /data/web/www;
server_name www.hequan.lol;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .*.(php)?$ {
expires -1s;
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
access_log_bypass_if ($uri = `/health.php`); #日誌過濾模組
access_log_bypass_if ($uri = `/health.html`);
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
iptables -P INPUT DROP
iptables -I INPUT -p tcp –dport 80 -j ACCEPT
/usr/libexec/iptables/iptables.init save
本文轉自 295631788 51CTO部落格,原文連結:http://blog.51cto.com/hequan/1886308,如需轉載請自行聯絡原作者
相關文章
- Nginx反代MogileFS叢集Nginx
- 二、Linux部署RabbitMQ叢集LinuxMQ
- MongoDB Sharding(二) -- 搭建分片叢集MongoDB
- Keepalived+Nginx高可用叢集搭建筆記Nginx筆記
- Nginx 高階篇(十一)叢集搭建實戰Nginx
- Nginx + Docker 手動叢集方式執行 EMQNginxDockerMQ
- 13、nginx服務叢集搭建以及優化Nginx優化
- Nginx學習筆記(反向代理&搭建叢集)Nginx筆記
- Elasticsearch(二)--叢集原理及優化Elasticsearch優化
- Zookeeper叢集搭建和簡介(二)
- Zookeeper叢集 + Kafka叢集Kafka
- docker初體驗:docker部署nginx負載均衡叢集DockerNginx負載
- Nginx搭建Tomcat9叢集並實現Session共享NginxTomcatSession
- Linux環境搭建Nginx+Tomcat負載均衡叢集LinuxNginxTomcat負載
- Nginx 筆記:反向代理&專案釋出&搭建叢集Nginx筆記
- 大資料叢集搭建 – 2. CDH叢集安裝 – NTP,MYSQL,nginx安裝大資料MySqlNginx
- 搭建zookeeper叢集(偽叢集)
- 【工具-Nginx】從入門安裝到高可用叢集搭建Nginx
- Harbor1.9+Nginx高可用叢集倉庫搭建筆記Nginx筆記
- centos7下配置nginx反向代理負載均衡叢集CentOSNginx負載
- 深入淺出Websocket(二)分散式Websocket叢集Web分散式
- zookeeper叢集及kafka叢集搭建Kafka
- Kubernetes叢集部署史上最詳細(二)Prometheus監控Kubernetes叢集Prometheus
- 使用Redis儲存Nginx+Tomcat負載均衡叢集的SessionRedisNginxTomcat負載Session
- Redis系列:搭建Redis叢集(叢集模式)Redis模式
- linux下搭建ZooKeeper叢集(偽叢集)Linux
- redis偽叢集配置Cluster叢集模式Redis模式
- 基於Kubernetes v1.24.0的叢集搭建(二)
- Hadoop 系列(二)—— 叢集資源管理器 YARNHadoopYarn
- 高可用叢集corosync+pacemaker之crmsh使用(二)ROS
- 【kubernetes叢集系列(二)】Worker(node)安裝(使用kubeadm)
- kafka系列二:多節點分散式叢集搭建Kafka分散式
- K8s叢集nginx-ingress監控告警最佳實踐K8SNginx
- mariadb叢集與nginx負載均衡配置–centos7版本Nginx負載CentOS
- redis叢集Redis
- ceph叢集
- redis 叢集Redis
- RabbitMQ叢集MQ
- ES叢集