Run you own webserver

When you need a server for your website, you can buy web hosting, where you get space for your website at very low cost. You can read more about finding good web hosting here. But if you need more advanced services, a web hosting solution might not be the right choice. In this case, it would be better to run your own webserver.

What do I need to run my own webserver?

  • A computer that can run 24 hours a day.
  • A good bandwidth from your internet provider
  • A static IP address from your internet provider
  • Ubuntu linux server edition or similar server OS

You can use any computer to run your webserver on. That could be an old computer, you don’t use anymore. You have to have the computer running 24 hours a day – at least if you want your website to be available 24 hours a day. Remember that the better the hardware is, the better your webserver will run. Especially it is important that you have enough RAM installed in the computer.

A good bandwidth is important, because this will make it quick to load your website.

You also need a static IP address, so your website can be accesses from the same address. If you choose to buy a domain and point it to your webserver, then it must point to the static IP address.

At last you need some webserver software installed. You could either have a normal desktop operating system (OS) installed and then a webserver software installed (e.g. Apache webserver) or you could have an OS installed that is especially build as a webserver – I recommend Ubuntu linux server edition, that you can download for free here.

Is it safe to run your own webserver?

Yes, it is safe to run your own webserver. Especially if you choose to install the LTS (Long term support) edition of Ubuntu linux server. This gives you 5 years of safety updates.

Your OS is also protected with a password, just as your normal desktop computer. This is enough safety to run your own webserver.

Install Ubuntu linux server

  1. Download Ubuntu linux server for free.
  2. Burn the content to a CD.
  3. Boot from the CD.
  4. Choose english as language.
  5. Choose “Install Ubuntu server”.
  6. Choose timezone and layout of your keyboard.
  7. Choose a host name.
  8. Choose user name and password.
  9. Then you have to choose the partition options. The best option is if you can give the partition the whole disk. Be aware, that this erases your disk!
  10. Choose “Install security updates automatically”, to setup a high security level.
  11. Choose the server you wish to install. You should choose to install the OpenSSH and LAMP (Linux Apache MySQL and PHP) server.
  12. Install GRUB bootloader in your master boot record (unless you have a Windows partition running beside your linux partition).
  13. Restart your machine (remember to remove boot CD).
  14. Your machine will startup a command prompt. Login with your user name and password.
  15. Now you are ready to use your server.

OpenSSH gives you the ability to get access to your webserver from a remote location. The LAMP server is the most fundamental server package you should have, since this gives you the server Apache, the database MySQL and the programming language PHP.

When you are logget into your Ubuntu linux server, you can find your IP address in the field “IP address for eth0”.

ubuntu linux server

Remember that this IP address must be static. You can setup on your router configuration, that your IP address must be static, and not dynamic. Remember also to open port 80 (used by LAMP) and 20 (used by OpenSSH).

If you now open your browser an enter that IP address, you will get the message “It works!”, which is a welcome message from Apache signaling that it has been installed correctly.

Your server files should be located in the Apache folder:

/var/www/

Your webserver can be accessed remotely by SSH. You could e.g. use the SSH-command on a linux machine:

SSH xxx.xxx.x.x

Where xxx.xxx.x.x is your static IP address. From a Windows machine you could e.g. use the program Putty on Windows.

Install other servers

You can also install more servers on your server machine, e.g. a FTP server, that makes it easier to transfer files to your server. You can install a FTP server by using the command:

sudo apt-get install vsftpd

The you can install a FTP program, e.g. Filezilla and point this against your IP address.

 

5 1 vote
Article Rating

Andreas Andersen

Forfatter og grundlægger af IT-blogger.dk, der har blogget om IT-emner siden 2012. Findes på Mastodon på @aphandersen@ansico.dk

Abonner
Giv besked ved
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x