Multiple local websites in ubuntu LAMP

Just got a way to create multiple local websites in ubuntu which has LAMP installed. This information will be helpful when many computers connected with ubuntu server in LAN network(may be office or home local network).

Generally we had to disable default site to enable new site as per the documentation given by ubuntu community, so only one site can be enabled at a time.

Here's is the organized way to have multiple sites enabled at a time.

Assume i am going to create a local site called colorpicker.local.

Create directories like /home/[user]/websites/colorpicker/public_html

Go to /etc/apache2/sites-available

cd /etc/apache2/sites-available

Copy the default website and name it as colorpicker

cp default colorpicker

Edit the colorpicker site configuration file

gedit colorpicker

Change it as below

<VirtualHost *>
              DocumentRoot /home/[user]/websites/colorpicker/public_html/
              ServerName colorpicker.local

              <Directory /home/kbala/websites/colorpicker/public_html/>
                           Options Indexes FollowSymLinks MultiViews +Includes
                           AllowOverride All
                           Order allow,deny
                           allow from all
             </Directory>
</VirtualHost>

And now, we have to enable the site by this command

a2ensite colorpicker

Finaly, we have to add this site into the hosts file

gedit /etc/hosts

add below line at the end of the file

127.0.0.1         colorpicker.local

Now, try http://colorpicker.local in the browser, it will work, if things are correct.

OK, If you are in LAN network connected with few computers, you have to set the site info in the hosts file of the computer.

For windows, edit the hosts file which is located in c:\windows\system32\drives\etc\hosts

add the below line at the end of the file

[your ubuntu server LAN ip]       colorpicker.local

For linux, edit the file from /etc/hosts

add the below line at the end of the file

[your ubuntu server LAN ip]       colorpicker.local

That's all, now you have configured a new site and its visible to all the computer in the LAN. Please follow the same steps to create another new site , like wise you can have multiple local sites running in the local server at a time.

And if you are giving the sharing option to websites folder accessible to all the computer, then people can upload the web content directly, and can check the site their itself, yep, Enjoy!

Be Sociable, Share!

11 Responses to “Multiple local websites in ubuntu LAMP”

  1. Adam says:

    Thanks, This was very helpful for me.

    I knew it was relatively easy to do but could not work it out myself, now my business VOIP Admin/Intranet sites are all neat and tidy 🙂

  2. Melvina Sung says:

    Möchte mir eine neue Couch kaufen, weils meine alte einfach nicht mehr lange macht. Meine 2 Katzen machen immer das Wohnzimmer und natürlich auch die Couch unsicher, das hinterlässt leider deutliche Spuren. Nun möchte ich das meine neue Couch nicht nach 1 Monat aussieht, als wär sie schon 1 Jahr alt und bin auf der suche nach einer Couch mit einem strapazierfähigen Stoffbezug. Kann mir da bitte jemand weiterhelfen, da ich nicht weiß welche Materialien da gut geeignet sind?

  3. Ned Stough says:

    Sick of obtaining low numbers of useless visitors to your site? Well i want to share with you a fresh underground tactic that makes me personally $900 on a daily basis on 100% AUTOPILOT. I possibly could be here all day and going into detail but why dont you merely check their website out? There is a great video that explains everything. So if your seriously interested in making hassle-free hard cash this is the website for you. Auto Traffic Avalanche

  4. Krystina Liv says:

    Sick and tired of obtaining low numbers of useless traffic to your site? Well i wish to share with you a new underground tactic that makes me personally $900 per day on 100% AUTOPILOT. I really could be here all day and going into detail but why dont you just check their site out? There is a excellent video that explains everything. So if your serious about producing simple hard cash this is the site for you. Auto Traffic Avalanche

  5. Ich kann sagen, dass das ziemlich gut ist. Dennoch muß Jeder es für zu seinem eigenen überlegen was er oder sie macht.

  6. ensteersear says:

    “Dennoch mu? Jeder es fur zu seinem eigenen uberlegen was er oder sie macht.”
    You can read more?

  7. Thanks a ton for helping to open up my mind.

  8. These kind of post are always inspiring and I prefer to read quality content so I happy to come across many superior point here in the post, writing is simply great, thank you for the post

  9. Ich frag mich oft wie Menschen in nem 0815 Wohnung einziehen kann. Schön hausen heißt für mich, dass man niemals Standard Hausbedarf hat sondern den Hausbedarf so einrichten wies jemand passt! Denkt ihr auch so?

  10. Webkatalog says:

    linknetwork say´s thank you for this post

Leave a Reply


Copyright © 2008-2010 K BalaSubramanian | Credits