从另一台计算机访问 phppgadmin?

发布于 2024-09-11 05:26:01 字数 221 浏览 4 评论 0原文

我已经在 Ubuntu 服务器中安装了 phppgadmin,并且想从另一台计算机访问它。

它说访问被拒绝。

 http://<ip>/phppgadmin

当我输入: The port 5432 is opening in the Ubuntu server but just for local ip 时,

谢谢

I have installed phppgadmin in a Ubuntu server and want to access it from another computer.

It said access denied when i typed:

 http://<ip>/phppgadmin

The port 5432 is opened in the Ubuntu server but just for local ip.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

巨坚强 2024-09-18 05:26:01

默认情况下,/etc/apache2/conf.d/phppgadmin.conf 配置文件阻止除 localhost 之外的任何人访问 PhpPgAdmin。

添加一行,为您的 IP 创建新的允许规则,因此它看起来像这样:

<Location /phppgadmin>
  Order deny,allow
  Deny from all
  Allow from [Your client IP]
</Location>

顺便说一句,这种问题可能更适合 stackoverflow 的姊妹站点 serverfault.com

The /etc/apache2/conf.d/phppgadmin.conf configuration file by default keeps anyone but localhost from accessing PhpPgAdmin.

Add a line that makes a new allow rule for your IP, so it looks something like this:

<Location /phppgadmin>
  Order deny,allow
  Deny from all
  Allow from [Your client IP]
</Location>

By the way, this kind of question is probably more appropriate for stackoverflow's sister site serverfault.com

讽刺将军 2024-09-18 05:26:01

我知道这是一个老问题,但因为我在尝试从另一台计算机访问 phpPgAdmin 时偶然发现它试图修复“无法加载资源:服务器响应状态为 403(禁止)”错误,并且给出的答案没有'不适合我,我想分享我的解决方案。

乌班图:17.04; phpPgAdmin:5.1

解决方案:
在 /etc/apache2/conf-enabled/phppgadmin.conf 中注释掉 Require local 并重新启动 apache (sudo service apache2 reload)

<Directory /usr/share/phppgadmin>

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

# Only allow connections from localhost:
# Require local

<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>

/etc/apache2/conf-enabled/phppgadmin.conf

I know this is an old question but since i stumbled on it trying to fix the "Failed to load resource: the server responded with a status of 403 (Forbidden)" error while trying to access phpPgAdmin from another computer and the given answers didn't work for me, I wanted to share my solution.

Ubuntu: 17.04; phpPgAdmin: 5.1

Solution:
Comment out Require local in /etc/apache2/conf-enabled/phppgadmin.conf and restart apache (sudo service apache2 reload)

<Directory /usr/share/phppgadmin>

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

# Only allow connections from localhost:
# Require local

<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>

/etc/apache2/conf-enabled/phppgadmin.conf

诺曦 2024-09-18 05:26:01

这是一个 apache(或 Web 服务器)问题。您的 phppgadmin 目录有一个 .htaccess 文件,不允许除 localhost 之外的所有人。

您需要将其设置为“允许全部”或“允许”(在此处插入 IP)

This is an apache (or web server) issue. You're phppgadmin directory has a .htaccess file disallowing EVERYONE except localhost.

You need to either set it to Allow ALL or Allow (insert IP here)

伊面 2024-09-18 05:26:01

你正在运行阿帕奇吗?

您需要更改 httpd.conf 文件或 .htaccess 中的权限

http:// /httpd.apache.org/docs/2.0/misc/security_tips.html

Are you running Apache?

You need to change your permissions in the httpd.conf file or .htaccess

http://httpd.apache.org/docs/2.0/misc/security_tips.html

零度° 2024-09-18 05:26:01

我也想分享我的解决方案。

64 位 ARM 上的 Debian 10.1、Apache 2.4.38 和 phpPgAdmin 5.1。

以下配置将允许本地和 LAN 访问,但(出于安全原因)不允许 WAN 访问。

/etc/apache2/conf-enabled/phppgadmin.conf

<Directory /usr/share/phppgadmin>

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

# Only allow connections from localhost:
#Require local
Order deny,allow
Deny from all
Allow from ::1
Allow from 127.0.0.1
Allow from 192.168.0.0/16
Allow from 172.16.0.0/12
Allow from 10.0.0.0/8

<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>

I want to share my solution as well.

Debian 10.1 with Apache 2.4.38 and phpPgAdmin 5.1 on 64-Bit ARM.

The following config will allow local and LAN access, but (for security reasons) NO WAN access.

/etc/apache2/conf-enabled/phppgadmin.conf

<Directory /usr/share/phppgadmin>

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

# Only allow connections from localhost:
#Require local
Order deny,allow
Deny from all
Allow from ::1
Allow from 127.0.0.1
Allow from 192.168.0.0/16
Allow from 172.16.0.0/12
Allow from 10.0.0.0/8

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文