You are on page 1of 6

SERVERS

OPTIMIZE

Set up a basic website with Apache


By Jack Wallen in SMB Technologist, October 7, 2013, 5:00 AM PST

Here are instructions on getting your small business website up and running
with Apache on Linux or Windows.
Apache (http://httpd.apache.org/) is the most widely used web server on the planet -- and with good reason. Not only is
Apache flexible and powerful, but it's also quite easy to get running and to start serving up content.
The idea of using a web server that relies so heavily on the command line and flat text file configuration might be
rather daunting, but it doesn't need to be. I'll walk you through setting up a basic website with the latest iteration of
Apache on Linux or Windows (I'm assuming you have a Linux or Windows machine ready for the task). After you
follow this tutorial, you'll have either a Windows, Apache, MySQL, PHP (WAMP) or a Linux, Apache, MySQL, PHP
(LAMP) server running and a "Hello World" page greeting your users.

WAMP
There are lots of WAMP servers you can install to get your Windows-based Apache server set up, but my favorite is
the

(http://www.wampserver.com/en/)WampServer (http://www.wampserver.com/en/)

package, which installs everything you need

for a web development environment. Here's how to install WampServer.


1. Download the (http://www.wampserver.com/en/)WampServer installer (http://www.wampserver.com/en/).
2. Double-click the installer to start the process.
3. Walk through the user friendly installer wizard (it's a typical Windows application installation).
Once the installation is complete, you should see an entry for WampServer in your Start menu's All Programs
section. In that menu, click the start WampServer entry. When the WampServer starts, left-click the icon in the
System Tray to see the menu (Figure A); from this menu, you can start or stop the services and gain quick access
to the server's configuration files.
Figure A

The WampServer menu.

To get your website set up and running, the most important information you need is:
Document Root: This is where your website files will live. For the WampServer, these files will be in
C:\wamp\www.
index.html: This is the most basic page for your website and should reside within the Document Root.
By default, WampServer will use the index.php file for its default page. Within the C:\wamp\www directory, rename
the index.php file to OLD_index.php. In that same directory, create the index.html file and put this single line in the
document:
<h3>Hello world!</h3>

Save that file and make sure your WampServer is running. Open your web browser and point it to the address of your
WampServer. You should see the text (in bold):
Hello world!
If you do, congrats! Your WampServer is up and running.

Linux
I'll demonstrate how you can have a full-blown LAMP server up and running with just a couple of commands. For

simplicity sake, I'll be demonstrating this on a Ubuntu 13.04 (http://www.ubuntu.com/download/desktop/install-desktop-latest)


server. Here are the installation steps.
1. Open a terminal window.
2. Issue the command sudo apt-get install task sel.
3. Type your sudo password and hit Enter.
4. Accept the installation.
After tasksel completes the installation, go back to the terminal window and do the following:
1. Enter the command sudo task sel.
2. In the resulting window, use the down arrow key and move to LAMP Server (Figure B).
3. Press the Tab key to move down to OK and hit Enter.
4. When prompted, enter the passwords for MySQL.
Figure B

When this installation completes, your LAMP server will be running.

What you need to know:


Document Root: /var/www/
Index: The LAMP defaults to index.html for its main page. You can edit that page directly for your website.
To start and stop Apache, issue these commands: sudo apachectl start or sudo apachectl stop.
Congratulations! You now have a web server. I bet you had no idea setting up Apache for simple web pages was that
easy.
Keep in mind that Apache isn't limited to basic web pages; it's also just as easy to serve up robust and dynamic
sites with this powerhouse server.

Also read: 8 tips to make SMB websites better (http://www.techrepublic.com/blog/web-designer/8-tips-to-make-smb-websites-better/)

Sign up for TechRepublic's SMB newsletter!


Subscribe

About Jack Wallen


Jack Wallen is an award-winning writer for Techrepublic and Linux.com. As an avid promoter/user of
the Linux OS, Jack tries to convert as many users to open source as possible. His current favorite
flavor of Linux is Bodhi Linux (a melding of Ubuntu ...

You May Also Like

about these links

The 10 Ugliest Cars Of


2013

Top 5 Hardest Working


Actors in Hollywood

How Do You Start A Blog


And Make Money

Countries Spending the


Most on Health Care

Bank Rate

Live Wire Review

Affilicoach

247w allst.com

Add your Comment

Editor's Picks

Take advantage of
Google Now on your
Android tablet

The NSA and Big Data

Five free application


launchers to make a
better Windows desktop

Why the CIO isn't


cutting it anymore

White Papers, Webcasts, and Downloads


WHITE PAPERS // FROM CONDUSIV TECHNOLOGIES

Boosting SQL Server Performance in a Virtual Environment


openBench Labs tested V-locity VM to examine how it dramatically increases SQL Server
performance on VMs - all with no additional hardware. Read this report to learn more.

DOWNLOAD NOW
WHITE PAPERS // FROM CLEARSWIFT

The Enemy Within: an emerging threat - Infographic


DOWNLOAD NOW
WHITE PAPERS // FROM EMC

Integrated Computing Platforms - Infrastructure For Tomorrows Data Centre


VIEW THIS NOW
WHITE PAPERS // FROM WEBROOT SOFTWARE

PassMark Ranks Leading Endpoint Protection Products


DOWNLOAD NOW

Don't Miss Our Latest Updates

Editor's Daily Picks

Subscribe

Week in Review

Subscribe

IT Buying Cycle

Learn more

Microsoft's Masters certifications: A bumpy road ahead


Microsoft // October 3, 2013, 5:10 AM PST

The insecurity of private email services


Security // September 12, 2013, 8:00 AM PST

It's Microsoft Patch Tuesday: September 2013


Microsoft // September 10, 2013, 2:12 PM PST

Discover

Investigate

Compare

Resource Center
Useful content from our premier sponsors
See what best practices for SMBs are emerging. Visit ZDNet today!

Justify

Optimize

You might also like