Posted by: Josh | October 6, 2008

There’s no place like localhost: guide to setting up a web server

So you want to set up a web server? Why would you want to do that, you say? It’s great for a number of reasons:

  • hosting your own website, bulletin board, or blog
  • giving people read-only downloads (can be password protected!) to files
  • testing new versions of existing websites before they go live, without requiring an Internet connection, which even includes developing Facebook applications
  • run your own instance of WordPress
  • a great way to familiarize yourself with developing and deploying web applications
I’ll be guiding you to installing a server configured for the PHP Hypertext Processor (PHP). At the end, we can set up a MySQL database to store persistent data. Note that in this tutorial, there will be no direct linkage to this service – it’s up to your application to do this.
For most users, you should be following this basic server setup:
Step 1. Choosing a HTTP Server
Many will argue that a robust, enterprise-level server like Apache is required, but for most home usage purposes, which expect a relatively group of visitors on average hardware, I personally choose Aprelium’s Abyss X1 Server. Versions are available for Windows, Mac and Linux. It is very user friendly – done completely through your web browser, compared to Apache, which requires text-editor modification of xml configuration files.
Install Abyss X1. You may also need to register for a free license key.
Follow the instructions available here to complete the setup.
Step 2. Installing PHP (optional)
PHP is a language designed to integrate well into existing HTML code, allowing dynamic page content. If you don’t need a PHP renderer, you may skip this step. Otherwise, if you’re Windows, follow this instruction, and for everyone else, follow this instruction.
Step 3. Installing MySQL Database (optional)
MySQL is a database, which is useful for keeping data around for longer than the browser session – comments, posts, and accounts can all be stored inside. There are other alternatives, such as Oracle XE and PostgreSQL, but my personal choice is MySQL for its simplicity to use.
All you’ll need is to download and install the MySQL Community Server. I also highly recommend the accompanying MySQL GUI Tools to maintain users and databases.
You can now connect, using http://localhost (unless you changed the HTTP host’s port during setup, default is 80) or your computer’s local IP address. You will probably have to configure the HTTP documents folder to point to the right directory. And so that concludes this tutorial – writing the actual code to link PHP and MySQL, and setting up the MySQL databases will be for another day. We’ll also look in a future post at how to access this web server from anywhere in the world.
In the meantime, here’s some other web server-driven software you may want to consider trying:
  • Joomla - Content Management System for fast configuration and deployment of many types of sites
  • phpBB – PHP bulletin board system
  • phpMyAdmin – manage MySQL databases from your browser
  • WordPress - a blogging tool; currently powering this page!
And here’s some other servers you might want to run:
  • Apache Tomcat – supports Java Enterprise (J2EE) deployment
  • FileZilla FTP Server – file transfer over the regular file transfer protocol (Windows only)
  • OpenSSH - secure protocol allowing remote terminal, X windows, SFTP
  • OpenVPN – keep your traffic secure when connecting from a public wireless location
  • SqueezeCenter – create your own personal Internet radio station while listening and viewing your library from anywhere
Stay tuned! – I’ll be showing you how later to connect to your home, so that you or your visitors can visit your server without memorizing any numbers!
About these ads

Responses

  1. Lookin’ good josho! You’re site is quite impressive!

  2. […] want to follow my initial web server setup guide here if you don’t have Abyss and PHP installed yet.  After downloading and extracting CodeIgniter […]

  3. […] On your home computer, run the server(s) you require. Note that if you have a firewall or router, you may have to allow incoming and outgoing connections to specific ports, such as http (80), ftp (21), ssh (22), vnc (5900). A quick search for the router or firewall you have for “port forwarding” should help you configure this. On many newer routers, it may even have a built-in dynamic dns client, so your computer wouldn’t need to do the updating. I have a previous post on setting up a web server here. […]

  4. You’re so interesting! I do not think I’ve read something like that before.
    So wonderful to discover someone with some unique thoughts on this issue.
    Seriously.. many thanks for starting this up. This site is
    something that is required on the web, someone with a little originality!

  5. Wow, this article is nice, my sister is analyzing
    these kinds of things, thus I am going to tell her.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: