Local server is a model of a web server that is limited to a machine. Now what is a Web Server?
Web server can either refer to a hardware or a software that helps to deliver web content to be accessed on the internet. We have to use web servers to host websites or any web applications but it has some other uses as well.┬áThis week at ‘This is How We Do It’, we will be learning how to setup your own local server.

XAMPP is a cross platform free and open source web server package that consists of Apache HTTP server, My SQL Database, and interpreters for scripts written in php and Perl. It also comes with a number of other modules including OpenSSL and phpMyAdmin.

Here are the steps you need to follow to setup the local server on your machine:

  1. Download the latest version of XAMPP for your operating system from sourceforge.net
    (We will be only talking about Linux and Mac OS X. For Windows there is just a .exe package that you need to install like a usual executable file.)
  2. Go to linux shell what we also call it as the terminal.
  3. Login as the system administrator.

    su

  4. Extract the downloaded archive file to /opt

    tar xvfz xampp-linux-1.8.0.tar.gz -C /opt

    And thats it you have successfully installed XAMPP on your operation system.

    To install XAMPP on Mac OS X, just do the following:

    • Open the DMG-Image.
    • Drag’n’Drop the XAMPP folder into your Applications folder.
  5. To start XAMPP, type

    /opt/lampp/lampp start

    On OS X, simply open XAMPP Control and start Apache, MySQL and ProFTPD.

  6. Now visit http://localhost to check whether the installation has been completed or not.
    If yes then you will see a page like this
  7. To stop XAMPP, type

    /opt/lampp/lampp stop

  8. To completely uninstall XAMPP, type

    rm -rf /opt/lampp

Thats all about it. Now you are all set to host local websites and web apps. Mind that the websites created on local server will be limited to your machine only ie: it cannot be accessed via the Internet. For hosting websites that can be accessed via the Internet, you need to buy a web hosting package with all these services installed.