在 Windows Server 2016 VM 上使用 Apache 2.4、PHP7 和 Phpmyadmin:无法正确配置 phpmyadmin 以便从站点作为路径访问。站点是一个 Symfony 应用程序,在site/phpmyadmin
请求时会抛出 404。
mod_alias
已加载
httpd-vhost.conf
<VirtualHost *:80>
ServerName admin.projectmana.org
ServerAlias projectmana.org
DocumentRoot "c:\apache24\htdocs\projectmana\htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName admin.projectmana.org
Alias /phpmyadmin "c:/Apache24/htdocs/phpmyadmin"
<Directory "c:/Apache24/htdocs/phpmyadmin">
</Directory>
</VirtualHost>
编辑
httpd -S 的结果(之后Include conf/extra/httpd-vhosts.conf
)
VirtualHost configuration:
*:80 is a NameVirtualHost
default server admin.projectmana.org (C:/Apache24/conf/extra/httpd-vhosts.conf:24)
port 80 namevhost admin.projectmana.org (C:/Apache24/conf/extra/httpd-vhosts.conf:24)
alias projectmana.org
port 80 namevhost admin.projectmana.org (C:/Apache24/conf/extra/httpd-vhosts.conf:30)
ServerRoot: "C:/Apache24"
Main DocumentRoot: "C:/Apache24/htdocs/projectMana/htdocs"
Main ErrorLog: "C:/Apache24/logs/error.log"
Mutex default: dir="C:/Apache24/logs/" mechanism=default
Mutex rewrite-map: using_defaults
PidFile: "C:/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
答案1
借助这个Ubuntu 论坛答案,我做了以下唯一的记录httpd-vhosts.conf
:
<VirtualHost *:80>
ServerName admin.projectmana.org
ServerAlias projectmana.org
DocumentRoot "c:\apache24\htdocs\projectMana\htdocs"
Alias /phpmyadmin "c:/Apache24/htdocs/phpmyadmin"
<Directory "c:/Apache24/htdocs/phpmyadmin">
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.php
AllowOverride all
Require all granted
</Directory>
</VirtualHost>