Default documentroot apache does not work

Posted by James Wise on Server Fault See other posts from Server Fault or by James Wise
Published on 2012-09-26T02:29:11Z Indexed on 2012/09/26 3:39 UTC
Read the original article Hit count: 211

Filed under:
|
|
|

I have apache version 2.2 and php 5.3.15 on a single server.

I configured virtual hosting and a default vhost.

0_default_.conf -> goes to /var/www/default

sub.domain.com.conf -> goes to /var/www/sub.domain.com

My question is, how could I set the default documentroot to sub.domain.com permanently? That means all request should be redirected to sub.domain.com.

I try to remove 0_default_.conf but when viewing the page it display the php source code of sub.domain.com.

Here is my configurations --> http://pastebin.com/4e3awUJ4

Although I can create index.php to /var/www/default and permanently redirect to sub.domain.com site but it's not viable solution for me because what if I didn't point the ip address of sub.domain.com to the server so user cannot view that subdomain.

I would appreciate if anyone could share their knowledge and wisdom.

Thanks.

JamesW

© Server Fault or respective owner

Related posts about apache2

Related posts about php