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 阅读(416)
评论(0) 编辑 收藏 所属分类:
每日一记 、
Tool 安装应用