We are going to create a server with Ubuntu Server, the difference between a normal Ubuntu and the server is that the latter has no GUI making it lighter. This project is to reuse an old laptop with a processor Intel Core (TM) 2 Duo CPU 2. 26GHz. That we will use for various tests and adding functionalities to our local network.
The first step is to install it properly.
Download Ubuntu Server
To have our Ubuntu just download it from the web page, select the version desired depending on our team, we are going to recycle a laptop several years old and will use the 14.04.1 also we can choose another Linux distribution or a normal Ubuntu if we are going to use the computer for more uses, in our case this is a PC that is dedicated exclusively to server roles in fact it has the screen shattered by what only use it during installation to select the options.
Once downloaded we can burn it to a DVD or use a tool, such as Universal USB Installer, to load it onto a USB, this option for me is recommended because it gives errors, it may be that other users do not have problems, but in case of try and not charging well or not allow to install certain packages forget USB and recorded a DVD.
Install Ubuntu Server
Boot from DVD
First thing to do is to insert the DVD freshly baked in our machine and load from DVD, many computers boot from external drives (USB, DVD…) and if there is no element of boot do it from your own hard drive, in others we must select a key that tends to be Group F and elsewhere if this option is not available, we must enter the BIOS and look for something like "boot selection" and there will be shown the order by that the system begins to search for device must also be started. If this is your case looks for your make and model of computer and how to configure the BIOS.
Username and password: important choose a user and therefore remember the password if you forget it you can not access your team, in the same way that is as safe as possible.
Encrypt personal folder, is best to select no, in this case it is not necessary because on the one hand it consumes resources and on the other if there is a failure not you can dump the data to another hard disk.
Partitioning, we chose guided and choose all the hard disk, the easy way.
Once chosen partitions installation begins and will be shown at a time if we want to install more, we have said no, we will do it later manually.
Finally asks to install the Grup as boot loader, we say Yes and we already have our Ubuntu running.
Once restart the team we will ask the user and the password, the password of the user root (super user) will be the same that for the chosen.
SSH is a protocol for access to a machine from the terminal of another, i.e., will have access total to our server by commands Linux, a time installed not will need to use more the screen.
sudo apt-get install openssh-server
When you install Ubuntu calls us the root password, which you insert when installing, it asks us to confirm the installation give enter and hope.
Know the IP of our server
Now to access we need to know the IP, as many will know there are two types of IP, the internal and the external, your router connects all devices connected to the Internet through the external IP, i.e., it is common for everyone, but then each have an IP that we call the internal. It is a bit like a telephone switchboard number is common for all, but each Department has an extension.
Currently the internal IP is dynamic, meaning that the router it is assigned automatically when you connect by using a protocol called DHCP usually this is comfortable, imagine your mobile phone when you see an open wifi or known that already has saved the password is connected and automatically assigns you an IP. But on a server this is a mistake, because we will have to look for it whenever we want to access it.
By using the following command:
We obtain information from networks, currently we just want the current IP, in our case is 192.168.1.40 will usually be something similar to this, most routers have 192.168.1.1 or 192.168.0.1 for them (of course the router is a machine and need an IP network) and usually up to 192.168.1.30 leave it for static IPs and from there are DHCP i.e., if you connect the laptop to the wifi will give you 30, if then the mobile, the 31…
Because now we touch connect us to the server, if are in a Linux from it own console
SSH IP or domain
In our case
If in Windows we will install the Putty and it will insert the IP and you will enter.
Subsequent mind ask us the user name and password (enter not with root, because right now you usually have it locked for remote access by security)
Change the IP
Now we want a static IP, ensure that you do not have that IP occupied by another machine, since the router options you can see them, if two computers have the same IP will have a conflict and several failures. In our case we use the 192.168.1.3 for the 192.168.1.2 is already occupied.
sudo nano stanza
This indicates that we are going to edit a file with a program called nano to edit a file on the route stanza which is it responsible to say our team of network configuration that will have.
We will seek in the:
iface eth0 inet dhcp
and we replace it with:
iface eth0 inet static address 192.168.1.3 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 Gateway 192.168.1.1
Here that the IP is static and will not change it and will be 192.168.1.3 and other options as the internet access 192.168.1.1 give it the IP of the router.
To exit from the Edit Ctrl + X, we ask if we keep the configuration, is the S or and (depending on the selected language).
To that effect the changes must restart the service.
sudo /etc/init.d/networking restart
Now a connection error will give us our console, because the IP is no longer selected, we changed it
The DNS are servers that associated a url to an IP, if now would like to access to a FTP or do a ping to Google, not could because not have configured the DNS. To do this, simply edit the file.
sudo nano /etc/resolv.conf
It may be the case that the previous configuration is usually deleted when you restart the PC advice is to do the same with this other file:
sudo nano /etc/resolvconf/resolv.conf.d/base
In both previous cases, we add the following, the first is the IP of the router the other two are Google's DNS servers.
nameserver 192.168.1.1 nameserver 18.104.22.168 nameserver 22.214.171.124
The first coincides with the router, that is, because the DNS to explain it crudely van asking each other and the router is typically a DNS that are installed by our Internet service provider, which, if we go into www.drouiz.com router will ask the DNS IP of that url, if they don't know it wanted life to get it , we'll work looking for is information so you can navigate if know you memory addresses. The following two are the servers that Google has DNS and is handy to know it.
Once saved the document, remember Ctrl + X and then save S or and. try the following command.
This is a ping to Google.com website, is like a touch of Facebook, we make a request to the web, and indicates the response time, and is as well until we send you to stop with Ctrl + V.
Update the system and other settings
Finally we will update the system with the following commands
sudo apt-get update sudo apt-get upgrade
Thus we have finished installing our server, in the next post, we'll create a LAMP server (Apache + MySQL + PHP).
Photos and info obtained from: http://www.pacorabadan.com/