View previous topic :: View next topic |
Author |
Message |
CarlUman Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Diablo/Diablo_2_-_Necromancer.gif)
Joined: 07 Jul 2004 Posts: 158 Location: SE Iowa
|
Posted: Sat Feb 05, 2005 12:46 am Post subject: Multi hosts (vhosts) and Doc |
|
|
Have a few security questions on apache and php with multiple domains.
I currently have in apache2.conf and commonapache2.conf
My vhosts.conf is similar to this
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/example1.com/htdocs
ServerName www.example1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/example2.org/htdocs
ServerName www.example2.org
</VirtualHost>
|
What did I open myself up to by using DocumentRoot /www in the first two config files? Or did the full path for the virtual hosts close up any holes?
Next question on PHP is how can I have multiple open_basedir = so I can get one for each virual host/domain? The php.ini file talks about a per-directory or per-virualhost web server configuration file. Does this mean that I can setup some config file for each virualhost? If so can I get any details?
Thanks in advance for help
Carl
I still have SSL, PostgreSQL, Courier, and ftp to go ![Shocked 8O](images/smiles/icon_eek.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
adaptr Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/17218567054377b9b6104ea.jpg)
Joined: 06 Oct 2002 Posts: 6730 Location: Rotterdam, Netherlands
|
Posted: Sat Feb 05, 2005 2:05 am Post subject: |
|
|
It means, simply put, that any request that ends up at your IP for which there is no virtual host will get directed to the base documentroot - probably not what you want.
You can circumvent this in two ways:
1. set your base document root to an unused directory somewhere, say /www/baseroot, possibly only providing a simple page that tells people there is nohing there... or
2. you can set up a _default_ virtualhost; this will receive all requests for nonexistent virtualhosts. See the apache docs at httpd.apache.org for how.
This does include somebody requesting your IP address, so it is rather important that you set this up properly.
As you probably already surmised, the way you have this set up currently means that anybody requesting your IP directly has access to all virtualhosts.
As for php virtualhosts with different php.ini files - you can of course reset the php config for every virtualhost; almost any global directive is valid inside a virtualhost block.
I'm personally not that sure using php's documentroot is of much use; it tends to be sufficiently locked down when you use apache's directory permissions.
But if you want maximum security - go for it. _________________ >>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|