httpd 2.4是否支持PUT和GET?

时间:2019-06-18 13:43:26

标签: apache centos httpd.conf

我已经在CentOS 7机器上安装了httpd-2.4.6-89.el7.centos.x86_64并配置了网络服务器,但是我无法使http'PUT / POST'或'GET'正常工作

下面提到的是我的配置

[root@centos-007 httpd]# cat /etc/httpd/conf.d/centos-007.conf
<VirtualHost *:80>
    ServerName centos-007.gg.com
    DocumentRoot "/abc/xyz"
        DirectoryIndex index.html
        <Location />
        Require all granted
        Options +Indexes
        </Location>
    Alias /avaya  "/abc/xyz"
    <Directory "/abc/xyz">
    Require all granted
    Dav On
    <LimitExcept GET POST OPTIONS>
    </LimitExcept>
    Options FollowSymLinks Indexes MultiViews
    </Directory>
</VirtualHost>
<VirtualHost *:80>
    ServerName centos-007
    DocumentRoot /var/www/centos-007/pub_html
    <Directory /var/www/centos-007/pub_html>
    Options Indexes FollowSymLinks MultiViews
    Require all granted
    </Directory>
</VirtualHost>

奇怪的是,当我运行curl命令上传文件时,我得到以下信息,但是网页未显示上传的文件

* About to connect() to centos-007.gg.com port 80 (#0)
*   Trying 10.170.110.100...
* Connected to centos-007.gg.com (10.170.110.100) port 80 (#0)
> PUT /avaya HTTP/1.1
> User-Agent: curl/7.29.0
> Host: centos-007.gg.com
> Accept: */*
> Content-Length: 824
> Expect: 100-continue
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 18 Jun 2019 13:25:54 GMT
< Server: Apache/2.4.6 (CentOS)
< Location: http://centos-007.wsgc.com/xyx
< Content-Length: 245
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://centos-007.gg.com/xyx">here</a>.</p>
</body></html>
* Closing connection 0

1 个答案:

答案 0 :(得分:0)

我可以使用底层的

来完成这项工作
DavLockDB /var/www/html/DavLock
<VirtualHost *:80>
    ServerName centos-007.gg.com 
    DocumentRoot /abc/xyz
<Location />
    Require all granted
    Options +Indexes
</Location>
    ErrorLog /var/log/httpd/error.log
    CustomLog /var/log/httpd/access.log combined
    Alias /xyz  /abc/xyz
    <Directory  /abc/xyz>
        Require all granted
        DAV On
        AuthType Basic
        Require valid-user
    </Directory>
</VirtualHost>