在 linux vps 中使用 cpanel 在 apache 服务器中找不到 a2enmod 命令

roh*_*dev 7 apache vps cpanel

转到 /etc/httpd/conf/httpd.conf 甚至更改后

Allow override none -> Allow override All , and then restarting the server using 

service httpd restart
Run Code Online (Sandbox Code Playgroud)

然后我输入命令

 a2enmod proxy
Run Code Online (Sandbox Code Playgroud)

然后我收到一个错误:

bash- a2enmod command not found. . 
Run Code Online (Sandbox Code Playgroud)

你能帮我么?当我使用 web-sockets 时,我在开发人员工具控制台中收到一个错误,因此我需要启用 web-sockets 代理。

Alo*_*ble 6

我遇到了同样的问题,这个答案解决了我的问题:

Apache2 命令(例如 a2enmod 和 a2ensite)不起作用,在 Ubuntu 中找不到它的显示命令

尝试:

sudo apt-get update
sudo apt-get install apache2 libapache2-mod-wsgi
Run Code Online (Sandbox Code Playgroud)

然后,

sudo a2enmod wsgi
Run Code Online (Sandbox Code Playgroud)

然后,您可能还想尝试sudo a2enmod而不仅仅是a2enmod


小智 6

在 Debian 上a2enmod位于 PATH 中/usr/sbin/a2enmod,有时/usr/sbin不在PATH中。