Results 1 to 10 of 11
I want to have to addresses
mydomain.com ( www.mydomain.com ) that points to /var/www/html/mydomain
and
webmail.mydomain.com that points to /var/www/html/webmail
I have one IP so I am using name based
...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-04-2005 #1Just Joined!
- Join Date
- Oct 2004
- Posts
- 34
**Resolved** Apache virtual Server problem
I want to have to addresses
mydomain.com (www.mydomain.com) that points to /var/www/html/mydomain
and
webmail.mydomain.com that points to /var/www/html/webmail
I have one IP so I am using name based
I tried this:
<VirtualHost *:80>
ServerName webmail.mydomain.com
DirectoryIndex index.php
DocumentRoot /var/www/html/webmail
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DirectoryIndex index.php
DocumentRoot /var/www/html/mydomain
</VirtualHost>
The first part work I can view my webmail but when I browse to mydomain.com or www.mydomain.com it goes to the webmail folder instead of the mydomain folder.
Please Help
- 01-04-2005 #2Just Joined!
- Join Date
- Jan 2005
- Posts
- 30
Try this config:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName webmail.mydomain.com
DirectoryIndex index.php
DocumentRoot /var/www/html/webmail
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DirectoryIndex index.php
DocumentRoot /var/www/html/mydomain
</VirtualHost>
PS: I add "NameVirtualHost *:80"
- 01-04-2005 #3Just Joined!
- Join Date
- Oct 2004
- Posts
- 34
Thanks, i forgot to uncomment that line.
- 01-04-2005 #4
I want to hi-jack this thread because it is along the lines of my question. I am running my own DNS and I have a webserver that hosting multiple websites. I am paying a lot for IP's and If I do the virtual option as above. Do I make all of my sites the same IP in my DNS?
To clarify would I have to make all of the websites IP addresses the Ip of the webserver?
Does this make sense?
MikeSome people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
- 01-04-2005 #5Just Joined!
- Join Date
- Jan 2005
- Posts
- 30
"Do I make all of my sites the same IP in my DNS? "
YES and it's works beautifull.
I recommand you that the first VirtualHost will be a default one that says
that this webserver hosts multiple websites because if someone will use
the IP of the webserver he will get the first VirtualHost.
- 01-04-2005 #6I don't understand this statement. Do you mean if they enter the IP instead of the name?
Originally Posted by murphy_young Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
- 01-04-2005 #7Just Joined!
- Join Date
- Jan 2005
- Posts
- 30
"Do you mean if they enter the IP instead of the name?"
YES
Let's say for exemple, that you have 20 VirtualHost (web site):
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.site1.com
DirectoryIndex index.php
DocumentRoot /var/www/html/site1
</VirtualHost>
<VirtualHost *:80>
ServerName www.site2.com
DirectoryIndex index.php
DocumentRoot /var/www/html/site2
</VirtualHost>
<VirtualHost *:80>
ServerName www.site3.com
DirectoryIndex index.php
DocumentRoot /var/www/html/site3
</VirtualHost>
<VirtualHos . . .
Now the IP of the web server is 1.1.1.1
If some one will enter the IP 1.1.1.1 instead of site3 or site2 or site1 ...
he will get the first VirtualHost on the list, and in this example this is
site1. So if for example you are a webhosting company, the first
VirtualHost will be a default page, Not a customer web site, it can be a
web page for example only with your company logo.
- 01-04-2005 #8
thanks, I am going to do that tonight when I get home. I will give back some IP's and save money yay!
I will let you know how it goes.
Thanks againSome people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds
- 01-05-2005 #9Just Joined!
- Join Date
- Jan 2005
- Posts
- 30
" I will let you know how it goes. "
Well, did you success?
- 01-05-2005 #10
Thanks for checking up on me but as luck would have it i had to work real late last night and didn't get a chance to get to it and tonight I start back on school I will definitely get to it this weekend.
I will keep you posted for sure
Thanks again,
MikeSome people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds


Reply With Quote
