linux 服务器常用脚本,linux服务器脚本


linux 服务器常用脚本

(1)nginx

重新加载配置文件:

reload.sh :

#!/bin/sh
/usr/local/nginx/sbin/nginx -s reload   

 

启动nginx:

#!/bin/sh
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf  

 

域名转发:

/usr/local/nginx/vhosts/blog.hbjltv.com.conf  

server {
        listen 80;
        server_name blog.hbjltv.com;
#       rewrite ^/yhyc/(.*)$ http://www.yhskyc.com/$1 ;

        location /  {
                proxy_pass    http://hbjltv.com:8084/convention2/;
        #       proxy_redirect off ;

                index index.php index.html index.htm;
        }
location /convention2/  {
                proxy_pass    http://hbjltv.com:8084/convention2/;
        #       proxy_redirect off ;
        #
        #       #               index index.php index.html index.htm;
        #               }
        error_page 500 502 503 504 /50x.html;

        }
location /convention/upload/ {
 proxy_pass    http://hbjltv.com:8084/convention2/upload/;
}

}  

 

 (3)在重定向到文件的同时显示在控制台

使用 tee -a

java -Dapp.home=$DEPLOY_DIR $JAVA_OPTS $JAVA_MEM_OPTS $JAVA_DEBUG_OPTS $JAVA_JMX_OPTS -classpath $CONF_DIR:$LIB_JARS $APP_MAINCLASS  2>&1 |tee -a $STDOUT_FILE

 

 

 

 

 

相关内容

    暂无相关文章