2013年4月2日星期二

Apache rule

1. rewrite
RewriteRule ^(.*)/(.+)/ip/([^/d]+)     /catalog/$3?%{QUERY_STRING}%

Ref: http://blog.csdn.net/benjieming_wang/article/details/4015148

2. VirtualHost Configure

<VirtualHost *:80>
ServerName wiki2.myciscolab.net
DocumentRoot /www/webapps/wiki2.myciscolab.net/
ErrorLog /var/log/apache2/wiki2.myciscolab.net-error.log
CustomLog /var/log/apache2/wiki2.myciscolab.net-access.log combined
<Location />
    AuthType Basic
    AuthName "WikiLogin"
    AuthUserFile "/www/webapps/wiki2.myciscolab.net/.user"
    Require valid-user
</Location>
<Directory "/wiki2/webapps/wiki2.myciscolab.net">
    Options Indexes FollowSymLinks MultiViews IncludesNoExec
</Directory>
</VirtualHost>

3. Server-Status

<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from .example.com
</Location>

Access URL:
http://your.server.name/server-status?refresh=N

4. AuToIndexes Configure

<Location />
    Options +Indexes
    IndexOptions Charset=UTF-8
    HeaderName /var/www/HEADER.html
</Location>

5. ERROR 1

root@Singapore:/etc/apache2# service apache2 restart
 * Restarting web server apache2                                                WARNING: MaxClients (25) is not an integer multiple
 of ThreadsPerChild (2), lowering MaxClients to 24
 for a maximum of 12 child processes,
 ... waiting .WARNING: MaxClients (25) is not an integer multiple
 of ThreadsPerChild (2), lowering MaxClients to 24
 for a maximum of 12 child processes

Edit File : /etc/apache2/apache2.conf

<IfModule mpm_prefork_module>
StartServers       1
MinSpareServers    1
MaxSpareServers    5
#MaxClients        10
MaxClients        4
    MaxRequestsPerChild   0
</IfModule>

<IfModule mpm_worker_module>
StartServers       1
MinSpareThreads    1
MaxSpareThreads    4
    ThreadLimit          64
    ThreadsPerChild      2
#MaxClients        10
MaxClients        4
    MaxRequestsPerChild   0
</IfModule>




没有评论:

发表评论