Servers

DIY: Install and use a WAMP server for an inexpensive, Windows-based web server

WAMP is very simple to install and can have you serving up robust web sites quickly.

If you live in the world of Windows, you know setting up a web server can not only be a real challenge, but it's also a challenge on the budget. For those who need a web server on a tight budget, and must use a Windows-based server, there is another option - Apache. As you may know, Apache is one of the most widely used web servers since it's robust, easy to administer, and cross platform. It is because of the cross-platform nature of Apache, that allows even Windows users to enjoy an open source, free-of-charge, web server on their proprietary platform.

But, unless you plan on serving up flat-text web pages, a basic Apache server isn't enough. What you really need is the equivalent to a LAMP (Linux Apache MySQL PHP) server. That is where WAMP (Windows Apache MySQL PHP) comes in. WAMP is very simple to install and can have you serving up robust web sites quickly. Let's take a look at how you can get WAMP up and running in no time.

Installing WAMP

I am very happy to say that installing WAMP is just as easy as installing LAMP. Download the file that matches your architecture from the WAMP download site and double-click the downloaded file to initiate the installation. The installation pretty much speaks for itself. Just walk through the wizard and, when it's complete, you'll have a working WAMP server. But you're not completely out of the woods just yet.

Starting and controlling your WAMP server

To initially start your WAMP server click Start > All Programs > WampServer > Start WampServer. Depending upon how your UAC is configured, you might have to OK this action. Once the server has started, you will notice a new icon in your system tray (see Figure A).

Figure A

To make sure your WAMP server is running, and successfully serving up pages, open up your browser and point it to http://localhost. You should then see the WAMP landing page (see Figure B). Out of the box that page will only be available locally. In order to access that server from outside the server you must put the server online. To do that click the WAMP icon in the system tray and then click Put Online.

Figure B

MySQL

One of the issues you will face is having to add databases for those data-base driven web sites. Now the WAMP server does include a full-blown MySQL server, so if you know the command-line syntax you are good to go. This WAMP install also includes phpMyAdmin, which is a solid tool. But for the rest of the world I prefer to recommend a tool with more power and a more user-friendly interface. The tool that I highly recommend you add to this mix (one that will allow you to create and manage your databases on your WAMP server) is the MySQL Workbench. Download and install this tool (installation is a no-brainer.) When it comes to the MySQL admin user password, this will have been configured during the WAMP installation.

After this tool is installed, you can start it by clicking Start > All Programs > MySQL > MySQL Workbench. When the tool starts you will have to configure a connection. You do this by clicking the New Connection link (see Figure C) in the main window.

Figure C

One of the first tasks you will want to do is create a database (schema). To do that click the Create a New Schema button in the SQL Editor window (see Figure D.)

Figure D

Document root

Now that you have your WAMP server up and running, you need to know where to place everything. If you are unfamiliar with the term "document root" that is the Apache term for the root directory where you web served documents exist. In other words, the directory served up when you go to http://ADDRESS_TO_SERVER/. The WAMP server I directed you to uses the C:\wamp\www directory for the document root.

Configuring Apache

The quickest way to configure Apache is to click on the WAMP icon in the system tray and then click Apache > httpd.conf. This will open up the httpd.conf file in Notepad where you can configure nearly every aspect of your Apache server. Of course the configuration of Apache goes beyond the scope of this article, but it's always good to know where to start.

The sky's the limit

You now have a working, powerful, web server up on your Windows machine. This server will be capable of serving up sites based on Drupal, Wordpress, Joomla!, Xoops, and more. All of this without having to spend a penny on software! Now that's how we speak DIY!

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

14 comments
are ziela
are ziela

i want to install koha open source software on wamp server, so how i can install koha onwamp server?

Realvdude
Realvdude

My only concern was that the example makes it seem like the installer assumed no IIS; my guess is that it used http:/locahost only because there was no other web server. FYI - I've been using a free portable app called Server2Go, to run a copy of our company website locally, for developing changes. The only changes to get it to work was for the db configuration files. It supports MySQL and SQLlite.

davisle
davisle

Yes the WIMP (Windows, IIS, MySQL, PHP/Perl) server makes no financial sense. But the WAMP version allows a Windows only shop (with no understanding of how to run/manage Linux) make use of the many great open-source apps that really only use the "AMP" portion. I have also installed WAMP on my Windows desktop as a nice little test-bed.

Maarek
Maarek

Not everyone will go out and buy a server. Sure you can always turn an older computer into a Linux server, but that falls onto the computer savvy person. WAMP is a simple solution to creating and testing Server side Scripting and database management. For most people turning on IIS and configuring it (as mentioned before) is a real hastle, second MS SQL is another system hog, even the express version. The result is a cluttered computer that is possibly share with other household members and having them complain that the system runs slowly and boots longer due to Windows IIS, Windows SQL/Express, Visual Studio, and other management applications. This is why Microsoft has SQL server and Web servers to take the tasks off the computer, but who has the money for that on a tight budget? Personally I do web and database development, so I've built my own Linux Production and test servers. You can use your old Windows 98 or 2000 machine running a non-graphical Linux OS just for testing or even hosting web sites. Back to WAMP... The idea is simple, since you are using PHP and MySQL (look Facebook uses them and the company's worth 40 billion!), you can turn the service on and off at your own convenience with the application running all you have to do is to save your work and refresh the web page for your results, you can even turn on display errors so you don't have to sift through the error logs and see what errors are occurring on the page. The most important piece that WAMP offers is that you can easily make your site public or private preventing any outside intrusion from the network or from the internet(if you were clumsly enough to put the computer on your router's DMZ). In the long run, if you plan on freeing resources and allowing your kids or yourself to play games, graduate from WAMP to LAMP and setup a small linux server. You can build one for under $200 and have it the size of a toaster sitting on the end of your computer desk or just install Linux on an older computer so that you are not fighting over the lone computer containing all of your work. Setting up your own server will allow you to work from any other computer in the house or even internet if you really know how.

geocrasher
geocrasher

I've been doing this stuff for 20 years but I find that knowing what tools are out there can be the hardest part! I like this blog, I've already learned about a few programs that I hadn't heard of before. Having run countless LAMP servers in the past, I got tired of running a VM on my Win7 box just so I could have a web server. This should work a treat!

cbader
cbader

From the first paragraph: If you live in the world of Windows, you know setting up a web server can not only be a real challenge, but it???s also a challenge on the budget. For those who need a web server on a tight budget, and must use a Windows-based server, there is another option - Apache Which leads me to believe that the premise is you have a Windows server and need to set it up as a web server but that is somehow difficult and cost prohibitive which is BS. IIS is part of Windows you just have to install/enable the role, it doesnt require any additional licensing, and to address your point setting up the server as a web server is the goal with this article so the idea of an extra workload is moot. Most of the rest of your points regarding more functions, security, etc are not the point of Jacks article so you are making assumptions.

cbader
cbader

It doesnt cost any additional money to add the IIS role to a Windows machine, so how does this save you money or enable you to set up a web server on a "tight budget"?

HAL 9000
HAL 9000

The original Blog is 2 years old and other than people like me looking for spam that needs deleting you are unlikely to get any response. Col

cerewa
cerewa

I am using XAMPP for Windows (which i suspect is almost exactly the same as WAMP) to develop and test PHP software. Why? because it's easy - do i need another reason? Oh - all this stuff about linux server being hard? Nah, you can easily install linux and then apache-mysql-php on a machine that had windows, but don't bother if WAMP does what you want.

Neon Samurai
Neon Samurai

I'm not seeing how the paragraph you quote equates to re-tasking an existing server. "if you live in a world of Windows" - your work provides windows workstations; setting up a non-windows server or workstation for your use is not going to get approval; maybe you only have a Windows workstation to make use of (all Win Servers already assigned roles in a shop not willing to dirty existing systems for a website pet project).... "setting up a web server can be a challenge, but it's also a challenge on a budget" - not having access to an existing system is a challenge, not having budget to buy another Win Server license is a challenge, we need hardware for that new Server license.. Therea are no other mentions of Windows that could be missinterpreted to mean "use this instead of an existing and available Windows Server". I'd agree that IIS is not at all cost prohibitive if you have an existing license already baught or an existing server which can support IIS hosted websites in addition to it's current services. It just shouldn't be a knee-jerk decison made because the Microsoft option is available; it should be because the Microsoft option is available and makes the most amount of sense to use for the given need.

auogoke
auogoke

A big selling point for tools like WAMP is that you do not have to configure the individual parts to work together. This is true whether the web server is IIS or Apache. WAMP takes care of a lot of things that would give you fits if you tried to configure it yourself. Time is money... Someday, someone will come up with a "free", integrated, ready-to-run, dynamic web development environment "package" the includes IIS, ASP 2, Windows SQL Server 2005/8, etc. Until then, WAMP will save you time, headache, and money.

Neon Samurai
Neon Samurai

- may not be affordable to buy a Win Server license and the desktop IIS (is it still around?) may not be adequate - may not want to add more workload to the existing Windows servers - may require functions not available under IIS - may have security concerns with using IIS - may be using a developer's workstation for local development - may be part of a locally run webapp product; LAMP/WAMP gives you a single bundle to send for install rather than telling your client's IT to first setup an IIS box - WAMP may provide a more standard environment so developed sites can easily be ported to other servers - Apache may be a requirnment of the project - Apache may be the target server for a website that may be hosted locally during development IIS may be the right choice for a project but when it's not, you now have two viable alternatives

Justin James
Justin James

Microsoft released a system called "WebPI" ages ago. It's a simple "app store" style system to get not just the dependencies, but a full install of a variety of free and open source packages. Indeed, most of them uses PHP and MySQL on top of IIS, but some use other techs like SQL Server (usually Express or Compact edition). J.Ja