Pretty confused right now, while i feel i know a bit about vhosts this has confused me for no end of time and i thought i'll seek help after so long :p
I turn off 1 vhost and phpmyadmin will work locally, turn this vhost back on, phpmyadmin ends up at this webpage with my 404 for the site. the vhost in question:
<VirtualHost 127.0.0.1>
DocumentRoot /var/www/mayfieldafc/docroot
ServerName mayfieldafc.com
ServerAlias mayfieldafc.local
#CustomLog logs/mayfieldafc-transfer.log combined
#ErrorLog logs/mayfieldafc-error.log
php_value include_path "/usr/share/php:/var/www/mayfieldafc"
php_value error_reporting 2047
php_flag magic_quotes_gpc off
php_flag short_open_tag off
DirectoryIndex index.php index.html
<Directory /var/www/mayfieldafc/docroot>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
#RewriteLogLevel 9
#RewriteLog /var/log/mod_rewrite.log
# Dispatcher wiring
RewriteCond %{REQUEST_URI} !dispatch\.php$
RewriteCond /var/www/mayfieldafc/docroot%{REQUEST_FILENAME} !-f
RewriteRule ^(/.*)$ /dispatch.php?url=$1 [L,QSA]
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot /var/www/mayfieldafc/docroot
ServerName assets.mayfieldafc.com
ServerAlias assets-mayfieldafc.local
#CustomLog logs/mayfieldafc-transfer.log combined
#ErrorLog logs/mayfieldafc-error.log
DirectoryIndex index.php index.html
<Directory /var/www/mayfieldafc/docroot>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Direct开发者_如何转开发ory>
</VirtualHost>
If anybody knows anything about vhosts and phpmyadmin i'd love you forever :D
Using NameVirtualHost to host multiple sites on one IP address requires that you access the VirtualHost at its name and not its IP address. Hence, if phpmyadmin is hosted on assets-mayfieldafc.local, you must access it at assets-mayfieldafc.local/phpmyadmin. It works at localhost when only one virtualhost is configured as it only has one place to go for the localhost IP. Configure more virtualhosts on the same IP, and you will need to access them by ServerName/ServerAlias.
In the end nothing i could change in my vhost settings was working so i went with the obvious answer.
I just created a separate vhost with a
servername phpmyadmin.local
and just pointing the document to myphpadmin on my hard drive and all was good.
精彩评论