Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Apache virtual host setup' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Apache virtual host setup
Authored by: robh on Feb 09, '01 01:37:55PM

Try using hostnames rather than IP numbers. Numbers are messy.

First setup some alias hostnames using NetInfoManager (append new aliases to your machine's name under the 'machines' entry). Do a restart (under the 'Options' menu) to make the new names take. This is equivalent to adding hostname aliases in /etc/hosts on other flavours of unix.

Next add these to your apache.conf ...

Listen 80
Listen 8080

<VirtualHost mymachine:80>
ServerName mymachine
DocumentRoot /Users/robg/wherever/
</VirtualHost>

<VirtualHost family.isp.com:8080>
ServerName family.isp.com
DocumentRoot /Users/robg/elsewhere/
</VirtualHost>

If that doesn't do the trick, post (or email if you prefer) me some diagnostic info. I used to administer imdb.com and had dozens of name based virtual hosts working there. I'm a little rusty right now though.



[ Reply to This | # ]
Apache virtual host setup
Authored by: Anonymous on Mar 13, '01 05:40:47PM

I am simply having trouble getting virtual hosts to work at all! I configured the apache.conf file as such:

port 80
DocumentRoot /Local/Library/WebServer/Documents/dir1
ServerName domainname_of_computer

<VirtualHost second_ip>
DocumentRoot /Local/Library/WebServer/Documents/dir2
ServerName domainname_of_second_ip
</VirtualHost>

I did not set the Listen or BindAddress directives to anything. At this point, I can access the main domain but not the virtual one. Is there something else that I need to do to make this work? Is there something at the system level? Someone please help!

Thanks,
Jason



[ Reply to This | # ]
Apache virtual host setup
Authored by: robh on Mar 14, '01 01:57:41PM

Try the suggestions in my previous post. Avoid numeric IPs in the config.



[ Reply to This | # ]
Apache virtual host setup
Authored by: Anonymous on Apr 02, '01 01:45:36PM

how *exactly* do i use netInfo manager to create those other host names?

please, and thank you.



[ Reply to This | # ]
that is...
Authored by: Anonymous on Apr 02, '01 01:49:54PM

Authored by: robh on Fri, Feb 9 at 01:37PM
Try using hostnames rather than IP numbers. Numbers are messy.

First setup some alias hostnames using NetInfoManager (append new aliases to your machine's name under the 'machines' entry). Do a restart (under the 'Options' menu) to make the new names take. This is equivalent to adding hostname aliases in /etc/hosts on other flavours of unix.
___________
how *exactly (what exactly do i do) to get NetInfo Manager to do that?
thanks.
ichi



[ Reply to This | # ]
adding new hostnames
Authored by: robh on Apr 03, '01 08:51:27AM

Go to the "machines" section, find (and select) your machine's name in the list (I think it should already be there).

You'll see something like this in the bottom window:

ip_address 1.2.3.4
name mymachine

Click on 'name' then using the menu at the top of the screen select:
Directory->Append Value

then type in the new alias for your machine.

Repeat the above for every alias you add.

NOTE: adding these aliases will not make these hostname aliases useable by other machines on your network or the outside Internet. These are local aliases. If you want them to be visible to other machines then you need to put them into a nameserver for your domain, and if you're making up new domain names, e.g. www.mynewdomain.com, then you have to register (buy) the domain first.

Local aliases might seem useless given the above, but they can be VERY useful for prototyping websites that use virtual hosts.



[ Reply to This | # ]