0

Currently, I have successfully installed apache2.4.18 which contains the mod_proxy_wstunnel and installed tomcat7 on another machine. And I have deployed atmosphere sample app on tomcat7. Then I can visit http://tomcatserver.com:8080/ademo/index.html

I captured the browser below. enter image description here

This index.html was retrieved from https://github.com/Atmosphere/atmosphere-samples/blob/master/samples/chat/src/main/webapp/index.html.

Then I tried to set the httpd.conf within apache server like below. I did not use any VirtualHost related configuration. I just append the below two lines to the end of this httpd.conf file.

ProxyPass     /ademo/     http://tomcatserver.com:8080/ademo/
ProxyPassReverse  /ademo/     http://tomcatserver.com:8080/ademo/

Then I restart httpd, and visit below url. http://apachehttpdserver.com/ademo/index.html

I captured the browser snapshot below, I can find that the websocket was not supported. enter image description here

So I was wondering how can I modify this httpd.conf to support websocket? I have uncommentted the LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

Actually, I plan to set up more than one back-end servers ,so I use below configurations that referred to http://blog.arungupta.me/load-balance-websockets-apache-httpd-techtip48/. But I still get the error [Fri Jan 08 02:55:50.840362 2016] [proxy:warn] [pid 18446:tid 46971298007360] [client 10.248.66.148:52033] AH01144: No protocol handler was valid for the URL /ademo/socket.html. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule. One thing that I make sure is i have set the necessary modules in httpd.conf.

 <Proxy balancer://mycluster>
    # Define back-end servers:

    # Server 1
     BalancerMember ws://10.214.49.65:8080

    # Server 2
    BalancerMember ws://10.214.49.83:8080/
</Proxy>

ProxyPass /ademo balancer://mycluster/ademo
ProxyPassReverse /ademo balancer://mycluster/ademo
liam xu
  • 2,892
  • 10
  • 42
  • 65

1 Answers1

0

I want to answer my own question.

The httpd I used was compiled from the source code 2.4.18 that support websocket. And I found that the compile process was normal without any exception. The redhat I am using is Red Hat Enterprise Linux Server release 5.9 (Tikanga).

The reason I guess that is due to the error message 'No protocol handler was valid'. Than I tried to switch to redhat 7.1 with yum get installed. I executed 'yum install httpd' that will install httpd 2.4.5 automatically. And I found that the websocket connection from httpd and tomcat was OK.

But currently I want to resolve the issue on redhat 5.x since in the future we will use low version of redhat. Generally, since the compile process is Ok, the binary should OK as well?

liam xu
  • 2,892
  • 10
  • 42
  • 65