How To: Run a Free Web Server From Home on Windows or Linux with Apache

Run a Free Web Server From Home on Windows or Linux with Apache

Paying for web hosting isn't ideal in most situations. If you have your own website, hosting it yourself is very acceptable and easy to do, assuming your internet bandwidth permits. Most people want to run a personal site, nothing crazy, so hosting from home on low-bandwidth internet is actually a better solution in most cases.

In this Null Byte, I'm going to show you how to set up your own web server from home using the free Apache web server. You can be running Windows or Linux, because I will be covering them both!

Requirements

  • A website to host (for testing purposes, not really needed if you just want to learn)
  • Windows or Linux

Step 1 Enable Port Forwarding

First, let's set up port forwarding so that you can access your website from an external network.

  1. Click Start.
  2. In the search, type cmd and hit Enter. In the prompt, type ipconfig, and it will list your default gateway and IP address. Take note of both.
  3. Type 192.168.1.1 or the gateway you got from the previous step into the address bar of your internet browser.
  4. Log into your wireless router. Default username and passwords are usually admin:password.
  5. Click Port Forwarding somewhere on the page. All of them look different, but here is how mine looked:Mastering Security, Part 2: How to Create a Home VPN Tunnel
  6. Click Port Forwarding on the router page.
  7. Set the host to your computer's IP address that we noted, and the port to 80.
  8. Go to What Is My IP Address and write down your IP. You will need this for reference later, as well as during the Windows install of Apache.

Step 2 Register with DynDNS

DynDNS will allow us to have a domain to visit and remember for our webserver, rather than remembering our dynamic IP all of the time. Simply sign up for the service and fill in your IP, it's really straightforward.

Step 3 Install the Apache Web Server

Follow the instruction set that corresponds to your platform.

Windows

  1. Download the latest release of the Apache web server with an .msi extension.
  2. Run the installer.
  3. When presented with the option, make sure to install the Apache service.
  4. Open a command prompt and navigate to the Apache bin directory under C:\Program Files\Apache Group.
  5. Run the service.
        httpd -k start

Linux

  1. Run your package manager and install Apache. I run Arch, so here was what I input:
        sudo pacman -S apache
  2. Run the service.
        sudo rc.d start apache
  3. Visit 192.168.1.1 to see the Apache test page.
  4. To add your website to your server, just put the files in /srv/www/.

There you have it. Better than paying hosting for terrible service! You will also have complete control over your website, so it really benefits in the long run.

Be a Part of Null Byte!

Just updated your iPhone to iOS 18? You'll find a ton of hot new features for some of your most-used Apple apps. Dive in and see for yourself:

Image via datacenterknowledge

5 Comments

Ok, very nice how to!
But, Dyndns is not free of charge.

Bummer, they used to have a free service. I have used it several times, but I just checked and sure enough the only thing I could find was fee based.

Oh wow, just last week a made a new account with them, and now they charge?

I did some more digging and found you can still get free service, its just more limited than the free service once was. It is kind of difficult to locate but sign up, activate, then once signed in click sign in again, you should then see a big yellow my account button, click on it and get started.
If you already have a free dyndns account and are using it make sure to check out this page, its about the changes and may affect you. "

"maindyndnssite/services/upgrades/freevspro.html"

Ah, that's good to know, I was just about to post some alternatives. There are many other free dynamic DNS services if people choose to not use DynDNS, just so everyone knows. They are just my favorite.

Share Your Thoughts

  • Hot
  • Latest