following this tutorial, I've successfully installed pgAdmin4 in server mode. However, pgAdmin4 is accessible by my IP address on the default port. I would like access using another port like the 8081. I've tried by modifying the content of /etc/apache2/sites-available/pgadmin4.conf but without success. Thanks in advance
<VirtualHost *:8081>
ServerName my_ip
WSGIDaemonProcess pgadmin processes=1 threads=25 python-home=/home/user/environments/my_env
WSGIScriptAlias / /home/user/environments/my_env/lib/python3.6/site-packages/pgadmin4/pgAdmin4.wsgi
<Directory "/home/user/environments/my_env/lib/python3.6/site-packages/pgadmin4/">
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
I've found the solution myself.
The steps are:
Listen 8081
in the ports.conf file.
sudo nano /etc/apache2/ports.conf
sudo nano /etc/apache2/sites-available/pgadmin4.conf
Type
<VirtualHost my_ip:8081>
ServerName my_ip:8081
WSGIDaemonProcess pgadmin processes=1 threads=25 python-home=/home/user/environments/my_env
WSGIScriptAlias / /home/user/environments/my_env/lib/python3.6/site-packages/pgadmin4/pgAdmin4.wsgi
<Directory "/home/user/environments/my_env/lib/python3.6/site-packages/pgadmin4/">
WSGIProcessGroup pgadmin
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>