Turn your Ubuntu machine into a webserver
Turning your existing Ubuntu installation really couldn't be simpler, and if you're looking to get into web design or development then this might help.
1. Installing Apache
Apache is webserver software which will allow you to host all your files on your computer, letting you or anyone else view them in a web browser. To install Apache, run this command...
sudo apt-get install apache2
2. Installing php
Assuming you will be wanting to work with php when designing your site, you're also going to have to install php. This step isn't necessary if you're not looking to use php, but I'd recommend doing it anyway, just in case you might need it in the future.
sudo apt-get install php5
3. Accessing your www directory
Your www directory is where you will place all of your webpages and directories. This folder can be accessed by browsing to the following location...
/var/www
4. Opening up port 80 (HTTP) to allow others to view your site
If you would like other people to view your site, you will have to allow incoming requests on your HTTP port. Go into your router's configuration pages, and add an exception to the firewall. The way you do this is different for most routers, so read the manual before doing it.
5. Add your webpages, and view them in your browser
All you need to do now is add pages to your www file. Create a file using a text editor of some kind. My favorite on Linux is Scite, which is very similar to Windows' Notepad++. To install Scite, run the usual command...
sudo apt-get install scite
When you have your index page, browse to your
localhost (
try this if that doesn't work) to view your website!
If you want to show a friend, head over to
WhatsmyIP, and send him/her your IP address. He can then put this in his browser, and view your site.
Enjoy!
Added to CMS by Trx100
Comments
If you don't have a static IP, you can hook it up to dyndns. It runs a daemon in the background that updates a hostname with your current IP. They offer free ones like : ' username.dyndns.org '
Some modems can do it for you.
CMS Status:
EDIT. I used this guide; http://www.bit-tech.net/bits/2007/06/05/build_your_own_server/1, when i built my test server 5 months ago.
I'm glad that you found this guide useful, I don't even remember writing it! Thanks though, I'll add some code boxes in when I'm back at home. I can also update the CMS entry with the same formatting so that it's easier to read on both platforms. Thanks for your feedback