dynamic DNS & Apache httpd web server setup dynamic DNS & Apache httpd web server setup

Dynamic DNS

  1. Register a (your) top-level domain name (e.g. $9/year from GoDaddy.com or use dotster.com/).
  2. Make a (e.g. $30 or more) donation to dynDNS.com (e.g. via PayPal) for providing dynamic DNS service of a top-level domain.
  3. Move your top-level domain name from the registrar (e.g. GoDaddy or Dotster) to dynDNS.com.
  4. Per dynDNS.com instructions, point your domain to your current dynamic cable/DSL IP address.
  5. If your ISP won’t allow port 80 for your HTTP website, use port redirection; go to, read and follow the instructions for: Redirecting Web Requests To An Alternate Port

   http://support.dyndns.org/guides/portredirect.php

Forwarding DNS through a router

The following example is based upon the popular Linksys cable/DSL router.

  1. Update your (e.g. Linksys) router firmware to the latest firmware.
  2. Using the Linksys web interface, go to Advanced | Forwarding | UPnP Forwarding
  3. In the "Application Name" column, make up a label/name (I chose: dynDNS).
  4. In the Ext.Port column, enter your chosen non-80 http port (e.g. in the dynDNS instructions they chose port 8080).
  5. Verify that the TCP (not UDP) radio button is clicked.
  6. Enter 80 in the Int.Port column (i.e. Now that you’re inside your own firewall, you can redirect the port back to 80, on which your web server is probably listening).
  7. In the IP Address column, put the 192.168.1.xxx number for your web server PC.
  8. Click enable ... and you’re done!

Now, you can type http://yourDomainName.Whatever into a browser.  dynDNS.com does the DNS lookup and redirects to your current cable/DSL IP address on your chosen non-80 http port.  Your Linksys router Forwards your chosen non-80 http port to your specified web server PC IP address, back on port 80, once inside the router firewall.  Your (e.g. Apache httpd) web server knows nothing of all these shenanigans and is listening and hears on port 80, as it normally expects!
 
The following example is for the Siemens 2614 router, which simply labels and categorizes things differently.  Siemens doesn’t use a separate “UPnP Forwarding” page; rather Siemens labels their page “Virtual Server”.

  1. Update your router firmware to the latest firmware.
  2. Navigate to the Advanced Setup | Virtual Server page.
  3. Enter the 4th quartet (e.g. 99) for your internal server and (to stick with the above example) enter 80 for the “Private Port”.
  4. Retain the "TCP" radio button selection.
  5. Enter 8080 for the “Public Port” (again, sticking with the above example).

Returns behind your router (i.e. within your LAN)

DynDNS tech support informed me that, if the router lacks “loopback” support (and most don’t have loopback support), another PC behind the router (i.e. within the LAN) will not see the returned HTML – even though the HTML will be properly returned to browsers OUTside the router.
However, behind the router, one can call the server, directly (e.g. http://serverName  or http://IPaddress … e.g. http://192.168.1.101), rather than use the domain name (e.g. http://domainName.whatever).

Remote Desktop (Terminal Services)

Microsoft "Remote Desktop" (what used to be called Terminal Services) requires:

  1. that the target machine be set up as a Terminal Server and 
  2. the client machine needs to configure "Remote Desktop Connection".

Terminal Server Setup

On a computer, running Windows 9x, NT4 or Windows 2000, insert the Windows XP CD.  On the Welcome dialog box, click "Perform Additional Tasks"; then, "Setup Remote Desktop Connection".  Re-boot, of course, and configure the server ...

To use a

Client Remote Desktop Setup

This setup requires Windows XP.  Go to Programs -> Accessories -> Communications -> Remote Desktop Connection ...
If the terminal server end is properly setup, the target computer will show up by clicking "Browse for more ..." on the "Computer" pull-down menu.  Click the "Connect" button ... and off you go ...

Terminal Server behind a router

Map the internal computer IP address to port 3389 in the router and type:  http://theExternal_IP:3389

Apache httpd web server configuration

Start (i.e. run) the Apache httpd domain/service

Start the Apache service via Programs | System | Service Configuration | httpd; check the box and re-boot is the easiest way to make sure everything gets called appropriately.  This step assumes that you have a standard Apache RPM installation as part of your Linux distribution.

http.conf configuration

Although Apacheconf provides a windowed interface to configure /etc/httpd/conf/httpd.conf, because Apacheconf does not provide for editing all required Directives/Properties, it’s ultimately easier to edit /etc/httpd/conf/httpd.conf, manually, than to rely upon Apacheconf.
The main Directives/Properties you need to edit, to get started, are:

DocumentRoot

Choosing and setting the DocumentRoot is the most-likely step to stop you in your tracks; so, it’s worth reading the following, carefully.
Rather than edit the default (Red Hat default = /var/www/html/ ) DocumentRoot setup and index.html, it’s cleaner to establish a different DocumentRoot (e.g. /wwwhtml/).
The DocumentRoot (default:/usr/local/stronghold/htdocs) and its parent directories permissions must be world-readable and world-executable (755).  Since the DocumentRoot parent directory permissions must be world-readable and world-executable, it’s easier if you make the DocumentRoot directory be a top-level directory; then, you don’t have to worry about permission issues due to DocumentRoot parent directory permissions.
If you receive the error: "403 Forbidden - You don't have permission to access / on this server", you need to change the DocumentRoot and all of its parent directory permissions to be world-readable and world-executable (755) e.g. manually with the command:
# chmod 755 directoryName
where "directoryName" is the actual name of the directory.
Note:  A DocumentRoot Directive/Property appears for the server and for each VirtualHost setup; so, watch where you’re changing it.

ServerName

ServerName should contain a registered DNS domain name e.g. www.mikecoughlin.net (It can be without the ‘www’, if the DNS Host name is set up that way).  If you don't have a valid DNS name, you can use an IP address (e.g. 192.168.254.99) … or to simply use Apache for development & testing, use the loopback address: 127.0.0.1.

An example VirtualHost setup

    <VirtualHost  192.168.254.99> 
ServerName www.mikecoughlin.net
DocumentRoot /wwwhtml/
</VirtualHost>
Note the subtle way that VirtualHosting is accomplished, above.  The <VirtualHost 192.168.254.99> can be repeated in httpd.conf with different ‘ServerName’s – to host different registered DNS domain names at the same VirtualHost IP address!

Back Home