yum install -y rubygem-mongrel echo -e "PUPPETMASTER_PORTS=( 18140 18141 18142 18143 18144 )\nPUPPETMASTER_EXTRA_OPTS=\"—servertype=mongrel --ssl_client_header=HTTP_X_SSL_SUBJECT\"" > /etc/sysconfig/puppetmaster useradd www groupadd www CORE_NUM=`cat /proc/cpuinfo | grep "model name" | wc -l` cd $path tar -zxvf pcre-8.10.tar.gz cd pcre-8.10/ make clean ./configure --disable-shared --with-pic make && make install cd ../ tar -zxvf nginx-1.2.1.tar.gz cd ./nginx-1.2.1/ ./configure --prefix=$path_nginx --with-http_stub_status_module --with-http_ssl_module make && make install touch $path_nginx/html/index.php process () { ZERO=`for((i=1;i<=$CORE_NUM;i++));do echo -n "0";done;` for (( i = $CORE_NUM; i > o; i-- )); do echo -n ${ZERO:0:$i-1}"1"${ZERO:$i}" " done } sed -i "s/worker_processes.*/worker_processes $CORE_NUM;\nworker_cpu_affinity $(process);/" $path_nginx/conf/nginx.conf sed -i "s/#user.*/user www www;/" $path_nginx/conf/nginx.conf sed -i "s/index.html index.htm;/index.php &/" $path_nginx/conf/nginx.conf sed -i "47 a#\nlocation ~ \\\.php$ {\nfastcgi_pass 127.0.0.1:9000;\nfastcgi_index index.php;\nfastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/\$fastcgi_script_name;\ninclude fastcgi_params;\ninclude fastcgi.conf;}#" $path_nginx/conf/nginx.conf ######隐藏版本号########################## sed -i "s/^http {/&\n server_tokens off;/" $path_nginx/conf/nginx.conf ###################################nginx自启动######################################## #sed -i "s#^path_nginx=.*#path_nginx=$path_nginx#" $path/nginxd cp $path/nginxd /etc/init.d/ mv $path_nginx/conf/nginx.conf $path_nginx/conf/nginx.conf.bak mv $path/nginx.conf $path_nginx/conf chmod 755 /etc/init.d/nginxd chkconfig --add nginxd chkconfig nginxd on kill -9 `/usr/sbin/lsof -i:8140 | grep 8140 |awk '{print $2}'` echo "############################################" echo " status " service nginxd start service puppetmaster start
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索nginx
, conf
, index
, nginx.conf
, sed
, make
, install
, Core生成Tokens
, Nginx负载均衡
RubyGem
activemq实现负载均衡、nginx实现负载均衡、如何实现负载均衡、负载均衡实现、负载均衡有哪些来实现,以便于您获取更多的相关知识。
时间: 2025-01-06 00:25:53