Quickly build intranet test network, simple simulation of Web cluster

Source: Internet
Author: User
Tags svn update

Simulating a Web cluster

Back-end Web clusters 192.168.1.231:8080 and 192.168.1.232:8080.web backend can be increased as needed, different directories start different ports, by using 192.168.1.231:80 as load balancer access.

upstream  www.front.com{    server   192.168.1.232:8080;    server   192.168.1.231:8080;}server{    listen  80;    server_name  192.168.1.231;    location / {        proxy_pass        http://www.front.com;        proxy_set_header   Host             $host;        proxy_set_header   X-Real-IP        $remote_addr;        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;    }}
SVN Auto Release

When using SVN commit, enter "Auto_deploy" in the comment and automatically publish to 231,232 of the project test server. SVN hook file Post-commit

#!/bin/bashREPOS="$1"REV="$2"if ( svnlook log -r $REV /data/www/svn/gtl/ |grep "auto_deploy" )then    echo "`date` auto_deploy">> /tmp/testsvn.log#front1    ssh [email protected] ‘svn update /data/wwwroot/gtl/ --username "sylar" --password "gtl1023"‘    ssh [email protected] ‘chown www.www -R /data/wwwroot/gtl‘#front2    ssh [email protected] ‘svn update /data/wwwroot/gtl/ --username "sylar" --password "gtl1023"‘    ssh [email protected] ‘chown www.www -R /data/wwwroot/gtl‘#admin    ssh [email protected] ‘svn update /data/wwwroot/admin/ --username "sylar" --password "gtl1023"‘    ssh [email protected] ‘chown www.www -R /data/wwwroot/admin‘fi
Another SVN hook, forcing SVN to enter a comment when committing
#!/bin/shREPOS="$1"TXN="$2"SVNLOOK=/usr/bin/svnlookLOGMSG=$($SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" | wc -c)if [ "$LOGMSG" -lt 10 ]; thenecho -e "\n 提交文件时必须添加注释,提交中止."1>&2exit 1fi

Quickly build intranet test network, simple simulation of Web cluster

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.