Servers were always covering major portion of internet. We need servers for everything Gaming, Websites, businesses, Shopping online etc. Most of the people would be considering a server machine as some super machine which it is not. Let’s start with what servers are:
1. They are computers just like we use at our home but with good specifications.
2. They are on high speed internet (Here our home computers differ from servers).
3. They are used for specific reasons could be a gaming server or a web server.
4. The server is optimized to perform services for other computers or clients.
Let’s talk about the web servers, which are used to run a single or several websites on them. First of all you going to choose a server which is on a good internet connection and has a good bandwidth limits too. Now days you can see servers with unlimited bandwidth meters. We are going to use any “nix” operation system since the nix servers are more secured as compared to a windows server and it’s more realizable and fast. There could be many reasons of using nix servers as compared to windows servers. The configuration of a nix (Linux or UNIX) based server are almost same. I am sure many of you must have heard the name of FreeBSD ( www.freebsd.org ) which is a UNIX ( http://en.wikipedia.org/wiki/Unix ) based operating system and is being used for most of the hosting servers around the globe because it is in the most secure form of UNIX. So we know what operating system we are going to install, FreeBSD is a free of cost Operating system so you don’t have to pay big charges like you have to for a windows based server. Many companies which are selling dedicated server machines offer to install nix based operating system on your server for free however there could be some setup costs which vary from provider to provider. After the operating system has been installed on your machine you first of all need an http server. There are few http servers available on the internet and Apache ( http://apache.org/ ) is the most popular http ( http://httpd.apache.org/ ) server around and moreover it’s free of cost. Remember we are going to use all the free of cost and most secured (as updated) software’s to be installed on our server machine. Apache is there made a part of a nix based operating system and most of the nix based OS already have apache server in them but you need to run it. In FreeBSD you can run apache by providing the following command “httpd”. However you need to setup a server name and basic configuration of apache server and the website you are going to run on it. You need to edit the httpd.conf file to run the http process. On my machine the httpd.conf file is located in “/usr/local/etc/apache22/” folder and I am using the latest version of apache that is 2.x.
( http://www.freebsd.org/doc/en/books/handbook/network-apache.html )
You need to install name servers after that to make your website work; however you can check if apache is running on your machine by giving the IP of your server machine in the browser window. Setting up name servers is a core step of a web server because you are going to host websites. Most of the domain selling websites give you option to “Register Name server” chose that option and it will require a name for your name server and an IP address. Let’s say you are going to setup the name servers for genexbs.com, I’d chose ns1.genexbs.com and ns2.genexbs.com (at least two name servers are required) and I forwarded them to the main IP of my machine for example its 1.2.3.4 (just an imaginary IP address not possible in reality) considering 1.2.3.4 is my server machine’s IP which has already running apache on it.
It’s time to get back to our server configurations; we are going to move to the following folder “/etc/namedb” where my named.conf (name server configuration file) file is saved. A basic pattern is already defined in named.conf; you can read it and make changes to named.conf ( http://www.freebsddiary.org/zones.php ). After that named.conf is set to work, we need to move forward to some more steps. Till now our basic website will work. If we upload our website to our server at the specified path it will be appearing on the browser but a web server needs more stuff to be added such as databases and programming languages.
We are going use MySQL ( http://www.mysql.com ) database server on our server machine. Reason of using MySQL is that it’s the most popular database server almost 90% of the people on internet use MySQL database servers. In FreeBSD you can find MySQL database server in ports folder but if you are not familiar with FreeBSD that much it won’t be a problem as well just type “pkg_add –r mysql” and it will automatically install the latest MySQL server on your machine. You need to setup the sysadmin password. The easiest way to do is with the following command
mysqladmin -u root password newpassword
http://www.freebsddiary.org/mysql.php
After that MySQL server Is running you can create databases and work with them but for that you need a programming language. I would recommend PHP ( http://www.php.net/ ), again its free and open source.
You can find PHP again in the ports folder “/usr/ports/lang/” and install it by:
1. cd /usr/ports/lang/phpx (x is the version I recommend 5.x)
2. make config
3. make install
And you are done installing PHP the alternative way to install php is “pkg_add –r php5”
http://www.freebsdmadeeasy.com/tutorials/web-server/install-php-5-for-web-hosting.php
There could be many programming languages you can install depends on your interest and know how about the particular language. I will list a few which are used for web servers.
a. TCL ( www.tcl.tk )
b. Perl ( www.perl.org )
c. Ruby ( www.ruby-lang.org )
d. Python ( www.python.org )
So how we will upload the files on our server? Of course it will require an FTP server.
There are plenty of FTP servers on the web for example:
a. IglooFTP ( http://iglooftp.com )
b. py-curl ( http://pycurl.sourceforge.net/ )
c. cftp ( http://www.cftp.org )
There are so many of them the list goes on. Since we are on FreeBSD you can check them in “/usr/ports/ftp” Folder.
However while we are on FreeBSD we are going to run a process called inetd which will also allow us to connect to FTP server named “ftpd”. The configuration file for inetd is in “/etc/inetd.conf” we will just alter it to run our ftp server. We will add just a single line at the end of inetd.conf file, that is:
ftp stream tcp nowait root /usr/libexec/ftpd ftpd –l
After that you can add a user to the server by using the “adduser” ( http://nixdoc.net/man-pages/FreeBSD/adduser.8.html ) command and check if ftp works with the specified login/password.
That’s all you need to run your own web server as you go through you will be getting expert in all the fields and you can install different supporting tools such as control panels for maintaining your web servers.
Recent comments