You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Underwood <br...@semi-sentient.com> on 2004/10/07 22:49:46 UTC
[users@httpd] limiting mySQL users with virtual hosts
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 (bhcompile@porky.devel.redhat.com)
(gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)) #1 SMP Thu Oct 23
01:27:36 EDT 2003
Brian
;p
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org