系统:ubuntu 12.04LTS
我使用Apache作为Tomcat7网络服务器的代理服务器。
对于Apache as Proxy,我激活了模块:
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
答案 0 :(得分:1)
您可能会看到该错误,因为您的Apache版本不支持HTTP 1.1。要配置Apache以支持websockets,请尝试以下操作:
https://serverfault.com/questions/290121/configuring-apache2-to-proxy-websocket
编辑:删除剩余的帖子,因为它不在主题