DNS and Webserver help
Is it possible to have two web sites running off your fc3 box with one ip? For example
www.mysite_1.com www.mysite_2.com have them set up to /home/test/site1 /home/test/site2 and have it so that if someone comes from www.mysite_1.com it will send them to mysite_1.com, and vise versa for www.mysite_2.com? Second- in FC2 there is a dns server config tool, however in fc3 i cant seem to find it? was this replaced by something or is there a better way to set up dns on your linux box? thanks |
You can do 1 of two things. You simply create virtual hosts in apache. They can be done on a name base or ip based.
ip based would simply require you to create virtual IP addresses. if eth0 is 192.168.0.1 you can make etho:0 be a completely different ip and both will point to the same nic ifconfig eth0:0 10.0.0.1 ifconfig eth0:1 192.168.1.99 ifconfig eth0:2 10.10.5.100 etc These are good as long as the system is up. On RedHat you can create different files with the IP addresses down in /etc/sysconfig/network-scripts you will already have ifcfg-eth0 so you can just create an ifcfg-eth0:0 file as well. Your otherchoice is creating name based virtual hosts. It is an absolutely lousy tool in my opinion, but redhat's apacheconf tool may help you out. Better yet, download webmin from webmin.com and there is a nicer gui based tool for configuring apache. |
Quote:
1. how do i get etho to have those other ip addresses? I have a static ip address and im behind a firewall/router. so the ip address that my computer gets is 192.168.0.6, this is the ip that stands outside my dmz port. Also incase you need to know im running FC3. 2. When creating the virtual host with apache cant i do that by editing the .conf file for apache? thanks help is really appreciated |
The "virtual IP addresses are made by issuing either
ifconfig eth0:0 192.168.1.99 or whatever IP address you want. The hard coded way would be to create a file just like the /etc/sysconfig/network-scripts file but call it ifcfg-eth0:0 Instead of the word BOOTPROto=dhcp it should read BOOTPROTO="static" IPADDR=192.168.0.99 NETMASK=255.255.255.0 If you change your actual IP using setup or netconfig it will write the ifcfg-eth0 file the way you need it. just use that format then change your IP back to dhcp again |
Ok i used the Network configuration tool in Gnome to do this.
i created etho0: 192.168.0.6 (this was my defualt one, i didnt creat this one) etho0:1 192.168.0.100 subnet 255.255.255.0 (this one is new, however it is used by static ip address) etho0:2 192.168.0.101 subnet 255.255.255.0 (This one is new also) Now is this what i should do (sorry if im far off but im pretty new to linux) :newbie: |
Set up the virtual hosts, i.e. in your httpd.conf:
Code:
<VirtualHost 192.168.0.100> |
i'd really advise against the ip based virtual host... it takes you down to a level of networking that you simply don't need to be concerned about. instead in apache, jsut enable name based virtualhosts in your httpd.conf (or apache.conf or whatever your distro uses):
Code:
NameVirtualHost * Code:
<virtualhost *> |
to use the name based virtual host will i need to set up internal DNS?
thanks for all the help so far though |
All times are GMT -5. The time now is 08:47 PM. |