Apache: 无效命令 ProxyRequest

我给 Jenkins 安装了一个新的 Vhost:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName ci.company.com
ServerAlias ci
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost on
ProxyPass / http://localhost:8080/
</VirtualHost>

... 它使用代理服务器,当我重新启动 apache 时,我得到这样的错误:

Invalid command 'ProxyRequests', perhaps misspelled or defined by a module not included in the server configuration
105542 次浏览

You should enable proxy. Run a command:

 sudo a2enmod proxy
sudo /etc/init.d/apache2 restart

proxy module must be disable. Enable it using below command

a2enmod proxy

If you don't have access to root, you can use

sudo a2enmod proxy

After that restart apache server using

service apache2 reload
 sudo a2enmod proxy
sudo a2enmod proxy_http
systemctl restart apache2

If you don't enable proxy_http you get this error in the apache error log file for the site:

AH01144: No protocol handler was valid for the URL / (scheme 'http'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

This error in general can be found with this message after a new installation with an old vhost:

Invalid command 'ProxyPreserveHost', perhaps misspelled or defined by a module not included in the server configuration