Discussion:
apache virtual host setup
joe angth
2003-11-26 16:52:25 UTC
Permalink
What's everyone's opinion the settings for virtual
hosting with apache?

I have two ideas on how to set this up.

Idea one:
creating a directory in /var/www/ called virthosts
and inside that having htdocs, cgi-bin, logs, and
conf,
thereby "containerizing" each virtual host server.
Each virtual host would then have each of the items
in /var/www, and would be completely seperate from the
other virtual hosts.

Idea two:
just putting everything in htdocs. By this I mean in
htdocs you would have site1, site2, etc.

Both ideas are just as easy to implement, but what are
the benefits/drawbacks of using either? Or if anyone
has any better ideas on how to set up virtual hosts.

-Joe

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
Kenny Gryp
2003-11-26 17:25:58 UTC
Permalink
Post by joe angth
What's everyone's opinion the settings for virtual
hosting with apache?
I have two ideas on how to set this up.
creating a directory in /var/www/ called virthosts
and inside that having htdocs, cgi-bin, logs, and
conf,
thereby "containerizing" each virtual host server.
Each virtual host would then have each of the items
in /var/www, and would be completely seperate from the
other virtual hosts.
just putting everything in htdocs. By this I mean in
htdocs you would have site1, site2, etc.
Both ideas are just as easy to implement, but what are
the benefits/drawbacks of using either? Or if anyone
has any better ideas on how to set up virtual hosts.
I'm using something similar like your first idea. But not every item
in /var/www is included in each site.

For each site i've got a directory containing the logs, stats, web and
tmp dirs. (I don't allow cgi scripts)
That way you have better control over each website:
- you can easily parse logs for each user, so you can easily see what
they did.
- logs can be provided to the customers
- using php in safe mode and setting the open_basedir can limit the
user in that directory. This also counts for the apache config
- files/directories can be put in the root of that directory and
loaded by php. That way, those files can't be accessed directly into
the browser (it isn't in the apache root of that virtual domain)
...

All the virtual hosts work in one apache configuration. Most people
want to do namebased virtual hosting (see the apache manual for more
information) so only one configuration file, and one user is used
(www). So you've got to make sure there is no way users can access
other files that don't belong to them.

Kenny Gryp
--
http://gryp.dakin.be - ***@dakin.be
Dave Taira
2003-11-26 19:51:40 UTC
Permalink
Post by joe angth
creating a directory in /var/www/ called virthosts
and inside that having htdocs, cgi-bin, logs, and
conf,
thereby "containerizing" each virtual host server.
Each virtual host would then have each of the items
in /var/www, and would be completely seperate from the
other virtual hosts.
just putting everything in htdocs. By this I mean in
htdocs you would have site1, site2, etc.
I'd do something in between.

First off, they would never get write access to a config file. At most,
they'd get a read-only copy of their virthost section. But if you've set
things up correctly, they don't really need to even see that, and it'll
just clutter up their space.

Second, I wouldn't allow customer-supplied CGI. (Well, not on my machine,
anyway. At work, I'd make sure my boss understood the risks. And paid
me overtime.) But if I did, yeah, I'd put that in their directories.

And last, I'd either put logs in individual directories, and let the
customer do what they wanted with them (and make them responsible for
rotating them, and disk usage), or, if I provided log analysis, just
put them in /var/www/logs/, run the analysis, and provide that.

So, /var/www/<sitename>/, which includes htdocs/, cgi-bin/ (maybe),
and logs/.

[ Dave Taira <***@hagakure.org> 2003.11.26/11:51:40 PST ]
[ Morlock for Hire ]
[ You don't have to be impossible to manipulate. You just make it more ]
[ trouble than you're worth. --Andr00 ]
N.J. Reuvers
2003-11-26 20:00:25 UTC
Permalink
Lads,

Can anyone recommend a pcmcia network card that works in Openbsd 3.3 and
3.4 AND is not too expensive.

Thanks in advance.

Nils
N.J. Reuvers
2003-11-26 21:43:25 UTC
Permalink
Thanks, i've read it before i asked the question. I wanted some
experiences from users, so I could make a safe choice.
Post by N.J. Reuvers
Lads,
Can anyone recommend a pcmcia network card that works in Openbsd 3.3
and 3.4 AND is not too expensive.
Can't recommend one, but http://www.openbsd.org/i386.html have a
listsing of working adapters. For more laptop information, see
http://www.openbsd.org/i386-laptop.html .
Post by N.J. Reuvers
Thanks in advance.
Nils
--
regards/mvh
Stein B. Sylvarnes
***@student.uib.no
Greg Wooledge
2003-11-26 23:08:51 UTC
Permalink
Post by joe angth
just putting everything in htdocs. By this I mean in
htdocs you would have site1, site2, etc.
That's what I do.

/var/www/htdocs/wooledge.org/ ...
/var/www/htdocs/greycat.yi.org/ ...

(Too bad yi.org doesn't work any more.)
--
Greg Wooledge | "Truth belongs to everybody."
***@wooledge.org | - The Red Hot Chili Peppers
http://wooledge.org/~greg/ |
Continue reading on narkive:
Loading...