Apache is the most-used web server on the internet. Because it is open source, it is very customizeable. Unfortunately, it is a little difficult to configure.
To make the proxy and reverse proxy connections to Tivo more secure (so the password can't be found using a password sniffer), the mod_ssl module should be enabled. Unfortunately, because of cryptography concerns, no installable binary of Apache is available the the SSL Module included. To get access to this module, you will need to download the Apache source code and the openssl.org source code and compile them using Microsoft Visual Studio, which is not a free software package. The only other option is to download and install a Linux distribution, such as Mandrake, that includes a compiled version of Apache with mod_ssl enabled. However, your are still reasonably secure if your don't use SSL encryption as you will keep out anyone who wonders upon your IP address.
This page is based on information from http://www.dslwebserver.com/. Please refer to that page for general installation information.
This guide will go over installing Apache 2.0.39 on a Windows system.
To get the installation file, go to http://www.apache.org and look for their http server link.
More information about the windows version of Apache can be found here: http://httpd.apache.org/docs/windows.html.
The file I am showing here is called: apache_2.0.39-win32-x86-no_ssl.msi, which uses the Microsoft Installer package.
Installing Apache - Here we go!
Double click on the downloaded file to begin installation.
You'll see this welcome screen. Click "Next".
Next you'll see the License Agreement. Check the "I accept" radio button and click on "Next".
Another screen appears with more information about what Apache HTTP server is. Click "Next".
The configuration now begins.
In this example, I'll use my own information to fill in the blanks. The last part of this window asks if you want to run Apache for all users as a service or for just the current user. Since we want Apache to run as a webserver for everybody, we select the first option "All Users". Click "Next".
Here we choose whether to install as Typical or Custom. Typical sounds good to me. It should also be fine more most people. Click "Next".
Now we choose where we want to install Apache. You can change this by clicking on the "Change" button and selecting whichever directory you like. Here we'll keep it default. Click "Next".
To begin installation click "Install".
You'll see this fun blue bar start running (or crawling) across your screen. Just sit tight.
After some disk churning, you'll see that the "Installation Wizard Completed". Click "Finish".
Wow, we're done. Sorta. You see that little new icon in your system tray? That shows you the status of Apache.
Let's see if Apache works now. Fire up your web browser and type in "http://localhost" or "http://127.0.0.1" and see if you get the default Apache page. You should see this.
Changing the Documents Directory
Here we'll cover some basics on configuring Apache. Apache is configured by a very large file called "httpd.conf". In this file are the instructions for how Apache behaves. Much of the file are comments which are not processed by the server. All lines with comments start with the pound symbol "#". The lines that actually take effect do not have the pound symbol at the beginning. The comments give you a good idea of what each line in the configuration file does. It may be a good idea to just print out the whole "httpd.conf" file and study it and all the different parts.
Take a look at your "Start" menu. Apache is now setup there.
First let's cover where you'll put your documents so that people can see them from the Internet. To do this we'll look in the "httpd.conf Configuration file". Go to "Start" --> "Programs" --> "Apache HTTP Server 2.0.35" --> "Configure Apache Server" --> "Edit the httpd.conf Configuration file".
A text file called "httpd.conf" pops up.
Use the "Find" function of notepad to search for "DocumentRoot". You'll see this.
By default, all web documents will be stored in "C:/Program Files/Apache Group/Apache2/htdocs". Let's test this out by creating a small file called "index.html" with the message "hello cruel world!" and putting it into this directory. The reason we called it "index.html" is because that's the default document type for Apache. When Apache finds a "index.html" file in a directory, it know to display this file first. Go to your web browser again and type in either "http://localhost" or "http://127.0.0.1". You should see our message.
Now, you can either keep this directory for all your web files, but personally I would change it to something in a less buried directory like "C:\webdocs" or something like that. It's up to you. All you have to do is change the path in the config file. To illustrate, take a look at the picture where I changed the Document Root to "C:\webdocs". Easy.
When you close the window with the configuration file with your changes, you'll see this message asking if you want to save your changes. Click "Yes".
However, although you saved your changes, your changes are not in effect since the webserver is already running. You must restart the Apache webserver for your changes in your "httpd.conf" file to take place. You can do this easily by selecting "Restart" in the Apache program group.
Now that we've restarted our Apache server, let's see what happens when we go to "http://localhost".
Wow, what a large message. Well, we get this message because we haven't created "c:\webdocs" nor created a default file. Once I create the proper directory and default file, we get this. That's much better (I think)
Next: Changing the port number
Now let's change the port number that Apache listens to. By default, Apache listens to port 80. However, we can/must change this depending on whether we have access to port 80 or not. In order to do this, we must once again edit the "httpd.conf" file.
Use "Find" to find "Listen 80".
Change this port number to the port that you'll be using on your webserver. For this example, we'll use "8888".
No, we're not done quite yet. Use "find" once again to look for "ServerName". A few lines below, you should see the server name you entered during installation. This is what I see.
At the end of your server name, change port 80 to 8888.
Now close the file, save the changes, and restart the Apache server.
Now bring up your web browser again and let's see if we can get to our website by entering "http://localhost" or "http://127.0.0.1". You should see a similar error message.
What happened? Oh yeah, we changed the port number to 8888. Okay, let's try "http://localhost:8888" or "http://127.0.0.1:8888" instead.
Configuring the Proxy Server
The mod_proxy module is included but is not enabled by default in the standard Apache download. To enable and configure the module, again edit the "httpd.conf" file as mentioned above.
<VirtualHost _default_:80>
DocumentRoot /var/www/html
ScriptAlias cgi-bin /var/www/cgi-bin
ProxyPass /tivo http://192.168.XXX.XXX/
<Location /tivo>
AuthName "only for registered users"
AuthType Basic
AuthUserFile "/etc/httpd/.passwd"
<Limit GET>
require valid-user
</Limit>
</Location>
</VirtualHost>
(the ip of tivo is 192.168.XXX.XXX)
To make the password file, use the file htpasswd.exe file located in the bin directory under the main Apache directory. A sample of how this file would be run is shown below: htpasswd.exe -c .htpasswd <user name>
Now move the file .htpasswd into the main apache directory. Add the following line in the httpd.conf file: AuthUserFile c:/apache/.htpasswd
You will now need to edit the file tivoweb.cfg, which is located on your Tivo in the directory that contains the tivoweb files. You will need to edit the tivoweb.cfg file so that tivoweb expects the "/tivo/" at the end of the url used by the reverse proxy server: Prefix = tivo
To get to your Tivo, browse to the following URL: http://account_name.dyndns.org/tivo
There are many customizations for Apache, these are the basics for setting-up a reverse proxy server. Good luck!
Corrections or updates for this page: Note: Do not post questions, unrelated comments, or information of which your are uncertain. This section is reserved for corrections and updates only.
ProxyPass /tivo http://192.168.XXX.XXX/ should read -
ProxyPass /tivo/ http://192.168.XXX.XXX/