httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Underwood <>
Subject [users@httpd] limiting mySQL users with virtual hosts
Date Thu, 07 Oct 2004 20:49:46 GMT
I've been developing a PHP/mySQL based system that different 
(name-based) virtual hosts will be using.  Specifically, each host gets 
a symlink in their web directory to this system.  As the system is 
currently written, there is one mySQL user that all virtual hosts will 
be using to connect to their database (each host gets it's own database 
for the system to use).  It wouldn't really be an issue to have 
separate mySQL users for each host, though.

The problem is this: Each host needs to have access to the PHP include 
files in order to include them.  The include files have the username 
and password for the mySQL user.  So, while I know it's possible to 
limit connections of a mysql user to certain IPs/hostnames, I think 
what would be required is to limit connections to specific files (Just 
the include files) since all connections to the database from the 
different users of the different virtual hosts come from localhost.

What I fear is that the only solution would be using ip-based virtual 
hosts to limit where the mySQL user can connect from, but if anybody 
here has another solution, I would greatly appreciate it.

Here's information about the environment in case it's useful:
apache: 2.0.46
mySQL: 4.0.20
more /proc/version:
Linux version 2.4.21-4.0.1.ELsmp ( 
(gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)) #1 SMP Thu Oct 23 
01:27:36 EDT 2003


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message