APMserv中对Apache优化的设置
我将注释干掉了。
注意其中对虚拟主机是如何设置的,是Apache2的写法,比较规范。
还有PHP限定到目录,安全模式的开启。
httpd.conf
ThreadsPerChild 500
MaxRequestsPerChild 10000
ServerRoot "D:/MyServer/Apache"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule ssl_module modules/mod_ssl.so
LoadFile "D:/MyServer/PHP/libmysql.dll"
LoadModule php5_module "D:/MyServer/PHP/php5apache2_2.dll"
PHPIniDir "D:/MyServer/PHP/php.ini"
ServerAdmin webmaster@localhost
ServerName 127.0.0.1:80
DocumentRoot "D:/MyServer/www/htdocs"
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml default.shtml
Order allow,deny
Deny from all
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
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
ScriptAlias /cgi-bin/ "D:/MyServer/www/cgi-bin/"
AllowOverride None
Options None
Order allow,deny
Allow from all
DefaultType text/plain
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
Include conf/extra/httpd-mpm.conf
Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-default.conf
Include conf/extra/httpd-ssl.conf
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
NameVirtualHost *:80
ServerName *
DocumentRoot "D:/MyServer/www/htdocs"
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
Alias /phpmyadmin "D:/MyServer/www/phpMyAdmin"
AllowOverride None
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
Alias /sqlitemanager "D:/MyServer/www/SQLiteManager"
AuthUserFile "D:/MyServer/SQLiteManPwd.ini"
AuthType Basic
AuthName "SQLiteManager管理员登录"
require valid-user
AllowOverride None
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
ProxyPass /asp http://127.0.0.1:10322
ProxyPassReverse /asp/ http://127.0.0.1:10322/
Include conf/apmserv/vhost.conf
Include conf/apmserv/vhost_ssl.conf
Include conf/apmserv/vdir.conf
vhost.conf
ServerName test.com
ServerAlias www.test.com
DocumentRoot "D:/MyServer/www/htdocs/test"
Options IncludesNOEXEC
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.shtml index.aspx default.aspx
AllowOverride None
Order Deny,Allow
Allow from all
php_admin_value open_basedir "D:/MyServer/www/htdocs/test/;D:/MyServer/PHP/uploadtemp/;D:/MyServer/PHP/sessiondata/"
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE¦TRACK)
RewriteRule .* - [F]
php_admin_value safe_mode On