This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| MY_URL="http://moefou.org" #change you website | |
| RESULT_502=`curl -I $MY_URL|grep "HTTP/1.1 502"` | |
| RESULT_504=`curl -I $MY_URL|grep "HTTP/1.1 504"` | |
| if [ -n "$RESULT_502" ]; then | |
| killall php-fpm;php-fpm | |
| date>>/data/logs/web_error.log;echo "502 Bad Gateway">>/data/logs/web_error.log | |
| elif [ -n "$RESULT_504" ]; then | |
| killall php-fpm;php-fpm | |
| date>>/data/logs/web_error.log;echo "504 Gateway Time-out">>/data/logs/web_error.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel wget | |
| mkdir -p src && cd src | |
| nginxVersion="1.7.6" | |
| wget http://nginx.org/download/nginx-$nginxVersion.tar.gz | |
| tar -xzf nginx-$nginxVersion.tar.gz | |
| ln -sf nginx-$nginxVersion nginx | |
| cd nginx | |
| ./configure \ | |
| --user=nginx \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # nginx - this script starts and stops the nginx daemin | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
| # proxy and IMAP/POP3 proxy server | |
| # processname: nginx | |
| # config: /etc/nginx/nginx.conf | |
| # pidfile: /var/run/nginx.pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo yum install httpd | |
| sudo service httpd start | |
| sudo yum install mysql-server | |
| sudo service mysqld start | |
| sudo /usr/bin/mysql_secure_installation | |
| sudo yum install php php-mysql | |
| yum search php- |