LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-25-2010, 04:09 PM   #1
mtlhd
Member
 
Registered: Sep 2007
Location: Florida
Distribution: Raspbian, Debian, CentOS, Ubuntu
Posts: 131

Rep: Reputation: 18
Angry APACHE VirtualHost not working on older slackware machine


Hey all, I just spent the day trying to understand where I could have gone wrong...

I am trying to add a virtual host to my machine by name to the IP here.

It absolutely refuses to work.

it is a mess server I hope to upgrade soon, but it has 2 versions of apache running together on it.

The first one (php3) just proxies all the requests from 80 to 8080 which has another instance of apache running php5.

so, on APACHE 80's sites.conf, I have:
Code:
<VirtualHost *:80>
        ServerName hostheadererror.com
        ServerAdmin webmaster@mydomain.com
        DocumentRoot /home/me/www/nohostheader
</VirtualHost>

<VirtualHost *:80>
        ServerName www.newdomain.com
        ServerAlias newdomain.com *.newdomain.com
        ServerAdmin webmaster@olddomain.com
#       DocumentRoot /home/me/www/newdomain
        DocumentRoot /dev/null
        ProxyPass / http://localhost:8080/
</VirtualHost>
The sites.conf from the server it proxied to:
Code:
<VirtualHost *:8080>
        ServerName www.newdomain.com
        ServerAlias newdomain.com *.newdomain.com
        ServerAdmin webmaster@olddomain.com
        DocumentRoot /home/me/www/newdomain
</VirtualHost>
I don't know what else to do, it keeps defaulting to the host header error virtual host.

Thanks in advance
 
Old 01-25-2010, 09:25 PM   #2
Elemecca
Member
 
Registered: Nov 2008
Location: San Francisco, CA
Distribution: Gentoo, CentOS
Posts: 71

Rep: Reputation: 22
You don't need to (and probably shouldn't) specify a DocumentRoot in a VirtualHost that's only proxying. Also, you'll probably want to add a ProxyPassReverse directive.

Does your new server have an identical Host error VirtualHost? mod_proxy in reverse proxy mode by default passes the configured target URL as Host. In your case, the server on 8080 would see "Host: localhost:8080" instead of "Host: www.newdomain.com". If this isn't what you want, see the ProxyPreserveHost directive.

You may also find the mod_proxy documentation useful.
 
  


Reply



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
Get 1366x786 working on older box * Slackware 12.2 - Nvidia drivers installed sjampoo Linux - Hardware 8 08-23-2009 10:39 AM
Apache - VirtualHost setting not working? Splenden Linux - Server 9 01-14-2007 12:15 PM
Serious Booting Problems With Slackware 10.2 On Older Machine (Possibly ACPI?) peter_89 Slackware 4 05-02-2006 01:01 PM
Help with Apache <VirtualHost> please. smakkythecamel Linux - Networking 2 06-12-2003 07:15 PM
apache virtualhost jonfa Linux - Networking 5 08-12-2002 06:07 PM

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

All times are GMT -5. The time now is 03:16 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