DevHeads.net

Cockpit within httpd

Folks

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:

<a href="http://xxx.example.com/cockpit" title="http://xxx.example.com/cockpit">http://xxx.example.com/cockpit</a>
(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 <a href="mailto: ... at example dot com"> ... at example dot com</a>
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://127.0.0.1:9090/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /cockpit/(.*) ws://127.0.0.1:9090/$1 [P,L]
ProxyPass /cockpit/ <a href="http://127.0.0.1:9090/" title="http://127.0.0.1:9090/">http://127.0.0.1:9090/</a>
ProxyPassReverse /cockpit/ <a href="http://127.0.0.1:9090/" title="http://127.0.0.1:9090/">http://127.0.0.1:9090/</a>
</VirtualHost>

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
David

Comments

Re: Cockpit within httpd

By m.roth at 04/12/2019 - 13:34

david wrote:
Second, I know nothing about it, and I don't know what it's written in (is
it tomcat?) - but at any rate, I'd assume there is a configuration file
for the application itself that sets that.

mark