0

我已经为此查看了很多答案,但似乎都已经过时了。我正在使用 Ubuntu 14.04 和 Apache 2.4.7。我的 /etc/apache2/conf.d/phppgadmin 文件如下所示:

Alias /phppgadmin /usr/share/phppgadmin

<Directory /usr/share/phppgadmin>

DirectoryIndex index.php
AllowOverride all

order deny,allow
#deny from all
#allow from 127.0.0.0/255.0.0.0 ::1/128
Require all granted

<IfModule mod_php5.c>
  php_flag magic_quotes_gpc Off
  php_flag track_vars On
  #php_value include_path .
</IfModule>
<IfModule !mod_php5.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>

在 /etc/apache2/sites-enabled 中还有一个文件 000-default,看起来像:

<Directory "/usr/share/phpPgAdmin">
        AuthUserFile /etc/phpPgAdmin/.htpasswd
        AuthName "Restricted Area"
        AuthType Basic
        require valid-user
</Directory>

我已经适当地修改了 /etc/phppgadmin/.htpasswd 。

尽管如此,当我尝试远程登录时,我得到一个 403: Forbidden 错误。

有任何想法吗?此外,我所在的网络类型是否会导致此错误?(这是一个校园网络)。

4

1 回答 1

0

尝试是

sudo cp /etc/apache2/conf.d/phppgadmin /etc/apache2/conf-enabled/phppgadmin.conf

重启 httpd2 (Apache)

sudo /etc/init.d/apache2 restart

或者

sudo service apache2 start

对于 Ubuntu 14.04

于 2015-05-13T10:14:34.320 回答