Forum

Vhost problem

Pippo
28 August 2007, 02:23
I have a domain (mydomain.com) and i have installed phpmyadmin on webserver to monitor mysql db.

When i digit mydomain.com i see the site home page and all goes well.
But when i digit mydomain.com/phpmyadmin, i don't see the phpmyadmin login , and hiawatha returns 404 error.

Here is the code:

# VIRTUAL HOSTS
# Use a VirtualHost section to declare the websites you want to host.
#
VirtualHost {
Hostname = mydomain.com
WebsiteRoot = /var/www/mydomain.com
StartFile = index.html
AccessLogfile = /var/www/mydomain.com/log/access.log
ErrorLogfile = /var/www/mydomain.com/log/error.log
ExecuteCGI = yes
FastCGI = PHP4
}

VirtualHost {
Hostname = mydomain.com/phpmyadmin
WebsiteRoot = /var/www/phpmyadmin
StartFile = index.php
ExecuteCGI = yes
FastCGI = PHP4
}

PHP works well.
Where is the error?

Thanks in advance.
Hugo Leisink
28 August 2007, 02:30
You can do two things:

1) run phpMyAdmin from a subdirectory of mydomain.com. In that case you have to put the phpmyadmin directory in /var/www/mydomain.com. You don't have to create another virtual host, because phpMyAdmin is inside the first virtual host.

2) run phpMyAdmin in its own virtual host, for example: http://phpmyadmin.mydomain.com/. When I look at your configuration file, I think this is what you want. You have to use
VirtualHost {
Hostname = phpmyadmin.mydomain.com
...
}

You must of course make sure that the hostname resolves to the right IP address.
Pippo
28 August 2007, 17:00
Thank you very much.

You are great.

Keep up the good work!!
This topic has been closed.