CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 5 - General Support
  VHOSTS not resolving to the correct folder location

 

 Bottom   Previous Topic   Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread
  •  serialbox
      serialbox
VHOSTS not resolving to the correct folder location
#1
Peeking in the Member Window
Joined: 2009/3/27
From
Posts: 11
having a bit of trouble getting domains to resolve to their own folder properly on my new server.


this is a plesk/centos server that is pretty much out of the box.

Problem I have is that all the domain names I add to Plesk, are all pulling files from /var/www/html . All 5 domains Ive added each got their own /var/www/vhosts/domain.com/* folders created ...

Is there something I am missing in order to have the server grab files from each domains respective folder?

What I noticed was that if I edit /etc/httpd/conf/httpd.conf and add the virtualhost lines to it, then the one domain name resolves properly.

i replaced my domain with 'mydomain.com'


<VirtualHost *>
ServerAdmin youremail@yoursite.com
DocumentRoot /var/www/vhosts/mydomain.com/httpdocs/
ServerAlias mydomain.com *.mydomain.com
</virtualHost>



I also found that each vhost has its own /conf/ folder at /var/www/vhosts/domain.com/conf/ with an httpd.include file. I tried placing a vhosts.include or vhosts.conf file into that location with the above code and it does not work. It only works if I put that code directly into the main httpd.conf file.

I was hoping that when creating new domains in plesk, it would automatically update the required files to set up each vhost properly, which again it does appear to be doing unless im missing something.

i am restarting apache after each change

any help would be apprecaited.


thx
Posted on: 2009/3/30 17:53
Create PDF from Post Print
Top
  •  RhythmAce
      RhythmAce
Re: VHOSTS not resolving to the correct folder location
#2
Newbie
Joined: 2009/3/30
From
Posts: 1
I'm guessing this is a plesk issue. Centos doesn't do anything like that. It uses the 'Include" directive to point to /etc/httpd/conf.d/*.conf. This allows you to have all your vhosts in one file called 'vhosts.conf' for example. If your vhost definitions are not being found, then it would do as you have discovered and use the one in httpd.conf. The default behavior for httpd is if it can't find a particular vhost, it will default to the first one defined. If your vhosts aren't being found, try adding the locations of the .conf files with the Include directive.
Posted on: 2009/3/31 0:08
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com