Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84
Rep:
Apache VirtualHost Redirect Problem...
Hi,
I have set up Apache for the LAN. Every thing is working fine...except that when an 404 error occurs for the first virtual host, apache redirects it to the home page of the first virtual host. However for other virtual hosts, it does not happen like that and works perfectly the way it shud work (giving a Not Found 404 error message).
...
So whenever i type something like http://192.168.1.21/doesnotexist.html - it redirects me to the home page for 192.168.1.21
Also the Document Root is set to /home ( incase that helps ) and i m running 1.3.x under FreeBSD 4.10...
Are both these virtual hosts on the same machine where you have two IP's with two NIC's in place? If your wanting to redirect to another machine behind your firewall using only one public IP address so it redirects to the other virtual host hosted on the second machine, you have to do something like this:
<Directory "/var/www/develop/">
AllowOverride all
</Directory>
LogLevel debug
HostNameLookups off
</VirtualHost>
___________________________
When I go to develop.mydomain.com, I get the index page of my first VHost at the /var/www/html directory, as opposed to the /var/www/develop directory.
I have only one IP, but it should make no difference how many IPs I have as long as Apache is set to look for the URL.
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84
Original Poster
Rep:
hi trickykid,
Thanks for the reply...I have just one NIC (aliased from 192.168.1.21- 192.168.1.25). Virtual hosts from 192.168.1.22 - 192.168.1.25 are working fine...just that the first virtual host (which is also the actual ip of the NIC) i'e' 192.168.1.21 does not give me a NOT found (404 error) instead it redirects me to the home page of 192.168.1.21....And yes all of the 5 virtual hosts are in the same machine.
Distribution: Solaris 9, FreeBSD 4.10, Slackware, RedHat, Knoppix,
Posts: 84
Original Poster
Rep:
Code:
When I go to develop.mydomain.com, I get the index page of my first VHost at the /var/www/html directory, as opposed to the /var/www/develop directory.
I have only one IP, but it should make no difference how many IPs I have as long as Apache is set to look for the URL.
Hi ApachePadowan,
Is the DNS working fine, try doing a dig or nslookup on www.mydomain.com and develop.mydomain.com and see if they point to the place u r trying to point. (which i guess is working fine otherwise it would have given a not found message).
Since its a NameVirtual host, put a NameVirtualHost <YOUR_IP> statement just before the two virtual host statement and i guess things will work out fine.
What i mean is - your virtual host declaration should be
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.