Would you like a dedicated web server for free? Have an old computer laying around ready that was built after 2000 that can be formatted? Have a cable modem or other high speed internet connection at home? Have an hour? If you answered yes to all these questions, then let me walk you through installing Ubuntu, configuring security and getting your first website up and running.
If you were to rent a dedicated server from a hosting company, it would cost you at least $300 per month, but with this walk-through, it’s free and does the same thing hosting companies offer. In fact, you get Linux, Apache, a high end database (MySQL), and PHP – everything the big guys use.
This is by far the easiest server I have ever installed, it was so easy, I made it hard by thinking I missed something. So, let’s get started installing your server.
First, you need your ip address information. If you are in windows, choose start, run, cmd (or command) and type:
Write that information down, then type:
exit back to Jim’s install please
Second, you need a copy of Ubuntu, so visit http://www.ubuntu.com/GetUbuntu/download and grab your copy and create a CD from the ISO image (just drag the downloaded file onto your cd-rom burning software). Then, take that cd, stick it into the old computer, reboot and the install should start. Note: the install will blow away all the files on the old computer, so make sure you have any data you may need backed up.
You’ll be asked a series of questions and here is how you should answer them.
Install current list of all packages out there…
sudo apt-get update
sudo apt-get install ubuntu-desktop
Reboot when it’s finished and if you are not prompted to reboot, then type ‘reboot’ and press enter.
Now, when the system comes up, you’ll see a desktop. In the top left corner of the screen, you’ll see Applications, click that, select Accessories and then Terminal. You’ll have a terminal window were we can finish installing apps.
You’ll want to browse files as root, so let’s add that to the menu. In your terminal window, type:
sudo gedit /usr/share/applications/Nautilus-root.desktop
now add this:
Name=File Browser (Root)
Comment=Browse the filesystem with the file manager
Exec=gksudo “nautilus –browser %U”
Save the file.
Now refresh the desktop by typing this command in the terminal window:
Now look under Applications, System Tools and you’ll see File Browser (Root). If you right click on that, you can ‘Add this launcher to Desktop’ for easy access.
Install TightVNC (if you want to remotely access your server’s desktop later):
sudo apt-get install tightvncserver
Then go into System, Preferences, Remote Desktop
Go to system, administration, login screen and set your user to automatically log in.
Install Graphical Uncomplicated Firewall:
sudo apt-get install gufw
Install GD (graphics library for thumbnails in WordPress, etc)
sudo apt-get install php5-gd
sudo apt-get install phpmyadmin
Note: I’ve been showing you how to do this from the command line, but if you like, you can install applications by clicking on System, Administration, Synaptic Package Manager. Here, you can search for a package and install it without using the terminal window. You should know how to do both…
I’ll go into later… didn’t have time to finish this part…
————– EXTRA APPLICATIONS YOU CAN INSTALL IF YOU LIKE ————-
Install FTP Server:
sudo apt-get install vsftpd
Now we need to disable anonymous ftp, so click on your file browser and navigate to File System (look for a disk drive icon next to a pencil and click on it), then click on etc, then look for vsftpd.conf and double click on it. Set the following:
local_enable=YES (remove the # from the beginning of the line)
write_enable=YES (remove the # from the beginning of the line)
Then click on Save and close the window.
Enter this into your terminal window – if it’s not open, then open it (application, accessories, terminal):
sudo /etc/init.d/vsftpd restart
Also enter this for to allow read and write for testing server:
sudo chmod 777/var/www
Some great information from Ubuntu here if you want to dive into this more:
Want to add application types for your webserver (not needed by most), then:
Modify the php5.conf to include this:
AddType application/x-httpd-php .php .phtml .php3 .asp
AddType application/x-httpd-php-source .phps
NOTE: I installed a new server and decided to write up a Installing Ubuntu and Security Walkthrough. I’ll reference this as I do other installs to make sure I have not missed anything, but I’d like your help… When you do an install, please take note if I have forgotten something or if you have a better way and then leave a comment for me; I’ll make sure to update the information.