Announcement

Collapse
No announcement yet.

Apache/2.4.6 (CentOS) web socket

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apache/2.4.6 (CentOS) web socket

    Hey guys, I followed this link: https://docs.espocrm.com/administration/websocket/
    - Daemon is launched
    - apachectl -m returns (full text file attached):
    ..
    proxy_module (shared)
    ​proxy_http_module (shared)
    ​..

    I am stuck on this:
    part of the documentation
    >sudo a2enmod proxy
    >sudo a2enmod proxy_wstunnel

    I don't have such version of webserver
    [root@ip-172-31-17-62 ~]# httpd -v

    Server version: Apache/2.4.6 (CentOS)
    Server built: Mar 24 2022 14:57:57


    service espocrm-websocket status
    Active: active (running)


    Please advise
    Thanks
    Attached Files

  • #2
    Can I pay someone to help me with that?
    I would need help via any platform to guide me through the process

    Comment


    • #3
      Here is a full apache configuration for "https://espocrm.example.com" domain, file "/etc/apache2/sites-available/espocrm.conf":

      Code:
      <VirtualHost *:80>
          ServerName espocrm.example.com
          Redirect permanent / https://espocrm.example.com/
      </VirtualHost>
      
      <VirtualHost *:443>
          ServerName espocrm.example.com    
      
          DocumentRoot /var/www/html/
          DirectoryIndex index.php index.html
      
          LogLevel warn
          ErrorLog /var/log/apache2/error.log
      
          SetEnvIf Request_URI "\.(jpg|xml|png|gif|ico|js|css|swf|woff|eot|js?.|css?.|woff?.|eot?.)$" DontLog
          CustomLog /var/log/apache2/access.log combined Env=!DontLog
      
          # YOUR SSL CONFIGURATION
          # Example, https://ssl-config.mozilla.org/#server=apache&version=2.4.41&config=intermediate&openssl=1.1.1k&hsts=false&ocsp=false&guideline=5.6
          SSLEngine on
          SSLCertificateFile      /path/to/signed_cert_and_intermediate_certs_and_dhparams
          SSLCertificateKeyFile   /path/to/private_key
          SSLProtocol             all -SSLv3 -TLSv1 -TLSv1.1
          SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
          SSLHonorCipherOrder     off
          SSLSessionTickets       off    
      
          <Directory /var/www/html/>
              Options Indexes FollowSymLinks
              AllowOverride All
              Order allow,deny
              allow from all
          </Directory>
      
          <IfModule proxy_module>
              ProxyRequests Off
              <Location /wss>
                  ProxyPass ws://espocrm.example.com:8080
                  ProxyPassReverse ws://espocrm.example.com:8080
              </Location>
          </IfModule>
      
      </VirtualHost>
      ​
      Job Offers and Requests

      Comment


      • #4
        Originally posted by Russ View Post
        Hey guys, I followed this link: https://docs.espocrm.com/administration/websocket/
        - Daemon is launched
        - apachectl -m returns (full text file attached):
        ..
        proxy_module (shared)
        ​proxy_http_module (shared)
        ​..

        I am stuck on this:
        part of the documentation
        >sudo a2enmod proxy
        >sudo a2enmod proxy_wstunnel

        I don't have such version of webserver
        [root@ip-172-31-17-62 ~]# httpd -v

        Server version: Apache/2.4.6 (CentOS)
        Server built: Mar 24 2022 14:57:57


        service espocrm-websocket status
        Active: active (running)


        Please advise
        Thanks
        What user is present in your espocrm-websocket.service file?
        Is this user the owner of the espocrm directory and is this the user that runs the webserver (eg. www-data or apache)?

        Comment


        • #5
          Uploaded web config for the domain + espocrm-websocker.service
          + cli that shows the owner of the folder (*.com-le-ssl.conf looks just like .com.conf that is on the screenshot)
          Firewall: 443/8080 are opened for UDP incoming and outgoing requests

          Safari:
          WebSocket connection to 'wss://crm.batman.com/wss?authToken=c765ba83fc0d419e1aa0e6d16d447337&use rId=1' failed: There was a bad
          response from the server. (error 500)
          Firefox:
          Firefox can’t establish a connection to the server at wss://crm.batman.com/wss?authToken=9a2ba561cc58dd2f239f9d7d36f79663&use rId=6269bf7d5c7930d43. (error 500)

          Web server log (shows code 200):
          xxx.xxx.xxx.xxx - - [09/Feb/2023:16:29:14 -0800] "GET /wss?authToken=c765ba83fc0d419e1aa0e6d16d447337&userId =1 HTTP/1.1" 200 -


          Please help
          Attached Files
          Last edited by Russ; 02-10-2023, 01:05 AM.

          Comment


          • #6
            Also, I tried debug option..but where to try? Added to config, then to config-internal...then ran php web socket.php, nothing

            >webSocketDebugMode – bool – false – if you run a server (php websocket.php) manually from CLI, you will be able to see debug messages in the terminal;​

            Comment


            • #7
              Maybe a silly question but have you enabled websockets in config.php and installed the php zmq module?

              You can run php -m to see all installed modules.

              Also isn't web and websocket using TCP and not UDP?

              Comment


              • #8
                Originally posted by novastream View Post
                Maybe a silly question but have you enabled websockets in config.php and installed the php zmq module?

                You can run php -m to see all installed modules.

                Also isn't web and websocket using TCP and not UDP?
                Thanks for your reply, php-m, attached, all loaded, both TCP and UDP enabled on the firewall
                Attached Files

                Comment


                • #9
                  tarasm Hi! Can we get a paid support, please?

                  Comment


                  • #10
                    Hi Russ,

                    I'm not sure if this will absolutely help, but if you have time, try replacing ports 8080 with 8081 in the Apache configuration file in the next part (the part will look like this):

                    Code:
                    <IfModule proxy_module>
                      ProxyRequests Off
                      <Location /wss>
                        ProxyPass ws://espocrm.example.com:8081
                        ProxyPassReverse ws://espocrm.example.com:8081
                      </Location>
                    </IfModule>

                    Don't forget to restart Apache after that and see if the previous error reappears.

                    Comment


                    • #11
                      Russ,

                      Can you please tell me if there is any progress on Websocket setup?

                      Comment


                      • #12
                        Originally posted by lazovic View Post
                        Hi Russ,

                        I'm not sure if this will absolutely help, but if you have time, try replacing ports 8080 with 8081 in the Apache configuration file in the next part (the part will look like this):

                        Code:
                        <IfModule proxy_module>
                        ProxyRequests Off
                        <Location /wss>
                        ProxyPass ws://espocrm.example.com:8081
                        ProxyPassReverse ws://espocrm.example.com:8081
                        </Location>
                        </IfModule>

                        Don't forget to restart Apache after that and see if the previous error reappears.
                        lazovic thanks, I tried, but same issue.
                        I am trying on 2 machines, Amazon Linux 2 and Centos 7

                        I bet it has something to do with ZMQ which does not support php8.1, but I am not 100% sure, I asked tarasm to step in with a TeamViewer session to my servers via my computer and SSH.

                        Hope we will be able to dig into something.

                        Thanks!

                        Comment

                        Working...
                        X