Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Aug 21, 2003 6:55 am 
Offline
Junior Member

Joined: Wed Jul 16, 2003 1:43 am
Posts: 30
Website: http://www.alution.com
Location: Australia
Hi,

Im having a bit of trouble and am thinking that maybe im taking the wrong approach, or there is another method / hack of doing what I wish to do...

rather than filling up my httpd.conf file with a mass of virtual hosts this is what I plan to do.

Code:
==httpd.conf====8<=======

<VirtualHost *:80>
    LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhostv
    CustomLog logs/access_log.amserver vhostv
    ErrorLog logs/error_log.amserver
    VirtualDocumentRoot /var/server/hosts/config/hosts/%0/html
    VirtualScriptAlias /var/server/config/hosts/%0/cgi
</VirtualHost>
========>8============


Then in the directory /var/server/hosts/config/hosts/ I would have the following...

domain.com -> /var/server/virtual/site1/jail/var/www
www.domain.com -> /var/server/virtual/site1/jail/var/www

So I hope people can see what im doing here...

basically Im doing this so;
1. I dont have a big virtual hosts section
2. I dont have to restart apache everytime i want to add a host, i just add the symbolic link for the host name and where i want it to point to...
3. Im doing this as im writing software so that I can manage all this stuff thru a control panel, and this method would be easier and safer than giving someone thru a control panel access to (not directly of course...) edit httpd.conf and restart apache...

SO............ THIS ALL WORKS FINE.... NO PROBLEMS AT ALL!!!

HOWEVER..... My problem is.. say I want to run php on this virtual host, for some strange reason the DocumentRoot doesnt get set by apache. Which as you can see is very annoying...

for example: say i create the file...

=======8<=======
<?php echo $_SERVER['DOCUMENT_ROOT']; ?>
=======>8=======

it returns...

/var/www/html

which is apache's default doc root..



Has anyone experienced this, and if they did how did they get around it... Ive been trying to nut this one out for a couple of days, seems like other people have experienced this problem as well, and some people have hacks where they mod php then recompile... i dont really want to do this for several reasons (like if i ever want to upgrade... il have to do this again...)

Thanks


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group