Creating Your Own Webserver and Hosting A Website from Your Linux Box

Download Your Free eBooks NOW - 10 Free Linux eBooks for Administrators

Avishek Kumar

I am a major in computer science, love to research nix. I love to write codes and scripts, review distros, experiment Foss Technologies, write technical articles, Hack, of course Ethically. I am working as System Administrator (nix) for a NGO.

Host Your Own Website at $97 Discount + One Free Domain Using our Promo Code 'Tec97' (Enter this code during Signup) - Signup with DreamHost Now!

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

39 Responses

  1. it was very useful post thnx a lot

  2. Luisa says:

    Hello I am trying to install MySQL and keep getting this error:
    E: Unable to locate package mysql
    I googled it and people said to do the command
    sudo apt-get update
    But still didn’t made it work.

    Thank you.

    • Avishek Kumar says:

      I fear you haven’t installed mysql. have you?

      what is the output of
      $ whereis mysql

    • Avishek Kumar says:

      and if you are unable to install mysql let us know what distribution you are using and its version.

      • Luisa says:

        Thank you very much for your reply!

        I did this in my console:

        root@ns357128:~# whereis mysql
        mysql: /usr/bin/mysql /etc/mysql /usr/bin/X11/mysql /usr/share/man/man1/mysql.1.gz

        Then tried to install like on your tutorial:

        root@ns357128:~# apt-get install mysql mysql-server mysql-client
        Reading package lists… Done
        Building dependency tree
        Reading state information… Done
        E: Unable to locate package mysql

        I installed apache and http://your-ip-address works, so I assume apache is installed.

        Then i tried to install PHP:

        root@ns357128:~# apt-get install php5 libapache2-mod-auth-mysql php5-mysql
        Reading package lists… Done
        Building dependency tree
        Reading state information… Done
        libapache2-mod-auth-mysql is already the newest version.
        php5 is already the newest version.
        php5-mysql is already the newest version.
        0 to upgrade, 0 to newly install, 0 to remove and 42 not to upgrade.

        So I assume PHP is installed, but I did the info.php and placed in the /var/www/html folder, but just appears a blank page so I assume I need mySQL installed?
        I did a better research so I also assume I need to isntall this: but I wanted a confirmation first.

        I am using kimsufi dedicated server OS Ubuntu Server 14.04 “Trusty Tahr” LTS (64bits)

        I am sorry for all the questions but I am really new to this and really want to install a forum in my dedicated server!

        Thank you so much for your patience.

        • Avishek Kumar says:

          send us a mail with your ssh login details or remote desktop login credentials and we will solve this for you.

  3. vishal says:

    Sir , i started to create a website after reading your article , but i’m successful in publishing my website upto my local network . but i want to make it live through out the web ( outside my network also ) . and i think i had static ip too , but i’m unable to make my site live for whole web . please help me

  4. thank you .it is very useful tuturial for installing LAMP Server

  5. Alejandro says:

    Which are the differences between ‘/var/www/html‘ and ‘/var/www‘?
    If i have created an html file with php on it, to be able to execute the file and see it on the browser where should i put my file?

    • Avishek Kumar says:

      Apache’s working directory in some distro is /var/www and in some disto /var/www/html.

      If you have html directory at location /var/www/, then it means your working directory is /var/www/html. Put you php file here. set up the correct file permission. and finally point your browser to

      Replace Php_filename with the name of your PHP file.
      Hope it helps.

  6. Pavan says:

    Hi Avishek,
    It’s nice to have this tutorial. Need information in detail. How can we access this URL using www. Need info about that setup
    Thanks & Regards

  7. Ananth S P says:

    Clear explanation.. just made it simple.. thank u

  8. dario d says:

    This was a great tutorial,thank you.This will help me to build my first web server and hos my websites.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Join Over 62000+ Linux Users
  1. 48100
  2. 2222
  3. 11697
Enter your email to get latest Linux Howto's