LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2012, 10:35 AM   #1
societymedia
LQ Newbie
 
Registered: Dec 2012
Posts: 8

Rep: Reputation: Disabled
Apache redirecting to a specific port


Hi all,

all same machine.

I have an apache webserver using VirtualHosts.

I have a Node server running on port 8080.

What i would like is to have my domain api.domain.com redirect to xx.xx.xx.xx:8080

I would like this to have a clean url that hits my node server.

TIA,
Tony
 
Old 12-12-2012, 11:07 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,801

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Hi,

You can define the vhost api.domain.com as a reverse proxy of the node server, i.e use something like the following:
Code:
<VirtualHost *:80>
ServerName api.domain.com 
ProxyRequests Off
ProxyPass / xx.xx.xx.xx:8080/
ProxyPassReverse / xx.xx.xx.xx:8080/
...
</VirtualHost>
Regards
 
Old 12-12-2012, 12:25 PM   #3
societymedia
LQ Newbie
 
Registered: Dec 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thank you for your reply. I have changed my httpd to this:

<VirtualHost xx.xx.xx.xx:80>
ServerName api.domain.com
ProxyRequests Off
ProxyPass / xx.xx.xx.xx:8080/
ProxyPassReverse / xx.xx.xx.xx:8080/
</VirtualHost>

and i get:
Syntax error on line 1021 of /etc/httpd/conf/httpd.conf:
ProxyPass URL must be absolute!

Any ideas?

Thanks

Last edited by societymedia; 12-12-2012 at 12:26 PM. Reason: removed IP
 
Old 12-12-2012, 12:40 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,801

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
My bad. It should be:
Code:
ProxyPass / http://xx.xx.xx.xx:8080/
ProxyPassReverse / http://xx.xx.xx.xx:8080/
 
Old 12-12-2012, 12:43 PM   #5
societymedia
LQ Newbie
 
Registered: Dec 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Im sorry.. I should i tried that! Thank you sir! Im up and running !! you guys rock!
 
  


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
Redirecting subdomain's port to another (local) port. e-San Linux - Networking 13 12-19-2011 04:52 PM
Apache: Redirecting to Different Port zok Linux - Networking 1 07-17-2007 11:51 AM
Forwarding the Apache HTTPD log reporter to a specific port nkanthikiran Linux - Server 1 11-03-2006 04:26 AM
apache server redirecting to apache.org? exley Linux - Software 1 03-13-2006 01:02 AM
how to redirecting log information to a specific mail id singhalyogesh Linux - General 3 06-30-2005 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration