LinuxQuestions.org
Visit Jeremy's Blog.
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-24-2010, 02:23 PM   #1
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Rep: Reputation: 2
Any way to tunnel apache virtual host to an internal apache?


I am upgrading my server and I have a lot of sites. Since I cannot take my server down for a few days, maybe a week until I manage to migrate all the sites to the new machine, I figured I could migrate them one by one. After migrating one, I would somehow tunnel the requests of that name virtual host to my internal machine. When everything is migrated, I would then switch the machines, update ip's and stuff and everything will work just fine.

however I cannot seem to find a way to do this tunneling. is this at all possible? If not, what alternatives do I have?

thanks.
 
Old 01-24-2010, 05:21 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I think mod_proxy will do the job for you...

cheers
 
Old 01-26-2010, 04:26 PM   #3
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Original Poster
Rep: Reputation: 2
can you give a bit more info?
I tried making a reverse proxy since that's what I understood from googleing that I need.
so I have the following config:
Code:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Include conf/proxy_html.conf
<VirtualHost *:80>
    ServerAdmin root@ciuly.com
    ServerName blog.ciuly.com
    ServerAlias blog.ciuly.com
#    DocumentRoot /www/www.blog.ciuly.com/

    ErrorLog logs/error_log-blog.ciuly.com
    CustomLog logs/access_log-blog.ciuly.com combined

    ProxyRequests off
    ProxyPass / http://192.168.1.2/
    ProxyHTMLURLMap http://192.168.1.2 /
    ProxyPassReverse / http://192.168.1.2/
    ProxyHTMLEnable On
    ProxyHTMLURLMap / http://192.168.1.2/
    RequestHeader unset Accept-Encoding
</VirtualHost>
192.168.1.2 is the new server. 192.168.1.1 is the old server which also acts as a router and has the internet connection on it. the above httpd.conf is on 192.168.1.1

what happens is that I either get a 404 for articles OR I am being redirected to http://192.168.1.2/wp-admin/index.php when logging in instead of http://blog.ciuly.com
(the httpd.conf contains all the other needed stuff for apache I just posted the relevant stuff for this issue)
also, proxy_html.conf is the one from mod_proxy_html (http://apache.webthing.com/) which I installed after the login redirect issue as it is advertised to fix that specific problem and more. after installing that and mod_xml2enc (same site) I started getting 404 everywhere.

any ideas what I am doing wrong?
 
Old 01-27-2010, 04:31 PM   #4
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Original Poster
Rep: Reputation: 2
well, I would guess that mod_proxy can be configured somehow to do the job but I just couldn't and this already wasted 2 days of my time so I am now going to install the needed software for all sites with everything they need and test them "empty" and then take the server offline for a while, migrate the DB and get the server back online. hopefully it won't take long and everything will work fine.

thanks for your input anyway
 
Old 01-27-2010, 05:23 PM   #5
phlyer
Member
 
Registered: Jan 2010
Distribution: CentOS, Vector Linux, Scientific Linux, Rocks
Posts: 36

Rep: Reputation: 17
the simple ProxyPass works for me:

<IfModule mod_proxy.c>
ProxyRequests On
ProxyPass /maverick/ http://maverick.us.tekware/
</IfModule>

Hope that helps
Matt
 
Old 01-31-2010, 12:53 PM   #6
ciuly
LQ Newbie
 
Registered: Jun 2009
Location: Romania
Distribution: CentOS CLI-only kernel 2.6.18-194.32.1.el5
Posts: 24

Original Poster
Rep: Reputation: 2
I bet it works, but what I needed was a reverse proxy
 
  


Reply

Tags
apache, modproxy



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 virtual host liang3391 Linux - Server 1 07-03-2009 10:23 PM
apache virtual host help? paddyjoy Linux - Server 4 09-19-2006 05:49 AM
Apache 2.0 Virtual Host? w0lfeyes Linux - Networking 1 05-03-2004 03:09 PM
Virtual host and apache Samspeed Linux - General 8 08-06-2003 07:41 AM
apache virtual host mimi Linux - General 1 04-06-2002 05:11 AM

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

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