Hosting your own website doesn’t have to cost a monthly fee or require a lot of technical knowledge to setup. If you just need to host a small website that will only have a few visitors, you can turn your Windows PC into a WAMP server.
Note: while hosting your own website on your local computer is a lot of fun, if you want a website that people can actually access, you might want to get your own web hosting plan somewhere. Bluehost is offering unlimited web hosting for $3.95 per month, with full support for PHP and MySQL. It’s definitely an easy way to get started with a website, and they have simple 1-click installers to get you started with popular software like WordPress and others.
If you do host your own local site that you want people to access, you’re going to need to open up your firewall to your home computer, and that means you’re potentially opening up some security holes. It’s definitely worth thinking about getting a cheap hosting plan elsewhere, like Bluehost or Hostgator.
If you just want a local development server, then keep reading.
What is “WAMP”?
WAMP is an acronym that stands for “Windows, Apache, MySQL, and PHP”. When you download a WAMP, you are just downloading a program that installs three different things. WAMPs are convenient because they allow you to download and install all of the packages you need for hosting dynamic web content in one fell swoop. Otherwise, you’d have to download the three packages separately.
Windows – The “W” in WAMP is just there to specify that the program is compatible with Windows operating systems.
Apache – This is the program that is used to actually host your website. With it alone, you can host HTML files and other static web content.
MySQL – This provides a database for your web content. A lot of dynamic web pages need to store data (i.e. usernames and password for web accounts), which is where MySQL comes in.
PHP – The most popular language for writing dynamic web content – by far. WordPress, Facebook, Joomla, and many other websites and content management systems utilize PHP. If you plan to host anything more than static web pages, PHP will be an essential companion.
If you’re running Linux instead of Windows, you’ll need to install a LAMP. It’s also possible to host a website on Windows using IIS so you don’t have to install any third party software. Going the IIS route isn’t recommended for most purposes and it’s much more of a process to support dynamic web content – so stick with WAMP unless you have a unique circumstance requiring IIS.
Before we proceed, please understand that hosting a website on an everyday PC and a consumer-grade internet connection is not recommended for anything beyond testing purposes and/or hosting a small website for a few visitors. Remember, the next time Windows Update needs to restart your system, your website goes down along with it – not an ideal situation for a serious website.
There are a lot of WAMP programs available, but we’ll be working with WampServer. Head over to their website and download the latest version of their program, then start the installation.
The installation prompts are self-explanatory; just keep everything at its default value and keep clicking Next. You can just click Open on this prompt to have WampServer use your default browser whenever you choose to look at your website:
Be sure to also add the security exception for Apache in Windows Firewall:
When the installation completes, check the box that says “Start WampServer 2 now” before hitting Finish. You should see the program running in your notification area.
Left click on the icon and hit “Localhost” at the top of the selection menu to open your website.
The default page currently just shows us a quick information page so we can confirm that all components are working properly. If you see this screen, then you’ve successfully installed a WAMP server.
Some Quick Troubleshooting
We did several test installs of this program and found that a few packages from Microsoft are absolutely essential to get WampServer working properly. If you’ve ran into any trouble up to this point, ensure that you have the following updates installed, uninstall WampServer, restart your PC, and reinstall WampServer.
WAMP 32-bit required packages:
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)
Microsoft Visual C++ 2012 (select vcredist_x86.exe)
WAMP 64-bit required packages:
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) (that’s not a typo – you need the x86 package)
Microsoft Visual C++ 2008 Redistributable Package (x64)
Microsoft Visual C++ 2010 SP1 Redistributable Package (x64)
Microsoft Visual C++ 2012 (select vcredist_x64.exe)
Further WAMP Configuration
To change the page(s) that your web server displays, open the www directory by left clicking on the WAMP icon in the notification area.
The folder that opens is where you need to put any files that you’d like to host on your website. Anything from WordPress installation files to static HTML files can be placed in here, and the changes will be reflected on your website at the same time (just click refresh).
Let’s look at a quick example for how you would drop content into that folder for it to be served up on your website. You can use a web development program or something as simple as Notepad to create a basic PHP page and put it on your website.
The following code will be a good start:
<?php echo '<p>Hello World</p>'; ?>
Paste that code into Notepad and save your file as index.php inside of C:\wamp\www
Now return to your website (or hit refresh [F5] if you already have it opened) and you’ll see the page you just created.
By default, your website is currently only accessible by the computer that WampServer is installed on. That’s perfect for anyone who’s just using their WAMP server for testing or development purposes, but to make your website accessible to the rest of the world, click on the WampServer icon and click “Put Online”.
By default, the Apache configuration file is set to deny incoming connections from everyone except for the localhost, so you’ll also have to change two lines of code so other devices don’t see a “403 Forbidden” error whenever they try to load your site. Access httpd.conf (Apache configuration file) by left-clicking the WampServer menu and looking under the Apache folder.
Scroll down until you see some code that says:
Deny from all
Delete this code and replace it with:
Allow from all
Save the changes to the httpd.conf and restart all services.
Your site should now be accessible from the World Wide Web. If not, ensure that you have forwarded port 80 to your computer on your router.