以下是一个使用Apache代理服务器来支持HTTP和WS协议的示例配置:
sudo apt-get install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_wstunnel
sudo systemctl restart apache2
sudo nano /etc/apache2/sites-available/000-default.conf
ServerName example.com
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
ProxyPass /ws/ ws://localhost:8000/
ProxyPassReverse /ws/ ws://localhost:8000/
sudo systemctl restart apache2
现在,Apache代理服务器将会将所有HTTP和WS请求转发到本地的8000端口,你可以根据自己的需求修改端口号和域名。
请确保在端口8000上运行了支持HTTP和WS协议的应用程序,以便Apache代理服务器可以将请求正确地转发到该应用程序。