LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Confused about Ubuntu Apache blank httpd.conf and reverse proxy for webcam. (https://www.linuxquestions.org/questions/ubuntu-63/confused-about-ubuntu-apache-blank-httpd-conf-and-reverse-proxy-for-webcam-821765/)

jcubed 07-23-2010 03:30 PM

Confused about Ubuntu Apache blank httpd.conf and reverse proxy for webcam.
 
I've been trying to figure out how to set up my Apache 2 running on Ubuntu 9.10 to provide a reverse proxy so I can see my wifi network camera monitoring my dogs and still have access to my family website. It looked like it should be quick and easy to set up. However, after trying to follow a few threads and tutorials, I've only been getting more confused.

First, I followed the suggestions from this thread on Ubuntu forums:
http://ubuntuforums.org/showthread.php?t=313511

I set up a similar rule set at the end of my /etc/apache2/sites-available/default, restarted apache -- from which I got a response saying that Apache2 could not determine the server name -- and then tried logging into my server through its ip address. When I tried http://192.168.2.80/dogCam, I just got a 404 error. Here's what I added: (I also tried my domain name, but it also didn't work.)
Code:

<VirtualHost 192.168.2.80:80>
ProxyPass /dogCam/ http://192.168.2.160/
ProxyPassReverse /dogCam/ http://192.168.2.160/
</VirtualHost>

When I looked at many other threads, I get recommendations to have my setup in httpd.conf. But, in both this server and a freshly installed Ubuntu laptop, my httpd.conf file is empty! I tried copying and pasting the recommended contents of the following thread, with the example proxy paths replaced with the ones I needed:
http://www.apachetutor.org/admin/reverseproxies

So, now I'm confused. Straight-forward tutorials don't seem to apply, as Ubuntu has a blank httpd.conf file. I figured out that Ubuntu seems to load its modules by simply adding soft-links to the modules of interest from modules-enabled to modules-available. But, after a full day of trying to figure out what looks to be fairly simple and well-documented, I am at a loss for setting up this reverse proxy or even figuring out where to set ServerName to define my domain name to Apache2 in Ubuntu.

Any tips on the subtleties WRT setting up this proxy and/or where I should properly define ServerName would be appreciated.

Many thanks in advance!

- JJJ

bathory 07-23-2010 04:22 PM

Hi,

Use post #4 from the tutorial you've followed. Just need do some changes and add some stuff:
Code:

NameVirtualHost *

<VirtualHost *>
    ServerName www.domain.com
<Proxy *>
Allow from all
</Proxy>
ProxyPass /dogCam/ http://192.168.2.160/
ProxyPassReverse /dogCam/ http://192.168.2.160/
</VirtualHost>

If you don't use dns for your hosts, you can add in /etc/hosts something like:
Code:

192.168.2.80 www.domain.com

jcubed 07-25-2010 01:59 PM

Thanks! At first, it looked like I wasn't getting any farther. However, it seems there was also an error in my test method. I was entering the following in my browser to test the reverse-proxy:
http://192.168.2.80/dogCam

What I should have been entering was:
http://192.168.2.80/dogCam/

That trailing '/' made all the difference. This, of course, makes sense when you look at all of the documentation emphasizing the need for the training '/' in the ProxyPass and ProxyPassReverse directives.

Thanks, again, for your reply!

- JJJ


All times are GMT -5. The time now is 09:03 PM.