Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: Wooderson on March 19, 2005, 03:56:35 PM
-
Hello,
I need to modify my httpd.conf file to set the ServerName for one of my virtual doamins (ibays) to something other than the default "www." due to the DNS being hosted elsewhere.
The rest of my virtual domains need to stay the default "www.".
I know I need to modify the /etc/e-smith/templates/httpd/conf/httpd.conf/VirtualHosts/02ServerName
template to check the $virtualHost and then set the ServerName accordingly... something like:
if $virtualHost = "abc.com" then serverName newname.{$virtualHost}
else
serverName www.{$virtualHost}
But I'm really not sure of the proper syntax (obviously!) to make this work. Can someone point me in the right direction?
Thanks!
[/code]
-
You can do that in the Hostnames panel in server manager without needing to edit at the command prompt.
Just choose to modify the www entry for the domain in question and select remote and put in the IP (or something like that, have a look yourself).
-
Hmmm... curious. :-?
I've already added the entry in hostnames as that was the first thing I did after adding the domain, and it does not work.
Pointing a browser to the hostname I added will pull content from the Primary (default) site not the ibay that the domain is directed to.
I am hosting some sub-content for a company that has control of their own DNS. They have a hostname mc1.abc.com that is mapped as an A record to the IP of my SME box (6.01)
When I look though the httpd.conf file I see no reference to the hostname I added anywhere. I modified the httpd.conf file to see what it would take to get this working. Adding "mc1.abc.com" to the ServerAlias for that domain did not work either, but replacing the ServerName "www.abc.com" with "mc1.abc.com" did work.
Any other thoughts? Thanks Ray.
-
Wooderson
I'm not sure that we are talking about the same thing here ! .. or maybe we are !
> I've already added the entry in hostnames.....
What entry did you add ?
Have you added a virtual domain in the Domains panel ?
I mean to edit the automatically created entry (that was created when you added a virtual domain using the Domains panel)
ie
in Hostnames & Addresses panel
for domain2 that you wish to redirect the www requests for
you should see a www.domain2 entry (not the one for your main domain)
click on Modify and then select Local, Remote or Self, in your case if Remote select that and enter the IP for the server hosting the wwww.domain2
Maybe it's a local server so select Local and enter the IP
> Pointing a browser to the hostname I added will
> pull content from the Primary (default) site not
> the ibay that the domain is directed to
Sounds like it is setup incorrectly, refer above.
I'm guessing you have not added a virtual domain for domain2 in the Domains panel FIRST.
-
Wooderson
> Any other thoughts?
Have you ever thought to read the handbook, I'm sure this type of configuration is covered in there !
http://mirror.contribs.org/smeserver/contribs/bobk/SME_Manual/chpt-13.6.html
http://mirror.contribs.org/smeserver/contribs/bobk/SME_Manual/chpt-13.5.html
-
Ray, Thanks for sticking with me on this, I do appreciate it.
I'll try and be as clear as I can. I have looked though those pages, the admin guide and techincal handbood and agree that this SHOULD work, but it does not for me.
I am hosting some content for a large-ish company on my local SME box. They have changed their DNS record for mc1.abc.com to resolve to the public IP of my local SME box.
First I added an Ibay "abc" and then I added a virtual domain "abc.com" and directed it's content to the "abc" ibay.
Next I then added "mc1" as a hostname for "abc.com" and set it to "self". I've also set the default "www" that is created automatically to "self". I've also tried remote and local as well, putting in my public IP, but since the content in actually on the same SME box I believe "self" is correct.
Typing my public IP address: http://123.456.789.012 into a browser will get you to my Primary site on my SME box, which is correct.
Typing http://mc1.abc.com into a browser will also get you to my Primary site on my SME box, which is not correct.
I cannot use the www hostname for this site as this company already has that "in-house".
The only ways I've been able to get "mc1.abc.com" to get to the "abc" ibay is to either enter http://mc1.abc.com/abc in a browser, or change the ServerName in the httpd.conf file for this virtual domain from "www.abc.com" to "mc1.abc.com" and then restart httpd.
I can PM you the address of this box so you can see it firsthand if you'd like, I just don't want to post the address on a public forum.
-
Wooderson
> First I added an Ibay "abc" and then I added a
> virtual domain "abc.com" and directed it's content > to the "abc" ibay.
I think you should create the virtual domain of
mc1.abc.com
and point it at the abc ibay ?
No need for hostnames or anything else, remove those extraneous entries.
-
Did that fix it ?
-
Ray,
Thanks, that got it working. I would never have put the FULL host name in the virtual domain setting following the directions:
Note
When you are entering the name for the virtual domain, you should supply the fully-qualified domain name . This is the full name of the domain, including any extensions like ".com", but without any prefixes like "www" or "ftp". For instance, you can create a virtual domain by entering "tofu-bird.com", but not by entering "tofu-bird" or "www.tofu-bird.com".
Looking thought my httpd.conf file I see it shows:
<VirtualHost 0.0.0.0:80>
ServerName www.mc1.abc.com
ServerAlias mc1.abc.com mail.mc1.abc.com
...
Which seems to be a little bit of a "work around" but it works for me.
Thanks Ray!