APMserv中对Apache优化的设置

作者: aries 分类: PHP 发布时间: 2012-01-18 08:00 ė 1047次浏览 6 0评论

我将注释干掉了。

注意其中对虚拟主机是如何设置的,是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"

<span class="highlight-nb">Options</span> FollowSymLinks
<span class="highlight-nb">AllowOverride</span> <span class="highlight-k">None</span>
<span class="highlight-nb">Order</span> deny,allow
<span class="highlight-nb">Deny</span> from <span class="highlight-k">all</span>
<span class="highlight-nb">Satisfy</span> <span class="highlight-k">all</span>



<span class="highlight-nb">Options</span> Indexes FollowSymLinks Includes ExecCGI
<span class="highlight-nb">AllowOverride</span> <span class="highlight-k">None</span>
<span class="highlight-nb">Order</span> allow,deny
<span class="highlight-nb">Allow</span> from <span class="highlight-k">all</span>



<span class="highlight-nb">DirectoryIndex</span> index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml default.shtml



<span class="highlight-nb">Order</span> allow,deny
<span class="highlight-nb">Deny</span> from <span class="highlight-k">all</span>

ErrorLog logs/error.log

LogLevel warn

<span class="highlight-nb">LogFormat</span> <span class="highlight-s2">&#34;%h %l %u %t &#34;</span>%r<span class="highlight-s2">&#34; %&gt;s %b &#34;</span>%{Referer}i<span class="highlight-s2">&#34; &#34;</span>%{User-Agent}i<span class="highlight-s2">&#34;&#34;</span> combined
<span class="highlight-nb">LogFormat</span> <span class="highlight-s2">&#34;%h %l %u %t &#34;</span>%r<span class="highlight-s2">&#34; %&gt;s %b&#34;</span> common

  <span class="highlight-nb">LogFormat</span> <span class="highlight-s2">&#34;%h %l %u %t &#34;</span>%r<span class="highlight-s2">&#34; %&gt;s %b &#34;</span>%{Referer}i<span class="highlight-s2">&#34; &#34;</span>%{User-Agent}i<span class="highlight-s2">&#34; %I %O&#34;</span> combinedio




<span class="highlight-nb">ScriptAlias</span> <span class="highlight-sx">/cgi-bin/</span> <span class="highlight-s2">&#34;D:/MyServer/www/cgi-bin/&#34;</span>



<span class="highlight-nb">AllowOverride</span> <span class="highlight-k">None</span>
<span class="highlight-nb">Options</span> <span class="highlight-k">None</span>
<span class="highlight-nb">Order</span> allow,deny
<span class="highlight-nb">Allow</span> from <span class="highlight-k">all</span>

DefaultType text/plain

<span class="highlight-nb">TypesConfig</span> conf/mime.types
<span class="highlight-nb">AddType</span> application/x-compress .Z
<span class="highlight-nb">AddType</span> application/x-gzip .gz .tgz
<span class="highlight-nb">AddType</span> application/x-httpd-php .php
<span class="highlight-nb">AddHandler</span> 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
ProxyPassReverse /asp/ http://127.0.0.1/
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

0 apmserv
换一个
暂无评论
Ɣ回顶部