apache-httpd.conf

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/web/picool/public_html
ServerName picool.net
ServerAlias www.picool.net
DirectoryIndex index.html index.php index.htm
ErrorDocument 400 /errpage/400.html
php_admin_value open_basedir /www/web/picool:/tmp
    <IfModule mpm_itk_module>
      AssignUserId chenwen22 chenwen22
    </IfModule>
</VirtualHost>
<Directory /www/web/picool/public_html>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


<VirtualHost *:80>
DocumentRoot /www/web/fanqianwu.com/public_html
ServerName fanqianwu.com
ServerAlias www.fanqianwu.com拢卢tb.fanqianwu.com *.fanqianwu.com
ErrorDocument 400 /errpage/400.html
ErrorDocument 401 /errpage/401.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
ErrorDocument 405 /errpage/405.html
ErrorDocument 500 /errpage/500.html
CustomLog "logs/fanqianwu.com_access_log" common
ErrorLog "logs/fanqianwu.com_error_log"
php_admin_value open_basedir /www/web/fanqianwu.com:/tmp
    <IfModule mpm_itk_module>
      AssignUserId 7405705 7405705
    </IfModule>
</VirtualHost>
<Directory /www/web/fanqianwu.com/public_html>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

</Directory>


禁止apache空主机头


<VirtualHost *:80>

        DirectoryIndex index.html index.php
        DocumentRoot "/usr/local/apache/webroot"         #这个webroot 的文件是个空文件。
        ServerName localhost                                         #  把localhost 绑定到一个空的目录中  这样就别人解析的时候。他就会是个没有找到
                                                                                   #   文件的错误页面
        ErrorDocument 404 /error.html                           #   你要是想让他看到一个可爱的页面。你可以把这个页面设计漂亮上一点。恶搞下

                                                                                   #   嘿嘿。就是的这个要看你心情了
  </VirtualHost>


例子:

 

NameVirtualHost *
     <VirtualHost *:80>
    ServerAdmin yourmail@mail.com
    DocumentRoot /error
    ServerName abc.com
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin yourmail@mail.com
    DocumentRoot "你的站点路径"
    ServerName yourWebsite.com
    ServerAlias *.yourWebsite.com
</VirtualHost>


Apache下禁止特定目录执行PHP

<Directory "<path_to_writeable_dir>">
<Files ~ ".php">
Order allow,deny
Deny from all
</Files>
</Directory>

版权所有:《太阳花工作室》 => 《apache-httpd.conf
本文地址:http://bg.artuion.com/win_lin_mac/61.html
除非注明,文章均为 《太阳花工作室》 原创,欢迎转载!转载请注明本文地址,谢谢。