jojo's blog--快樂憂傷都與你同在
          為夢想而來,為自由而生。 性情若水,風起水興,風息水止,故時而激蕩,時又清平……
          posts - 11,  comments - 30,  trackbacks - 0
          cat httpd-vhosts.conf
          --------------------------------------------------------------------------------------------
          #
          # Virtual Hosts
          #
          # If you want to maintain multiple domains/hostnames on your
          # machine you can setup VirtualHost containers for them. Most configurations
          # use only name-based virtual hosts so the server doesn't need to worry about
          # IP addresses. This is indicated by the asterisks in the directives below.
          #
          # Please see the documentation at
          # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
          # for further details before you try to setup virtual hosts.
          #
          # You may use the command line option '-S' to verify your virtual host
          # configuration.

          #
          # Use name-based virtual hosting.
          #
          NameVirtualHost *:8080

          #
          # VirtualHost example:
          # Almost any Apache directive may go into a VirtualHost container.
          # The first VirtualHost section is used for all requests that do not
          # match a ServerName or ServerAlias in any <VirtualHost> block.
          #

          <VirtualHost *:8080>
          DocumentRoot /usr/local/site/webroot/mydomain1.com
          ServerName mydomain1.com
          ErrorLog "/var/log/apache_log/mydomain1.com-error_log"
          CustomLog "|/usr/local/site/apache/bin/rotatelogs /var/log/apache_log/apache_accesslog/mydomain1.com-access_log.%Y%m%d 86400 -360" common
          <Directory "/usr/local/site/webroot/mydomain1.com">
          Options -Indexes FollowSymLinks
          AllowOverride None
          Options ExecCGI
          #Options None
          Order allow,deny
          Allow from all

          #AuthType basic
          #AuthName "private area"
          #AuthBasicProvider file
          #AuthUserFile /usr/local/site/webroot/mydomain1.com/.htpasswd
          #Require valid-user
          #Options Indexes FollowSymLinks
          #AllowOverride All
          #Order deny,allow
          ErrorDocument 404  '/?c=interact.image&f=show'
          </Directory>
          RedirectMatch 404 /".svn(/|$)

          </VirtualHost>


          <VirtualHost *:8080>
          DocumentRoot /usr/local/site/webroot/mydomain2.com
          ServerName mydomain2.com
          ErrorLog "/var/log/apache_log/hkogop-error_log"
          CustomLog "|/usr/local/site/apache/bin/rotatelogs /var/log/apache_log/apache_accesslog/mydomain2.com-access_log.%Y%m%d 86400 -360" common
          <Directory "/usr/local/site/webroot/mydomain2.com">
          Options -Indexes FollowSymLinks
          AllowOverride None
          Order allow,deny
          Allow from all

          #AuthType basic
          #AuthName "private area"
          #AuthBasicProvider file
          #AuthUserFile /usr/local/site/webroot/mydomain1.com/.htpasswd
          #Require valid-user
          #Options -Indexes FollowSymLinks
          #AllowOverride All
          #Order deny,allow
          ErrorDocument 404  '/?c=interact.image&f=show'
          </Directory>
          RedirectMatch 404 /".svn(/|$)

          </VirtualHost>


          <VirtualHost *:8080>
          DocumentRoot /usr/local/site/webroot/mydomain3.com
          ServerName mydomain3.com
          ErrorLog "/var/log/apache_log/stage-hkogop-error_log"
          CustomLog "|/usr/local/site/apache/bin/rotatelogs /var/log/apache_log/apache_accesslog/mydomain3.com-access_log.%Y%m%d 86400 -360" common
          <Directory "/usr/local/site/webroot/mydomain3.com">
          Options -Indexes FollowSymLinks
          AllowOverride All
          Order allow,deny
          Allow from all

          #AuthType basic
          #AuthName "private area"
          #AuthBasicProvider file
          #AuthUserFile /usr/local/site/webroot/mydomain3.com/.htpasswd
          #Require valid-user
          #Options -Indexes FollowSymLinks
          #AllowOverride All
          #Order deny,allow
          </Directory>
          RedirectMatch 404 /".svn(/|$)

          </VirtualHost>



          <VirtualHost *:8080>
          DocumentRoot /usr/local/site/webroot/mydomain4.com
          ServerName mydomain4.com
          ErrorLog "/var/log/apache_log/mydomain4.com-error_log"
          CustomLog "|/usr/local/site/apache/bin/rotatelogs /var/log/apache_log/apache_accesslog/mydomain4.com-access_log.%Y%m%d 86400 -360" common

          <Directory "/usr/local/site/webroot/mydomain4.com">
          Options -Indexes FollowSymLinks
          AllowOverride None
          Order allow,deny
          Allow from all

          #AuthType basic
          #AuthName "private area"
          #AuthBasicProvider file
          #AuthUserFile /usr/local/site/webroot/mydomain4.com/.htpasswd
          #Require valid-user
          #Options -Indexes FollowSymLinks
          #AllowOverride All
          #Order deny,allow

          </Directory>
          <Location /zcart/index.php>
           Order Deny,Allow
           Deny from All
           Satisfy All
          </Location>

          RedirectMatch 404 /".svn(/|$)
          </VirtualHost>

          cat nginx.conf
          --------------------------------------------------------------------------------------------
          user  mdrop;
          worker_processes  1;
          master_process on;
          daemon off;

          error_log  logs/error.log;
          #error_log  logs/error.log  info;

          #pid        logs/nginx.pid;


          events {
              worker_connections  1024;
          }


          http {
              include       mime.types;
              default_type  application/octet-stream;

              log_format  main  '$remote_addr - $remote_user [$time_local] $request '
                                '"$status" $body_bytes_sent "$http_referer" '
                                '"$http_user_agent" "$http_x_forwarded_for"';

              access_log  logs/access.log  main;

              sendfile        on;
              tcp_nopush     on;
              tcp_nodelay     on;
              #keepalive_timeout  0;
              keepalive_timeout  65;


                  gzip on;
                  gzip_types text/html text/css ;
                  gzip_comp_level 3;
                  gzip_proxied any;
                  gzip_vary on;

              server {
                  listen       80;
                  server_name  _*;

                  #charset koi8-r;

                  #access_log  logs/access.log  ;

            
                  location ~* ".(jpg|jpeg|gif|css|png|js|ico|html|inc|mp3|xml|swf)$ {
                      root   /usr/local/site/webroot/$host/;
                      index  index.html index.htm index.php;
              }

                  location / {
                          proxy_pass   http://127.0.0.1:8080;
                  proxy_set_header  Host  $host;
                  proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                  proxy_pass_header Server;

                  client_max_body_size       8m;
                  client_body_buffer_size    128k;

                  proxy_connect_timeout      90;
                  proxy_send_timeout         90;
                  proxy_read_timeout         90;

                  proxy_buffer_size          4k;
                  proxy_buffers              64 32k;
                  proxy_busy_buffers_size    64k;
                  proxy_temp_file_write_size 64k;

                  }

                  #error_page  404              /404.html;

                  # redirect server error pages to the static page /50x.html
                  #
                  error_page   500 502 503 504  /50x.html;
                  location = /50x.html {
                      root   html;
                  }


                  # deny access to .htaccess files, if Apache's document root
                  # concurs with nginx's one
                  #
                  location ~ /".ht {
                      deny  all;
                  }
                  location ~ /".svn {
                      deny  all;
                  }

                  location ~ /"sql {
                      deny  all;
                  }

              }


              # another virtual host using mix of IP-, name-, and port-based configuration
              #
              #server {
              #    listen       8000;
              #    listen       somename:8080;
              #    server_name  somename  alias  another.alias;

              #    location / {
              #        root   html;
              #        index  index.html index.htm;
              #    }
              #}


              # HTTPS server
              #
              #server {
              #    listen       443;
              #    server_name  localhost;

              #    ssl                  on;
              #    ssl_certificate      cert.pem;
              #    ssl_certificate_key  cert.key;

              #    ssl_session_timeout  5m;

              #    ssl_protocols  SSLv2 SSLv3 TLSv1;
              #    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
              #    ssl_prefer_server_ciphers   on;

              #    location / {
              #        root   html;
              #        index  index.html index.htm;
              #    }
              #}

          }



          posted on 2009-06-11 11:48 Blog of JoJo 閱讀(429) 評論(0)  編輯  收藏 所屬分類: 每日一記Tool 安裝應用

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          相冊

          收藏夾

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 甘洛县| 玉环县| 南宫市| 盐池县| 多伦县| 瓮安县| 宜城市| 肃宁县| 深圳市| 石林| 如皋市| 蒲江县| 台东市| 盘锦市| 沅陵县| 江北区| 尚义县| 崇文区| 灵璧县| 平原县| 永顺县| 洪江市| 新干县| 甘南县| 榆树市| 鄂尔多斯市| 太白县| 稻城县| 罗定市| 海城市| 贵德县| 广水市| 东港市| 唐山市| 丰顺县| 台中市| 南漳县| 武隆县| 黄大仙区| 荆州市| 水城县|