Tuesday, August 16, 2016

How to install Web / HTTP Server on Debian 8 using Oracle VirtualBox

-HTTP server or the Web server is a service that provides access to resources by using the HTTP protocol. HTTP resources is usually in the form of an HTML document, equipped also with other beformat documents that support HTML.

There are a wide variety of popular HTTP server, such as Staticlet, Apache, Nginx, IIS, Tomcat, GlassFish, Node, etc. Http server is installed with the operating system is Debian Apache (if the chosen Web Server during installation).

The Apache web server is known as the most popular and gained control of the market, work with enough, can be configured according to needs, supporting more than one site, also developed continuously by the maker. Installation of Apache on Debian is fairly easy, once installed and turned on, then it can serve http requests.

Following the installation process of the Web/HTTP Server:

1. If during the installation of Debian unchecked the option to install the Apache Web Server, then it will already be installed. If not, use apt to install it.

apt-get install apache2

2. To see if Apache is already on the server, try to see if there is a directory/etc/apache2. Then, use wget to try Apache.

wget – O/usr/index.html localhost

3. If the display is obtained like this, then Apache already running smoothly. Means Apache yg is now running on the server (localhost), is already running. To view a web page that just now we download, we can use the command cat.

cat/usr/index.html

4. Contents of index.html we have just open is as above. If want to do changes to the URindex.html file, Apache store files used by the server in the/var/www. directory

There is only a index.html file, now try the Fox content of the file index.html be like below to prove that it really is a file provided by Apache. Then try using wget again to get the contents of a file provided your localhost. If the content of the file obtained by wget contains as above. Mean is correct that index.html file that is provided by the Apache server in the US.
Remember when DNS configuration we have ever made a domain with the name of smkdebian.ga that leads to our own server, try using wget to see if smkdebian.ga is equal to
localhost.

wget – O smkdebian.ga/usr/index2.html

5. contents are same because Surely smkdebian.ga refer to the same as localhost refers, namely to 127.0.0.1.
Because Apache can be configured, we will try to perform configuration changes on Apache. Go into the main folder of Apache which is at/etc/apache2.
We will be adding a subdomain at smkdebian.ga so that he has a sub domain of hello and bye.


6. file a Fox /etc/bind/smkdebian.ga be like this. Don't forget to restart the bind, use the


/etc/init.d/bind9 restart or service bind9 restart


7. After that, we'll create a sub domain in Apache so that the page hello.smkdebian.ga and bye.smkdebian.ga not equally refers to the same page. Apache has the capability to support more than one site. Therefore there is a directory named sites-available and sites-enabled in a
/etc/apache2. Go into the Directory sites-available to make sub domain hello.smkdebian.ga.
Gunakkan an existing template for your primary domain, or localhost, with the default name.


CP default hello.smkdebian.ga


8. After that, so the Fox like this. We add sub domain hello.smkdebian.ga, where the resources that will be provided are in the directory/var/www/hello.smkdebian.ga. Also do the same for the sub domain bye.smkdebian.ga with the resources directory at/var/www/bye.smkdebian.ga.


9. After that, trying to create the directory/var/www/hello.smkdebian.ga and create a page with PHP extensions in that directory, as we will try to use server side language, i.e. php, name
index.php. Fill in file index.php is up to you


10. then, do the same for the sub domain bye.smkdebian.ga, but this time the contents of URindex.php like this. Since we only make these sites available (located in the Directory sites-available) then we must enable these sites by using the default Apache program, namely a2ensite (Apache 2 Enable Site).


11. activate sub domains that we've created, use a2ensite < nama_direktori >


12. The opposite of the a2dissite is, a2ensite is used to disable the active site. Once activated, try using wget to see if results from different hello.smkdebian.ga with bye.smkdebian.ga and smkdebian.ga.


13. use Paint to view the contents of each file.

index.html
index_hello.html


14. The content of index_hello.html is long enough, that contains information about an existing PHP module in Apache.
index_bye.html

Now all sub domains are already correctly configured successfully

No comments:

Post a Comment