Default server pointing to virtual server folder

Hi there,

I have run into a problem with document root.

I followed a tutorial to set up ns1.mydomain.com and ns2.mydomain.com

Now mydomain.com is set as a default. Below is what is looks like.

    Default Server	Any	Any	Automatic	        /var/www/html	Open..
Virtual Server	Any	Any	storepica.com	        /var/www/html	Open..
Virtual Server	Any	443	Automatic	        /var/www/html	Open..

Now I created a virtual server like above for another domain. Now, If I use document root for store.com like /home/store/public_html then I get 403 Forbidden error page. This happens for both the default site and store.com

I did some googling and what I figure that the settings in the Default server is overriding the settings on new virtual servers.

Any advice would be great.

Thanks for reading my post.

Cheers

So far the solution mentioned below works for 3rd new virtual server, I created reccently, but my default server and the 2nd virtual server is still showing pointing at the same folder, even though they both have different DocumentRoot directory.

I think I will delete my 2nd virtual server and recreate it.

#solution taken from http://purab.wordpress.com/2009/10/07/solved-issue-directory-index-forbidden-by-options-directive/


When I inserted the following code in bottom of the httpd.conf file.
<VirtualHost *:80>
Options +FollowSymLinks
ServerAdmin purab@yahoo.co.in
DocumentRoot /var/www/html/testfolder
ErrorLog logs/error_log_net
TransferLog logs/access_log_net

When tried the http://localhost/ in browser, I got the default browser page.
Then I tried to look my apache error using following command:
#[root@localhost ]# tail -f /var/log/httpd/error_log

In apache error log I got following error.
[Wed Oct 07 15:59:50 2008] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/testfolder/

I changed the AllowOverride option but nothing is happend. Then I read the welcome page text
“To prevent this page from ever being used, follow the instructions in the file /etc/httpd/conf.d/welcome.conf.”
I opend the welcome.conf file.

I found following lines in welcome.conf file.
<LocationMatch “^/+$”>
Options -Indexes
ErrorDocument 403 /error/noindex.html

I changed that to as follows:

<LocationMatch “^/+$”>
Options Indexes
ErrorDocument 403 /error/noindex.html

That solve my problem. Some time your selinux will cause the issue so you need to deactivate the selinux.
Some time File permission will also cause the issue.
You can change the file permission using following command, go to that directory and run following command.
#chmod 777 *

I deleted all my virtual servers, now the site comes up with the files hosted on the default server. Then I recreated another virtual server. My problem came back to haunt me.

When I type in the name of the default server http://lookkawa.com and storepica.com, it goes to the same page. The page which should be the default for http://lookkawa.com

When I create a virtual for storepica.com, then lookkawa.com is pointing to storepica.com page.

Please help me guys, this pointing in opposite direction for domains is driving me crazy from two days.

Thanks all