How to set up a Linux Web Server


This tutorial will show you how to set up a basic web server. For this tutorial I have used Linux Mint 9 but the steps work the same on any Linux distribution

Ok first thing to do is give your server a static ip address (refer to earlier blog here for details).  Once done it is time to download the software you will need.  Open up a terminal and install the following packages:

apache2 php5-mysql libapache2-mod-php5 mysql-server

During the install process MySQL will ask you for a root password.  Make this something complex but do not forget it!!!

Once installed open up a web browser and type http://your-server-address (e.g http://192.168.1.3) and you will see the message IT WORKS! This means that you have a working web server.

Now it is time to add some content to your server.  All apache servers store their web data at /var/www but as default you can not write to this folder.  Open up a terminal and type:

sudo nautilus

Enter your password when prompted.  Navigate to /var and right click on www.  Then go to properties.  Add yourself as either the owner or group and give yourself “create and delete files folder access”.

Next thing to do is to download some ftp software.  Personally I recommend Filezilla. Open up a terminal and type:

sudo apt-get install filezilla

Once installed connect to your existing web server and transfer your files into /var/www.

Congratulations!! Your website is now hosted on your new server but it will not yet be visible from the internet.  Most networks sit behind a router which acts as a firewall, so to make your website visible you will need to forward http packets from your router to your server by opening up port 80 and redirecting it to your servers new ip address.Portforward.com is a good starting point to understand port forwarding.

You will also need to speak to your ISP about getting a static ip address for your router. Without this you will not be able to access your site everytime your ip address changes.

And that is it!! You now have a basic web server from which to host your own website.

About the Author

Hi I am Chris the owner of ComTech. I provide IT Support, Laptop repairs and Computer repairs to both personal and business clients in and around Stirling. For a list of what I can offer you why not visit my website www.comtech247.net where you will find my blog, testimonials, services and much more.  Start supporting a local business today so I can start supporting you.

If you found this blog useful then why not sign up to my RSS Feed for news, tutorials, views and general techie stuff!!

 

 

 

 

This entry was posted in Blog and tagged apache, computer repair, how to, IT Support, laptop repairs, linux, server, stirling, web. Bookmark the permalink.

2 Responses to How to set up a Linux Web Server

  1. Hilmar says:

    I just couldn’t go away your website before suggesting that I really enjoyed the usual info a person provide to your visitors? Is going to be again regularly in order to check up on new posts

  2. Marcela says:

    Big enthusiast of the site, loads of your blog posts have seriously helped me out. Looking towards updates!

Leave a Reply

Your email address will not be published.

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>

Current month ye@r day *