Installing a web server, and why you would want to by Huw

Apache featherUsing an Apache server as a base, the possibilities are (nearly) endless. It makes file sharing incredibly easy, it allows you to host a small website on your own computer and it allows you to easily display and share your photos with friends with no wait while they upload or storage limits. And all this with no cost except your bandwidth (internet connection) and your electricity, both of which you’re paying anyway!

So, first things first. What does Wamp stand for? It stands for Windows Apache MySQL and PHP, and is the fundamental open source base that many thousands of websites are running on. This is good for two reasons; firstly, it means the whole setup is completely free, in both senses of the word, and secondly that there are thousands applications and systems available to run on the platform, from Wordpress to Drupal to Gallery2. Don’t worry if you haven’t heard of those programs, or if you’re slightly intimidated by the reference to odd acronyms and the word ‘server’.

Well, hopefully I’ve persuaded you to give this ago. If I have, then you’ll need to visit ApacheFriends.org and download the latest version of their ‘Xampp’ server for Windows. You want the top version – the Installer. Xampp is simply a package of the three different programs (Apache, MySQL and PHP) which you would normally have to download separately, and then configure them so that they could talk to each other. Xampp makes it much quicker to get a server up and running, with no difficulties in making it all work, and it also includes some other useful programs, such as an FTP server.

Once you’ve downloaded Xampp, all you have to do is open up the installer and click through the options, choosing where you want to install it. I suggest that you let it install in the path

C:/Program Files/Xampp.

For the purposes of this tutorial I’ll assume that’s where you’ve installed it. All the default options for the installation will work fine.

If you are running a firewall program, you will now have to open some ports to make it work. Don’t worry, this isn’t as complicated as it sounds. All you are doing is allowing certain types of traffic from the internet to reach your computer, and vice versa. If you are using the built-in Windows Firewall, then you can do this very simply by opening Windows Security Center in the Control Panel, and then scrolling down, choosing to manage security settings for Windows Firewall. Then click on the exceptions tab, and then on the ‘Add port’ button. You then need to add the following ports:

80
3306
21

For other programs such as Norton or Zone Alarm it will either be very easy to work out from the above instructions, or you will be able to find it in the help for your program.

If you are using a home router you will also need to allow access through those ports to your computer. This can be done through your router’s interface. Check individual documentation to do it, but on my router, I looked in

Firewall >> Virtual Servers

and then added the above ports as the external ports, forwarding them to the same ports on my computer’s internal IP address. [I have a 3com OfficeConnect router]. Your router’s online help or PortForward.com will definitely be able to help you achieve this.

Once you have done this, you are almost ready to go. One more thing – browse to

C:/Program Files/Xampp/htdocs/

In Windows Explorer, and make a shortcut to that folder on your desktop. Now, when you want to make files available on your webserver, all you have to do is copy them to the directory above and they are available. If you want to check that it worked, type ‘http://localhost’ into your browser address bar. For other people to access it, all they need to do is type in your IP address (find out what it is here). This will probably change regularly (it is called a ‘dynamic IP address), and so if you follow the instructions on DynDNS.org you will be able to set up a fixed address.

Enjoy your new webserver! Next week I’ll post about installing some cool applications on your webserver that let you do more exciting things than just serving up web pages and files.

Posted in Uncategorized. July 5, 2006

32 Comments »

  1. That’s a nice tutorial there, may i also reccomend bizzar (http://bizzarserver.com/ ) as an alternative to xampp, to install you pretty much follow the same proccess, but hosted files are stored in c:/web/htdocs/ and it comes preinstalled with phpmyadmin, i prefer that over xampp because i have found it easier to install and use

    Comment by Lee — July 5, 2006 @ 8:16 pm
  2. [...] Great article coming up. For those of you unwilling to jump to Linux just yet (wait, I’m supposed to like all the platforms aren’t I?), there is a great tutorial at Gizbuzz explaining how to get a Windows/Apache/MySQL/PHP server up and running. [...]

  3. [...] read more | digg story [...]

  4. [...] http://gizbuzz.co.uk/?p=260 [...]

  5. [...] A great tutorial on installing an Apache (and all the trimmings) webserver on your own computer, and what benefits it brings. It’s designed for people who wouldn’t normally consider doing it, and wouldn’t know where to start - It’s great for Digg’s new non-geek audience! read more | digg story [...]

  6. Other possible alternatives to Xampp are EasyPHP and Wampserver, both with phpMyAdmin and a web-based administration included. Wampserver even allows you to install PHP5 and PHP4 alongside each other and to add Perl to the mix for good measure.

    All in all, it comes down to a matter of taste. Thanks for your nice tutorial!

    Comment by Serge K. Keller — July 6, 2006 @ 9:21 pm
  7. wow… that is so simple to do…. great info. I have to try it.

    Comment by Jessica — July 6, 2006 @ 11:03 pm
  8. This is a good Overview - tutorial -

    but could you make it ONE LARGE Tutorial that includes Everything as opposed to several small er topics?

    Comment by Search Engines WB — July 6, 2006 @ 11:12 pm
  9. There’s another tutorial at http://apacheguide.org/ (to answer WB’s question)

    Comment by Jeff — July 6, 2006 @ 11:40 pm
  10. “So, first things first. What does Wamp stand for? It stands for Windows Apache MySQL and PHP, and is the fundamental open source base that many thousands of websites are running on. This is good for two reasons; firstly, it means the whole setup is completely free, in both senses of the word,…”

    Last I checked, Microsoft Windows was not Open Source, nor completely free in any sense of the word.

    Comment by passerby — July 7, 2006 @ 12:01 am
  11. What if I dont have static ip? Can I still host a website?

    Comment by needhelp — July 7, 2006 @ 12:17 am
  12. [...] From GIZBUZZ: [...]

  13. needhelp: What if I dont have static ip? Can I still host a website?

    Certainly. Like the article suggests, you can create a DynamicDNS hostname at DynDNS.org, like ‘mysite.dyndns.org’ or ‘mysite.homeip.net’, which you can keep up-to-date with your dynamic IP address using an update client.

    http://www.dyndns.com/+dyndns/add.html
    http://www.dyndns.com/support/clients/

    Visitors can then use the hostname to access your webserver without needing to remember the ever-changing IP address. The best part is that the service is completely free.

    Comment by Jason — July 7, 2006 @ 1:50 am
  14. needhelp - yes you can. As I said in the tutorial, check out DynDNS.org for instructions.

    Comment by Huw — July 7, 2006 @ 8:58 am
  15. Wicked tutorial. It helped me a lot!

    Comment by web design uk — July 7, 2006 @ 10:11 am
  16. NeedHelp - Did you read the article? I thought the dymanic ip address bit was crystal clear. BTW nice article. A good list of resources too.

    Comment by Sour Puss — July 7, 2006 @ 2:37 pm
  17. I already had xampp installed for running some PHP scripts, so I thought I\’d go ahead and follow the rest of your tutorial to enable incoming Web service. I did everything as well as I could, but when I browse to the URL I got from dyndns.com (mysubdomain.selfip.com), I got a request for a username/password, and it turned out that it was a request from the router. Providing its un/pw brought up the router\’s admin screens, rather than the index.html in htdocs.

    A deviation from your procedure was needed at the router, since it didn\’t match yours. Intstead of enabling ports, I enabled for Virtual Private Networking the following: IPSec Passthrough, PPTP Passthrough, and L2TP Passthrough. This router software (Talisman from Sveasoft) also had a DDNS page where I entered the data from dyndns.com.

    Any idea why the browse didn\’t pass through the router and fetch index.html?

    Comment by Lane Lester — July 7, 2006 @ 2:53 pm
  18. I expect that your router simply serves up its admin screen whatever port is requested, unless that port has already been forwarded to somewhere on your network.

    Comment by Huw — July 7, 2006 @ 3:17 pm
  19. Is there an equally straightforward explanation of how to secure this webserver? I can follow these directions, but I’m not sure whether I’m just creating easy prey for a hacker. Any thoughts?

    Comment by Lorenzo — July 7, 2006 @ 7:51 pm
  20. Lane Lester: I got a request for a username/password, and it turned out that it was a request from the router.

    This is a loopback connection error. When you try to connect to your own site using the DDNS host, your router thinks you’re asking for the web interface. You can get around this by modifying your HOSTS file.

    DynDNS has an article about this here:
    http://www.dyndns.com/support/kb/archives/loopback_connections.html

    I had this problem with an older router, it really confused me until I looked it up. It’s a local error, though, so visitors outside the network don’t run into any problems accessing your site.

    Comment by Jason — July 7, 2006 @ 10:17 pm
  21. [...] Gizbuzz » Installing a web server, and why you would want to (tags: Apache linux) [...]

  22. Here are the directions for Macintosh: 

    0.) First get Apache. Nothing to do here. It is already pre-installed in OS X.

    1.) click the “[] Personal Web Sharing” checkbox on the “Sharing” panel of “System Preferences”.

    2.) There is no step 2. You are already done. Step 1 even configured the firewall correctly for you.

    The main web site for the machine is in /Library/WebServer/Documents/ but by default /etc/httpd/ is configured so each user gets their own, in a ~user URL.

    Comment by David Phillip Oster — July 8, 2006 @ 6:03 am
  23. [...] Gizbuzz » Installing a web server, and why you would want to (tags: windowsxp server) [...]

  24. [...] Installing a web server, and why you would want to [...]

    Pingback by WebDes.Blog » Daily Resource - 10th July — July 10, 2006 @ 10:44 am
  25. Argh!!!

    I can’t get this to work! I fixed the loopback problem.

    I’m pretty sure I opend up the correct ports on my router and the firewall that comes with XP.

    I set up the dns so that I can have a fixed address.

    I just can’t get to my site from another computer on a different network!
    Everything works fine when I go to my site on my own computer on my own network.

    Any suggestions?

    Comment by Tempe Guy — July 10, 2006 @ 11:47 pm

  26. Comment by Huw — July 11, 2006 @ 6:52 pm
  27. Google will turn up loads of tutorials to solve your problems. Unfortunately I don’t have time to help everyone!

    Comment by Huw — July 11, 2006 @ 6:53 pm
  28. Here’s the bit that confuses me… According to the directions on portforward.com, you need to set up a static ip BEFORE you can set up port forwarding on your router for Apache. I followed the directions in their tutorial: http://www.portforward.com/networking/staticip. Is this not a true static ip? Do I still need to use DynDNS?

    Comment by espot — July 11, 2006 @ 7:46 pm
  29. Sorry, the link for that static ip tutorial is:

    http://www.portforward.com/networking/static-xp.htm

    Comment by espot — July 11, 2006 @ 7:49 pm
  30. [...] read more | digg story [...]

  31. [...] distributions too. By the way, if you have a Windows machine that you want to do this on, check out this tutorial on our sister site GizBuzz instead for a nice easy WAMP [...]

  32. [...] read more | digg story [...]

Subscribe to comment feed

Leave a comment