LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-26-2013, 08:50 AM   #1
Smokin...
LQ Newbie
 
Registered: Jan 2004
Distribution: Debian
Posts: 18

Rep: Reputation: 0
Apache Internal Server Redirection vhost => vhost not working [Debian & Apache 2]


Hi

Any help anyone can give me on this problem, detailed below, would be greatly appreciated.

Kind regards
Nick Adie

I have a Public [82.x.x.x] and Private Apache Servers [192.168.20.100], and wish to redirect a series of subdomain requests i.e. for joomla.example.com or moodle.example.com on 82.x.x.x => joomla.example.com or moodle.example.com on 192.168.20.100.

joomla.example.com [82.x.x.x] returns joomla.example.com [192.168.20.100]

moodle.example.com [82.x.x.x] however returns joomla.example.com [192.168.20.100]

VHOST Configuration on [82.x.x.x]:

<VirtualHost *:80>
ServerName joomla.example.com
RewriteEngine On
RewriteRule ^(.*)$ http://192.168.20.100$1 [P]
</VirtualHost>
<VirtualHost *:80>
ServerName moodle.example.com
RewriteEngine On
RewriteRule ^(.*)$ http://192.168.20.100$1 [P]
</VirtualHost>

----------

VHOST Configuration on [192.168.20.100]

<VirtualHost *:80>
# joomla.example.com>
ServerName joomla.example.com
ServerAlias joomla.example.com
DocumentRoot /var/www/joomla/
ServerRoot /var/www/joomla/
ScriptAlias /cgi-bin/ /var/www/~cgi-bin/joomla/
ErrorLog /var/www/~log/joomla/error.log
CustomLog /var/www/~log/joomla/access.log combined
ErrorDocument 404 /404.htm

<Directory /var/www/joomla>
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
#Order allow,deny
#Allow from all
</Directory>

</VirtualHost>

<VirtualHost *:80>
# moodle.example.com>
ServerName moodle.example.com
ServerAlias moodle.example.com
DocumentRoot /var/www/moodle/
ServerRoot /var/www/moodle/
ScriptAlias /cgi-bin/ /var/www/~cgi-bin/moodle/
ErrorLog /var/www/~log/moodle/error.log
CustomLog /var/www/~log/moodle/access.log combined
ErrorDocument 404 /404.htm

<Directory /var/www/moodle>
Options FollowSymLinks MultiViews ExecCGI
AllowOverride All
#Order allow,deny
#Allow from all
</Directory>

</VirtualHost>
 
Old 05-26-2013, 12:06 PM   #2
Smokin...
LQ Newbie
 
Registered: Jan 2004
Distribution: Debian
Posts: 18

Original Poster
Rep: Reputation: 0
Thumbs up Fixed: Apache Internal Server Redirection vhost => vhost not working [Debian & Apache 2]

Hi

Added: 'ProxyPreserveHost On' to each of the [82.x.x.x] vhost files.

<VirtualHost *:80>
ServerName joomla.example.com
RewriteEngine On
ProxyPreserveHost On
RewriteRule ^(.*)$ http://192.168.20.100$1 [P]
</VirtualHost>

Regards
Nick Adie

Last edited by Smokin...; 05-26-2013 at 01:00 PM.
 
  


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 Vhost with reverse proxy and redirection volga629 Linux - Server 3 01-13-2010 03:30 AM
apache - mod_proxy to vhost two internal addresses cam34 Linux - Server 4 02-18-2009 11:15 PM
Apache: Alias is working on ssl vhost but not on mass vhost jonavogt Linux - Software 0 06-07-2005 02:05 PM
Apache Vhost( You don't have permission to access / on this server.) trekgraham Linux - Software 3 07-08-2004 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration