Apache を使用した localhost/adminer アクセスの禁止 (403)

Apache を使用した localhost/adminer アクセスの禁止 (403)

私は管理者をArchlinuxで実行しようとしましたが、この問題に遭遇しました。

管理者用のApacheを設定し、FirefoxまたはOperaを使用してlocalhost / adminerを呼び出すと、コード403(禁止)が表示されます。 Apacheなしで管理者を起動するとき:

php -S localhost:8000 -t /usr/share/webapps/adminer/

Firefox を使用して localhost/adminer を呼び出すと正常に動作します。 index.phpファイルパスのすべてのフォルダには読み取りと実行権限があります。読み取り権限を持つ "index.php"ファイルは1つだけです。私のServerRoot "/srv/http/"には同じアカウントがありますが、その中にファイルはありません。

Apacheの設定ファイルに何か問題があるようです。

私のApache設定ファイルの関連部分は次のとおりです。

/etc/httpd/conf/httpd.conf:

ServerRoot "/etc/httpd"
Listen 80
...
User http
Group http
ServerAdmin [email protected]
ServerName localhost:80
<Directory />
    AllowOverride none
    Require all denied
</Directory>
DocumentRoot "/srv/http"
<Directory "/srv/http">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
...
Include conf/extra/httpd-adminer.conf
...

/etc/httpd/conf/extra/httpd-adminer.conf:

# vim: ft=apache

Alias /adminer "/usr/share/webapps/adminer"
<Directory "/usr/share/webapps/adminer">
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>

「http-adminer.conf」でエイリアス行なしでシンボリックリンクを試しましたが、成功しませんでした。はい、Apacheサーバーを再起動したことを確認しました。 (そしてサーバーが稼働しています。そうしないと、コードは403ではなく404になります。)

私は何が間違っていましたか?

ベストアンサー1

このWebサーバーが管理者にのみサービスを提供している場合は、Apacheがページを提供するルートディレクトリを次のように変更します。

DocumentRoot "/usr/share/webapps/adminer"

その後、Apache サービスを再起動します。

おすすめ記事