-3

I have a server with debian 7.4 and apache2 installed. I have setup virtual hosts and all works well. Now instead of pointing the virtual host to a documentroot I need it to point to a port on the same server. "Java app running a jetty server"

--- EDIT --- Down votes... I have been an iis user for years and only this week started using linux

My current virtualhost file is as follows

<VirtualHost *:80>
     ServerAdmin ******@****.**
     ServerName ****.***
     ServerAlias ***.*******.***

     ProxyPass / http://localhost:8080/

</VirtualHost>

proxy.conf

<IfModule mod_proxy.c>
    ProxyRequests On
    <Proxy *>
        AddDefaultCharset off
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Proxy>
    ProxyVia On
</IfModule>

---Another EDIT--- Getting internal server error with the following conf I did see those post mentioned in the comment yet still cnt get this going.....

<VirtualHost *:80>
    ProxyPreserveHost Off
    ProxyRequests On
    ServerAdmin webmaster@+++.***
    ServerName ***.***
    ServerAlias www.***.***
    ProxyPass / http://localhost:6666/
    ProxyPassReverse / http://localhost:6666/
</VirtualHost>

---AND THE FIX---- I fixed the problem by enabling proxy_http aswel... a2enmod proxy_http service apache2 restart

Ernie
  • 5
  • 2
  • this might be some reasons for downvote: no google and no SE search http://stackoverflow.com/questions/8541182/apache-redirect-to-another-port http://serverfault.com/questions/195611/how-do-i-redirect-subdomains-to-a-different-port-on-the-same-server and obviously not RTFM.. http://httpd.apache.org/docs/trunk/vhosts/examples.html – Dennis Nolte Jul 29 '14 at 12:41
  • Still getting Internal Server Error – Ernie Jul 29 '14 at 13:07
  • If you've fixed your problem, please add the solution as an answer then accept it. – Cristian Ciupitu Jul 30 '14 at 15:53
  • the cause..of your second downvote... was your writing "quality".. – peterh Aug 04 '14 at 08:08

1 Answers1

-1

The problem seemed to be that the http proxy was not enabled.

The solution was to

enable proxy_http a2enmod proxy_http service apache2 restart

Now incoming requests are being forwarded to the required ports.

Ernie
  • 5
  • 2