Noam Web Design Blog | Web Design & Development Blog by Certified Experts

Setup a local server on your computer

xampp web designWeb design work should always be done locally. When designing a website, all the development work should be done on a local server installed on your computer. That way, the web design production time is greatly reduced and you can fully test your work locally.

When you are completely done developing your website project, the migration to the live server is seamless. Here are the simple steps to install a local server on your PC to easily design  websites.

This post applies to the installation on Windows 98, NT, 2000, 2003, XP and Vista, of Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.

Install Apache on your computer

  1. First, download XAMPP Windows 1.7.0 Installer
  2. Then run the installer on your computer and make sure that your Windows firewall unblocks Apache.
  3. Run the Apache administrator.
  4. Open your browser and go to http://localhost/ - a screen will appear where you can choose your language.
  5. Go to http://localhost/security/xamppsecurity.php and setup a password (it ill be used for your databases), and click on “Password Changing”.

Congratulations! You are done! Now put your website’s files in a new directory under C:\xampp\htdocs\ (if you installed xampp in C:/xampp). For example: C:\xampp\htdocs\myproject\; and setup your databases using PHPMyAdmin.

Mod Rewrite

To finalize your installation, and make your web design work much easier, go through the following steps to enable Mod Rewrite:

  1. Navigate to C:\xampp\apache\conf\httpd.conf
  2. Open up httpd.conf in notepad and look for this line:
    #LoadModule rewrite_module modules/mod_rewrite.so
  3. Uncomment it so that it reads:
    LoadModule rewrite_module modules/mod_rewrite.so
  4. Next, search for AllowOverride None and change it to AllowOverride All.
  5. Restart Apache

You will now be able to use fancy permalinks without the index.php appendage. Here is how:

Fancy Links

  1. Navigate to C:\Windows\System32\drivers\etc\ and open the host file in a notepad editor. Make sure the following lines are written in the file:
    127.0.0.1 localhost
    ::1 localhost
  2. Now add the following line to access your website locally via the URL myproject.dev (or any other URL you’d like):
    127.0.0.1    myproject.dev
  3. Finally, open the file C:\xampp\apache\conf\extra\httpd-vhosts.conf in a notepad editor, and add the following lines:
    NameVirtualHost *:80
    <VirtualHost *:80>
    DocumentRoot “C:/xampp/htdocs”
    ServerName localhost
    </VirtualHost>
    <VirtualHost *:80>
    ServerName myproject.dev
    ServerAdmin webmaster@localhost
    DocumentRoot “C:\xampp\htdocs\myproject”
    </VirtualHost>

Of course make the necessary adjustments if your directory name and location are different. You can repeat the process to work on as many websites as you’d like - each with its own local URL.

Good luck with your project!

3 Comments

  • Web India

    You have well described the steps for setting a local server network on the system. Local server is very much essential for web designer to get their job perfectly and nicely. Thanks

  • Greg

    Thanks! It’s good to have the entire procedure in one place.

  • web design company,web designer,web design India,website design,web design

    Thanks u r information

Leave a Reply

Submit