在debian 7上的Apache2.22上配置HTTP方法

时间:2014-04-02 05:38:49

标签: apache http methods

我有谷歌并阅读了一些讨论线程,但不知怎的,我仍然不能完全得到http方法的配置工作。以下是来自/ etc / apache2 / sites-available / default的配置。我也尝试编辑我的userdir.conf,但不管我做什么,当我查询我的localhost时:80,我总是回来4允许方法GET,HEAD,POST,OPTIONS。有人可以指出我配置错误吗?我想在这里允许HTTP PUT。


<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
                Order Allow,Deny
                <Limit GET POST PUT DELETE>
                allow from all
                </Limit>
        </Directory>

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                <Limit GET POST PUT DELETE OPTIONS>
                allow from all
                </Limit>
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

        UserDir public_html         UserDir禁用root

    <Directory /home/*/public_html>
            AllowOverride FileInfo AuthConfig Limit Indexes
            Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
            <Limit GET POST OPTIONS DELETE>
                    Order allow,deny
                    Allow from all
            </Limit>
            <LimitExcept GET POST OPTIONS DELETE>
                    Order deny,allow
                    Deny from all
            </LimitExcept>
    </Directory>


root@debian-pre2:/var/log/apache2# dpkg -l |grep apache
ii  apache2                            2.2.22-13                     amd64        Apache HTTP Server metapackage
ii  apache2-doc                        2.2.22-13                     all          Apache HTTP Server documentation
ii  apache2-mpm-prefork                2.2.22-13                     amd64        Apache HTTP Server - traditional non-threaded model
ii  apache2-utils                      2.2.22-13                     amd64        utility programs for webservers
ii  apache2.2-bin                      2.2.22-13                     amd64        Apache HTTP Server common binary files
ii  apache2.2-common                   2.2.22-13                     amd64        Apache HTTP Server common files
ii  libapache2-mod-php5                5.4.4-14+deb7u5               amd64        server-side, HTML-embedded scripting language (Apache 2 module)

0 个答案:

没有答案