shell Android apache Ubuntu 程序员 wordpress nginx 微软 mysql 开源 Windows linux命令 linux google Firefox centos Python HTML5 java php

Apache 的 httpd.conf文件实例

ServerRoot "/usr/local/apache2"
Listen 80
User daemon
Group daemon
ServerAdmin webmaster@wxd5981.com
ServerName www.wxd5981.com:80
DocumentRoot "/usr/local/apache2/htdocs"
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
UseCanonicalName Off
AccessFileName .htaccess
ServerTokens Prod
ServerSignature On
HostnameLookups Off
PidFile "logs/httpd.pid"
LockFile "logs/accept.lock"

StartServers          5
MinSpareServers       5
MaxSpareServers       10
ServerLimit           4500
MaxClients            3000
MaxRequestsPerChild   4000

<FilesMatch "^.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "/usr/local/apache2/htdocs">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
<Directory "/usr/local/apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
DirectoryIndex index.html

ErrorLog "logs/error_log"
LogLevel warn
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
CustomLog "logs/access_log" combined
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
DefaultType text/plain
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Addtype application/x-httpd-PHP .php .phtml
Addtype application/x-httpd-php-source .phps

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin webmaster@wxd5981.com
    DocumentRoot "/data/wwwroot/wxd5981"
    ServerName www.wxd5981.com
    JkMount /*.jsp ajp13
    ErrorLog "/data/logs/apache/error_log"
    CustomLog "|/usr/sbin/cronolog /data/logs/apache/wxd5981_accesslog.%Y-%m-%d" combined
</VirtualHost>

LoadModule jk_module modules/mod_jk.so
JkWorkersFile /usr/local/tomcat/conf/workers.properties
JkShmFile logs/mod_jk.shm
JkLogFile /usr/local/tomcat/logs/mod_jk.log
JkLogLevel info
JkMount /*.jsp ajp13

附上workers.properties:

workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/local/jdk6
ps=/
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.ajp13.connection_pool_size=1
worker.ajp13.connection_pool_timeout=900
worker.ajp13.socket_keepalive=1
worker.ajp13.socket_timeout=900
worker.ajp13.recovery_options=2

apache编译参数:

./configure --prefix=/usr/local/apache2 --enable-so --enable-headers --enable-expires --enable-rewrite

延伸阅读

评论