Puppet:nginx+mongrel to achieve load balancing

Source: Internet
Author: User
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 gro Upadd 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--w Ith-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_mod         
    Ule--with-http_ssl_module make && make install touch $path _nginx/html/index.php process () { Zero= ' for ((i=1;i<= $CORE _num;i++));d o echo-n "0";d one; ' for ((i = $CORE _num; i > o; i--)); Do echo-n ${zero:0: $i-1} "1" ${zero: $i} "done} sed-i" S/worker_processes.*/worker_proc Esses $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 "a#\nlocation ~ \\\.php$ {\nfastcgi_p Ass 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/ini T.d/nginxd chkconfig--add nginxd chkconfig nginxd on kill-9 '/usr/sbin/lsof-i:8140 | GreP 8140 |awk ' {print $} ' echo ' ############################################ ' echo ' status "Service nginxd start service puppetmaster start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.