系统:ubuntu 12.04LTS
我使用 Apache 作为 Tomcat7 网络服务器的代理服务器。
对于 Apache 作为代理,我激活了模块:
sudo a2enmod proxy
sudo a2enmod proxy_http
然后我将 /etc/apache2/sites-available/default 编辑为:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ProxyRequests Off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
<Location "/">
Order allow,deny
Allow from all
</Location>
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
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
我正在使用 Websockets,所以我需要启用它们。我怎样才能在 Apache 代理服务器中做到这一点?
Chrome 向我显示此错误:
WebSocket connection to 'ws://www.myapp.com/socket/848df2e62fcf93e1b3?X-Atmosphere-tracking-i…Date=0&Content-Type=application/json;%20charset=UTF-8&X-atmo-protocol=true'
failed: Unexpected response code: 200