Closed majestique closed 5 years ago
In order to answer your question i'll need some details about your environment, like what web server are you running, where is it hosted, etc.
It's hosted on vultr.com running on CentOS 7.6. Apache isn't running right now.
If that VPS does not have any other web services you have 2 options:
Download and install Docker and then start pgweb with docker run -d -p 80:8081 sosedoff/pgweb
Download the precompiled binary from releases page (linux/amd64 version), unpack the archive and start pgweb process with pgweb --bind=0.0.0.0 --listen=80
. I haven't used CentOS for a long time so im not sure what kind of system manager it runs, but if it happen to be systemd you can use a service file from here: https://github.com/sosedoff/pgweb/tree/master/config
Ah so pgweb isn't able run with other web services such as apache on the same VPS?
It could, it just depends on how you configure apache virtual hosts file. You would still need to start the pgweb on some port (it runs on localhost:8081) and run it in the background. Then Apache would proxy traffic to it from your subdomain.
There's an old comment about how to run pgweb and nginx: https://github.com/sosedoff/pgweb/issues/84#issuecomment-96741961
Beautiful!
Got it working with this in apache:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@mysite.com
ServerName mysite.com
ServerAlias www.mysite.com
DocumentRoot /var/www/html/
</VirtualHost>
<VirtualHost *:80>
ServerAdmin me@mysite.com
ServerName pgweb.mysite.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/
</VirtualHost>
Thank you!
Please make sure to password protect your subdomain. You can either enable password in pgweb (pgweb --auth-user=admin --auth-pass=pa$$word
) or with apache's htpasswd.
I've created a subdomain for my site
pgweb.mysite.com
I'd like to attach pgweb to that subdomain, how does one do that?