LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-21-2003, 04:39 PM   #1
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Rep: Reputation: 15
Apache Virtual Host Redirect


Hey guys, I am trying to redirect a virtualhost entry to another virtualhost entry in my httpd.conf file, here is what I have, but it's not working. Can someone please point me in the right direction. Thanks in advance. Oh yeah, everything works perfectly except for the redirect. Actually, I am just trying to redirect apache2 to apache3.

NameVirtualHost 192.168.1.100
<VirtualHost 192.168.1.100>
DocumentRoot "/apache1"
ServerName apache1
</VirtualHost>

<VirtualHost 192.168.1.100>
DocumentRoot /apache2
ServerName apache2
RedirectPermanent http://apache2 http://apache3
</VirtualHost>

<VirtualHost 192.168.1.100>
DocumentRoot "/apache3"
ServerName apache3
</VirtualHost>
 
Old 05-21-2003, 05:02 PM   #2
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Rep: Reputation: 15
Maybe you should try to do the redirect through dns.

creating a zone file to redirect apache2 to apache3

Regards
 
Old 05-21-2003, 05:37 PM   #3
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Original Poster
Rep: Reputation: 15
yeah, I know that would work, but I am trying to do it without editing any of my DNS entries. I want to do it through apache if possible. THX though. Any other suggestions?
 
Old 05-22-2003, 10:17 AM   #4
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Rep: Reputation: 15
I've never tried it that way be maybe this will work.

<VirtualHost 192.168.1.100>
DocumentRoot "/apache3"
ServerName apache2
</VirtualHost>
 
Old 05-22-2003, 11:04 AM   #5
granny
Member
 
Registered: Nov 2002
Distribution: RH
Posts: 141

Original Poster
Rep: Reputation: 15
yeah, that would work for the actual page to be different, but I am actually trying to get it to redirect to a different Virtualhost, not just the directory, guess I am just being picky about how hosts are redirected not wanting to do it through DNS cuz I know that would work, but still, if any one knows a way to do this without changing DNS entries, I would appreciate it. Thanks!
 
Old 05-22-2003, 01:20 PM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Why not try it like this:

<VirtualHost 192.168.1.100>
DocumentRoot /apache2
ServerName apache2
RedirectPermanent /apache2 /apache3
</VirtualHost>

Also is that the complete and full path to apache2 and apache3? Like its not in something like /var/www/htdocs/apache2, etc? If so, try adding the full path.

Or you can always just make apache2 an actual symlink to apache3 if the above doesn't work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache - Name virtual host tisource Linux - Networking 5 03-03-2006 02:52 AM
Apache 2 Virtual host eckertc1 Linux - Software 6 03-22-2005 09:58 PM
Virtual Host Redirect Issue DigiDave Linux - Software 1 10-23-2003 01:40 PM
Virtual host and apache Samspeed Linux - General 8 08-06-2003 07:41 AM
Apache Virtual URL Redirect nxny Linux - Software 0 07-19-2002 02:36 PM


All times are GMT -5. The time now is 01:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration