4

Recently I need integrate a websocket server with apache2,and I find that apache2.4 has supported websocket with the module : mod_proxy_wstunnel. http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

I compiled them by myself, but encountered a problem :

httpd: Syntax error on line 122 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_proxy_wstunnel.so into server: /usr/local/apache2/modules/mod_proxy_wstunnel.so: undefined symbol: ap_proxy_release_connection

  • environment info:
  • OS:centos 6.8
  • php:php-7.0.10
  • apache:httpd-2.4.23

My steps are:

  1. Download source code.
    • php7 github.com/php/php-src/releases/tag/php-7.0.10
    • apache2.4 github.com/apache/httpd/releases/tag/2.4.23
  2. Copy to my workspace and tar,say /home
    • shell> tar -xjf php-7.0.10.tar.bz2
    • shell> tar -xjf httpd-2.4.23.tar.bz2
  3. Install gcc : yum install gcc
  4. Compile apache
    • down apr:apr-1.5.2.tar.gz apr-util-1.5.4.tar.gz
    • copy to /httpd-2.4.23/srclib
      tar -zvf apr-1.5.2.tar.gz tar -zvf apr-util-1.5.4.tar.gz
    • Modify the files name:
      apr-1.5.2 as apr
      apr-util-1.5.4 as apr-util
    • Install pcre
      yum install pcre-devel
    • ./configure --enable-so --enable-http --enable-proxy --enable-proxy-http --with-included-apr --enable-proxy-wstunnel
    • make && make install
    • set apache server ip:
      shell> vi /usr/local/apache2/conf/httpd.conf ServerName 127.0.0.1
  5. Compile php
    • libxml2:
      yum install libxml2-devel
    • mkdir /usr/local/php7
    • ./configure --prefix=/usr/local/php7 --with-mysqli --enable-mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-apxs2=/usr/local/apache2/bin/apxs
    • make && make install
    • cp -v ./php.ini-production /usr/local/php7/lib/php.ini
    • configure httpd.conf
      shell> vi /usr/local/apache2/conf/httpd.conf
      <FilesMatch \.php$> SetHandler application/x-httpd-php </FilesMatch>
  6. enalbe mod_proxy_wstunnel shell> vi /usr/local/apache2/conf/httpd.conf
    LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so

Above is my steps. Then I try to start my apache2 :

/usr/local/apache2/bin/apachectl start

Got the following errors:

httpd: Syntax error on line 122 of /usr/local/apache2/conf/httpd.conf: Cannot load modules/mod_proxy_wstunnel.so into server: /usr/local/apache2/modules/mod_proxy_wstunnel.so: undefined symbol: ap_proxy_release_connection

I have google it , but can't find some helpful info.

1 Answer 1

5

You need to load mod_proxy as well as mod_proxy_wstunnel. If you load an underlying proxy module (http/fcgi/ajp/wstunnel) without mod_proxy you will get this error.

So check your configuration and make sure you have a LoadModule directive for mod_proxy as well as mod_proxy_wstunnel.

You can also use the output of apachectl -M to check the modules Apache is loading.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks,my friend.That's my mistake.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.