I'm running Apache 2.0.51 r1 on a Gentoo Linux box ver 2.4.25 and what I would like to do is host individual websites for some user accounts using sub-domains (ex. foo.somesite.sytes.net
for user foo
). My No-IP account is upgraded to Enhanced.
At the moment, foo's website can be accessed through the default per-user directory somesite.sytes.net/~foo/
and the default website is simply accessed at somesite.sytes.net
This is what I have done so far:
- I have enabled wildcards for the domain somesite.sytes.net
(which is port redirected to 81)
- In the commonapache.conf file (located in /etc/apache2/conf) I have added the following for virtual hosting:
I restarted the server and when I type foo.somesite.sytes.net
I am redirected to the default document rather than foo's site. I tried switching the order of the virtual host directive blocks, and sure enough I get to foo's site, but then accessing the www.somesite.sytes.net
server alias or just somesite.sytes.net
also takes me to foo's site. From my observations, even with the host specific server names (www vs. foo) the virtual host configuration used is defaulted to whatever is listed first.
I've looked around in various linux forums and the apache website to figure out how to fix this and obtain the results that I am looking for, but as far as I know, everything I've done is correct. But since I am not getting the result I want, something must be wrong. Please help, I've spent so much time already on this. Thanks.