[CentOS] Cockpit within httpd

Fri Apr 12 17:14:22 UTC 2019
david <david at daku.org>


I'd love to use Cockpit, but I cannot open port 9090 for the access 
in all cases.  I'd like to access it via my usual http port (such as 
80) where I'm limited to a single HTTP port.  I understand the 
security implications, and can deal with them later.

My attempt was to allow the following URL to access the cockpit functionality:

(not the real URL)
where 'xxx.example.com' is one of the virtual web sites on my server.

I tried as follows for the definition of the virtual server:

<VirtualHost *:80>
  ServerName              xxx.example.com
  ServerAdmin             admin_xxx at example.com
  DocumentRoot            /home/xxx/public_html
  Options                 +ExecCGI +Includes +FollowSymLinks
  LogFormat               Combined
  TransferLog             /var/log/httpd/u_xxx_access_log
  ErrorLog                /var/log/httpd/u_xxx_error_log
  RewriteEngine           on

  ProxyPreserveHost       On
  RewriteCond             %{HTTP:Upgrade} =websocket [NC]
  RewriteRule             /cockpit/(.*)   ws://$1 [P,L]
  RewriteCond             %{HTTP:Upgrade} !=websocket [NC]
  RewriteRule             /cockpit/(.*)   ws://$1 [P,L]
  ProxyPass               /cockpit/
  ProxyPassReverse        /cockpit/

All I get is a blank page displayed when I try to access the 
url.  Testing Cockpit by accessing port 9090 works fine.

Am I missing something?

Thanks in advance