1

I've been trying to install phppgadmin on a virtual server. The server runs Ubuntu 16.04. I've followed this tutorial exactly as instructed, but I get a 404 error.

After a lot of googling I noticed there was no phppgadmin directory in my /var/www/html/ directory which I thought was odd. I used this command

ln -s /usr/share/phppgadmin /var/www/html/phppgadmin 

to link directories.

I now get a 403 Forbidden error when I go to http://server_IP/phppgadmin. So while I haven't solved my problem I think I'm getting closer, but I still can't figure out why I don't have access. I've gone over the tutorial a million times and made sure I didn't miss anything.

Per Spas's request here are the contents of phppgadmin.conf: (I tried the command you suggested and I'm still getting 403)

Alias /phppgadmin /usr/share/phppgadmin

<Directory /usr/share/phppgadmin>

<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
AllowOverride None

# Only allow connections from localhost:
allow from all


<IfModule mod_php.c>
  php_flag magic_quotes_gpc Off
  php_flag track_vars On
  #php_value include_path .
</IfModule>
<IfModule !mod_php.c>
 <IfModule mod_actions.c>
    <IfModule mod_cgi.c>
      AddType application/x-httpd-php .php
      Action application/x-httpd-php /cgi-bin/php
    </IfModule>
    <IfModule mod_cgid.c>
      AddType application/x-httpd-php .php
      Action application/x-httpd-php /cgi-bin/php
    </IfModule>
  </IfModule>
 </IfModule>
</Directory>
user111707
  • 21
  • 1
  • 6
  • Just in case, try to execute: `sudo a2enconf phppgadmin && sudo systemctl restart apache2.service`. If this doesn't work, please [edit](https://askubuntu.com/posts/912597/edit) your question and paste the content of `/etc/apache2/conf-available/phppgadmin.conf`. – pa4080 May 06 '17 at 22:24
  • 1. You don't need `ln -s /usr/share/phppgadmin /var/www/html/phppgadmin`, because there is directive `Alias /phppgadmin /usr/share/phppgadmin` which does almost the same, but through Apache's configuration. 2. In the end of `phppgadmin.conf` two close tags are missing: `` and ``. The other thins are okay. 3. Can you access `http://server_IP`? 4. I just installed `phppgadmin` and it works with this configuration. 5. I suppose you don't have an active Virtual Host or there have something wrong. – pa4080 May 06 '17 at 23:34
  • 1. Did not know that thank you 2. The close tags were there, I just didn't indent in my post 3. Yes, I can it's the Apache2 Ubuntu Default Page 4. Good to know it works 5. I'm not sure what an active virtual host is. I recently got the server so probably not. 6. Maybe I should just remove everything and try it all over again? – user111707 May 07 '17 at 02:10
  • Imagine the [VirtualHosts](https://httpd.apache.org/docs/2.4/vhosts/examples.html) (VH) as separate websites within one web server. For example `www.domain-name.com`, `my.domain-name.org`, etc. Usually their configurations are placed in separate files, located in `/etc/apache/sites-available/`. When one VH is enabled (via the command `a2ensite`) there is created symbolic link (`ln -s`) from its `.conf` file located in `/etc/apache/sites-available/` to the directory `/etc/apache/sites-enabled/`. There is one default VH and its configuration file is `000-default.conf`. – pa4080 May 07 '17 at 08:45
  • In the matter of facts when I installed `phppgadmin` I also wasn't able to access my web server. So I disabled the default VH - `sudo a2dissite 000-default.conf && sudo systemctl restart apache2.service`, then I enabled it - `sudo a2ensite 000-default.conf && sudo systemctl restart apache2.service` and I gained access. Maybe it's some kind of bug caused by `phppgadmin`. – pa4080 May 07 '17 at 08:45
  • 1
    I fixed the problem, but in a round-about way. I ended up rebooting my server by wiping it clean and doing a fresh install of phppgadmin. I was able to access it just fine after installing it via the tutorial instructions. – user111707 May 07 '17 at 23:15

0 Answers0