/ TI-UNPAM Angkatan18

Selamat Datang di Website Kelas TPLEI-Teknik Informatika UNPAM Angkatan XVIII

Universitas Pamulang

Pages

Tuesday, March 1, 2016

Installing SSH2 extension for PHP on Centos 6



Installing the SSH2 PHP extension on CentOS is actually pretty simple. 


Although it isn’t available as a straight yum install, it boils down to a few short steps.


Firstly, we’re going to install the dependencies:
yum install gcc php-devel php-pear libssh2 libssh2-devel
These will allow us to build the SSH2 extension using pecl.
pecl install -f ssh2

After running that command, it should stop at a line like:
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading ssh2-0.11.3.tgz ...
Starting to download ssh2-0.11.3.tgz (23,062 bytes)
........done: 23,062 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
libssh2 prefix? [autodetect] : 
All you have to do is hit Enter and it should detect the proper path. 


Once the install is completed, you just have to tell PHP to load the extension when it boots.
touch /etc/php.d/ssh2.ini
echo extension=ssh2.so > /etc/php.d/ssh2.ini
Now restart your webserver and test to see if the changes took effect.
/etc/init.d/lighttpd restart
php -m | grep ssh2
You should get a line returned with ‘ssh2′.

Thursday, February 18, 2016

Installing MariaDB with yum


For CentOS, RedHat, and Fedora, it is highly recommended to install from a repository using yum. This page walks you through the simple steps.

Install MariaDB in Linux Adding the MariaDB YUM Repository

We have YUM repositories for several YUM-based Linux distributions. To easily generate the appropriate MariaDB.repo entry for your distribution, use our online repository generator.
We currently have YUM repositories for CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEL 6, RHEL 7, and Fedora 21.
Once you have your MariaDB.repo entry, add it to a file under /etc/yum.repos.d/. (We suggest something like /etc/yum.repos.d/MariaDB.repo.)
An example MariaDB.repo file for CentOS 7 is:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
The example file above includes a gpgkey line to automatically fetch the GPG key we use to sign the repositories. This key enables yum and rpm to verify the integrity of the packages it downloads.
The id of our signing key is 0xcbcb082a1bb943db. The short form of the id is 0x1BB943DB and the full key fingerprint is:
1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB
If you wish to fix the version to an older version, or do a yum downgrade, you can create a yum repo definition with a baseurl set to a specific version. yum clean metadata is needed if you change an existing repo definition:
[mariadb]
name = MariaDB-5.5.39
baseurl=https://downloads.mariadb.com/files/MariaDB/mariadb-5.5.39/yum/rhel6-amd64/
# alternative: baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Installing MariaDB with YUM

With the repo file in place you can now install MariaDB like so:
sudo yum install MariaDB-server MariaDB-client
If you don't have the MariaDB GPG Signing key installed, YUM will prompt you to install it after downloading the packages (but before installing them).
If the server already has the MariaDB-Galera-server package installed, you might need to remove it prior to installing MariaDB-server (with 'sudo yum remove MariaDB-Galera-server'). No databases are removed when the MariaDB-Galera-server rpm package is removed, but as with any upgrade, it is best to have backups.

Installing TokuDB with YUM

Instructions for installing TokuDB are on the How to Enable TokuDB in MariaDB page.

Installing MariaDB Galera Cluster with YUM

MariaDB until 10.0
Galera Cluster is included in the default MariaDB packages from 10.1, so the instructions in this section are only required for MariaDB 10.0 and MariaDB 5.5.
The instructions for installing MariaDB Galera Cluster are virtually the same as for installing MariaDB. The setup of the repo file is the same. The only difference is in the install step. Instead of installing the MariaDB-server package, you install the MariaDB-Galera-server and galera packages, like so:
sudo yum install MariaDB-Galera-server MariaDB-client galera
As with MariaDB-server, if you don't have the MariaDB GPG Signing key installed, YUM will prompt you to install it after downloading the packages (but before installing them).
If the server already has the MariaDB-server package installed, you might need to remove it prior to installing MariaDB-Galera-server (with 'sudo yum remove MariaDB-server'). No databases are removed when the MariaDB-server rpm package is removed, but as with any upgrade, it is best to have backups.
See the Galera section of the Knowledgebase for more information on MariaDB Galera Cluster.

After Installation

After the installation completes, start MariaDB with:
sudo systemctl start mariadb
or if your system is not using systemctl:
sudo /etc/init.d/mysql start

Manually Importing the MariaDB Signing Key

If you like, you can manually install the GPG key using the rpm application like so:
sudo rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

Comments

 

9 months, 1 week ago biggthed
I receive an error when instaling on RHEL6
yum install MariaDB-Galera-server MariaDB-client galera
Error: Package: galera-25.3.9-1.rhel6.el6.x86_64 (mariadb) Requires: nc
I have /usr/bin/nc installed. Is there a reason this is happening?
 

10 months ago martybens
running
yum install MariaDB-Galera-server MariaDB-client galera
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
It's not finding the server package:
No package MariaDB-Galera-server available.
 

10 months ago daniel_bartholomew_g1
I just tried running the yum command and using the MariaDB.repo file you have on a new CentOS 7 VM and it worked. You might try issuing a yum clean all to force yum to redownload the repository metadata.
 

1 year, 4 months ago robertocazzato
With yum priority plug-in activated (is also a good practice), we get:
--> MariaDB-Galera-server-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-client-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-compat-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-devel-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-server-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-shared-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-test-5.5.39-1.el6.x86_64 from mariadb excluded (priority) --> MariaDB-Galera-test-5.5.39-1.el6.x86_64 from mariadb excluded (priority) 8 packages excluded due to repository priority protections
A conflict was found for mysql-libs.x86_64 (5.1.73-3.el6_5), probably resolved forcing removal of this libs, replaced with mariadb version, but can you tell us how correct priority and mysql-libs issue ?
Thank you
 

1 year, 11 months ago pingpong
I installed MariaDB 10 on CentOS 6.5 64 bit.
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
It successfully installed. But the installation process didn't let me configure user name, password, database instance name, and port.
What should I do that after installation? How to check that on CentOS?
Thanks in advance.
 

10 months ago daniel_bartholomew_g1
On yum-based distributions, the only MariaDB user set up is root, and there is no password. You can use the mysql_secure_installation script to set the root password.
For compatibility, the service name and port are by default the same as MySQL: mysql and 3306. Binaries are also named the same: mysqld for the server and mysql for the client.
After installation you can start MariaDB with sudo /etc/init.d/mysql start or sudo service mysql start

Tuesday, February 16, 2016

Install and Configure Piwik Web Analytics Tool for Your Websites


Install and Configure Piwik Web Analytics Tool for Your Websites

Piwik is an open-source and free alternative to Google Analytics tool. It tracks and displays reports about the location of user visits, Where they came from (i.e website, directly, or something else), the visitors browser, screen size, operating system details, what the visitors did on your website, the time of visits and more.
Web-Analytics
In this article, let’s show you how to install Piwik Analytics tool to track our website usage. Here I am using CentOS 6.4 and my system hostname is server.unixmen.com and IP Address is 192.168.1.200/24.
Prerequisites
[root@server ~]# yum install mysql mysql-server httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring wget unzip -y
Start/Restart MySQL and Apache services now:
[root@server ~]# /etc/init.d/mysqld start
[root@server ~]# /etc/init.d/httpd start
[root@server ~]# chkconfig mysqld on
[root@server ~]# chkconfig httpd on
Create MySQL Root user password:
[root@server ~]# /usr/bin/mysql_secure_installation 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] 
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] 
 ... Success!
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] 
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] 
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Create MySQL Database and user for Piwik:
[root@server ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.69 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database piwikdb;
Query OK, 1 row affected (0.02 sec)
mysql> GRANT ALL PRIVILEGES ON piwikdb.* TO 'piwikuser' IDENTIFIED BY 'centos';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
Download Piwik
Download and extract Piwik software using the following commands:
[root@server ~]# wget http://builds.piwik.org/latest.zip
[root@server ~]# unzip latest.zip
Move the extracted Piwik folder to your apache root document folder:
[root@server ~]# mv piwik/ /var/www/html/piwik
Set the write permissions for the following directories:
[root@server ~]# chmod a+w /var/www/html/piwik/tmp/
[root@server ~]# chmod a+w /var/www/html/piwik/config/
Open the Apache default port 80 through your firewall/router:
[root@server html]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
Restart the iptables to save the changes:
[root@server html]# /etc/init.d/iptables restart
Disable SELinux and reboot your system:
[root@server ~]# vi /etc/sysconfig/selinux 
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
Save and Reboot your computer.
Begin Installation
Navigate http://ip-address or domain_name/piwik from your browser. The following screen should appear. Click Next to continue.
Piwik › Installation - Mozilla Firefox_001
Now the installer will do the system check. If everything seems good, click Next to continue.
Piwik › Installation - Mozilla Firefox_002
Enter MySQL Database username, password and database name for Piwik which we have created earlier. Click Next to continue. Make sure that database server column has ‘127.0.0.1’ IP address; otherwise it will give a MySQL connectivity problem.
Piwik › Installation - Mozilla Firefox_004
Click Next.
Piwik › Installation - Mozilla Firefox_005
Enter the super-user (Administrative account) login details and click Next. Here I use admin as username with password centos.
Piwik › Installation - Mozilla Firefox_006
Enter your website name, website URL etc. and then click Next.
Piwik › Installation - Mozilla Firefox_007
Save the Tracking code. You will need this later. Add the Tracking code to your website(s) pages to track website analytics. Also there are some plugins available to integrate your websites to Piwik. Check it out here for more details.
Piwik › Installation - Mozilla Firefox_008
Congratulations! You’re done.
Piwik › Installation - Mozilla Firefox_009
Enter the Administrative username and password to login. In my case its admin and centos.
Piwik › Sign in - Mozilla Firefox_011
This is how your Piwik Dashboard looks.
Unixmen - Piwik › Web Analytics Reports - Mozilla Firefox_012
To add additional websites navigate to ‘All Websites’ page and click on ‘Add a new website’ link.
Unixmen - Piwik › Web Analytics Reports - Mozilla Firefox_013
That’s it.

Wednesday, January 27, 2016

HOW TO DISABLE SELINUX ON CENTOS

I have a lot of programs that crash by Selinux Policy and don’t have that much time to make rules for each program so that it perform properly, above all I want to disable the SELinux without rebooting the server.
Note: But one thing keep in mind that by disabling SELinux you will be removing a security mechanism on your system.
First verify the status of SELinux:
cat /etc/selinux/config

Disable SELinux without rebooting:
Run this command with root privileges:
sudo setenforce 0

Verify the status of SELinux after executing the above command:
sestatus
Disable SELinux permanently:
Edit this file with root privileges:
sudo nano /etc/selinux/config

Replace the line from:
SELINUX=enforcing
To
SELINUX=disabled
Reboot the System!!!

How to Install and Configure Linux NTP Server and Client

NTP stands for Network Time Protocol.
It is used to synchronize the time on your Linux system with a centralized NTP server.
A local NTP server on the network can be synchronized with an external timing source to keep all the servers in your organization in-sync with an accurate time.

I. Configure NTP server

1. Install NTP Server

First, install NTP package on your server using the appropriate package management tool that is available on your Linux distro.
For example, on RedHat or CentOS, use yum to install ntp as shown below:
yum install ntp

2. Setup Restrict values in ntp.conf

Modify the /etc/ntp.conf file to make sure it has the following two restrict lines.
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
The first restrict line allows other clients to query your time server. This restrict line has the following parameters
  • noquery prevents dumping status data from ntpd.
  • notrap prevents control message trap service.
  • nomodify prevents all ntpq queries that attempts to modify the server.
  • nopeer prevents all packets that attempts to establish a peer association.
  • Kod – Kiss-o-death packet is to be sent to reduce unwanted queries
The value -6 in the second line allows forces the DNS resolution to the IPV6 address resolution. For more information on the access parameters list, Please refer to documentation on “man ntp_acc”

3. Allow Only Specific Clients

To only allow machines on your own network to synchronize with your NTP server, add the following restrict line to your /etc/ntp.conf file:
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
If the localhost needs to have the full access to query or modify, add the following line to /etc/ntp.conf
restrict 127.0.0.1

4. Add Local Clock as Backup

Add the local clock to the ntp.conf file so that if the NTP server is disconnected from the internet, NTP server provides time from its local system clock.
server  127.127.1.0 # local clock
fudge   127.127.1.0 stratum 10
In the above line, Stratum is used to synchronize the time with the server based on distance. A stratum-1 time server acts as a primary network time standard. A stratum-2 server is connected to the stratum-1 server over the network. Thus, a stratum-2 server gets its time via NTP packet requests from a stratum-1 server. A stratum-3 server gets its time via NTP packet requests from a stratum-2 server, and so on.
Also stratum 0 devices are always used as reference clock.

5. Setup NTP Log Parameters

Specify the drift file and the log file location in your ntp.conf file
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
driftfile is used to log how far your clock is from what it should be, and slowly ntp should lower this value as time progress.

6. Start the NTP Serrver

After setting up appropriate values in the ntp.conf file, start the ntp service:
service ntpd start

II. Configure NTP Client to Synchronize with NTP Server

7. Modify ntp.conf on NTP Client

This setup should be done on your NTP Client (Not on NTP-server)
To synchronize the time of your local Linux client machine with NTP server, edit the /etc/ntp.conf file on the client side. Here is an example of how the sample entries looks like. In the following example, you are specifying multiple servers to act as time server, which is helpful when one of the timeservers fails.
server 0.rhel.pool.ntp.org iburst 
server 1.rhel.pool.ntp.org iburst 
server 2.rhel.pool.ntp.org iburst 
server 3.rhel.pool.ntp.org iburst
iburst: After every poll, a burst of eight packets is sent instead of one. When the server is not responding, packets are sent 16s interval. When the server responds, packets are sent every 2s.
Edit your NTP.conf to reflect appropriate entries for your own NTP server.
server 19.168.1.1 prefer
prefer: If this option is specified that server is preferred over other servers. A response from the preferred server will be discarded if it differs significantly different from other server’s responses.

8. Start the NTP Daemon

Once the ntp.conf is configured with correct settings, start the ntp daemon.
/etc/init.d/ntp start
You will see the NTP will slowly start to synchronize the time of your linux machine with the NTP Server.

9. Check the NTP Status

Check the status of NTP using the ntpq command. If you get any connection refused errors then the time server is not responding or the NTP daemon/port is not started or listening.
# ntpq -p
     remote            refid      st t when poll reach   delay   offset  jitter
==============================================================================
*elserver1  19.168.1.1       3 u  300 1024  377    1.225   -0.071   4.606

10. Set Local Date and Time

The ntpdate command can be used to set the local date and time by polling the NTP server. Typically, you’ll have to do this only one time.
Your jitter value should be low, else check the drift from the clock in the driftfile. You may also need to change to some other NTP server based on the difference. This command synchronizes the time with your NTP server manually.
ntpdate –u 19.168.1.1
After this initial sync, NTP client will talk to the NTP server on an on-going basis to make sure the local time reflects the accurate time.
You can also use the following command to get the current status of ntpd.
# ntpdc -c sysinfo
system peer:          thegeekstuff.com
system peer mode:     client
leap indicator:       00
stratum:              4
precision:            -23
root distance:        0.00279 s
root dispersion:      0.06271 s
reference ID:         [19.168.1.1]
reference time:       d70bd07b.f4b5cf2b  Wed, Apr 30 2014 15:41:47.955
system flags:         auth monitor ntp kernel stats
jitter:               0.000000 s
stability:            0.000 ppm
broadcastdelay:       0.000000 s
authdelay:            0.000000 s

Wednesday, January 13, 2016

How to Upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7

1. Verify current version of PHP

Type in the following to see the current PHP version:

php -v

Should output something like:

PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Great, now we can move on!

2. Install the Remi and EPEL RPM repositories

If you haven’t already done so, install the Remi and EPEL repositories

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm

Enable the REMI repository globally:

nano /etc/yum.repos.d/remi.repo

Under the section that looks like [remi] make the following changes:

[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Also, under the section that looks like [remi-php55] make the following changes:

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Type CTRL-O to save and CTRL-X to close the editor

3. Upgrade PHP 5.3 to PHP 5.6

Now we can upgrade PHP. Simply type in the following command:

yum -y upgrade php*

Once the update has completed, let’s verify that you have PHP 5.6 installed:

php -v

Should see output similar to the following:

PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

Tuesday, November 24, 2015

PENGERTIAN, FUNGSI DAN CARA KERJA WEB SERVER

Pengertian Web Server


Server web atau yang dalam bahasa inggris disebut web server adalah merupakan perangkat lunak (software) dalam server yang berfungsi untuk menerima permintaan (request) berupa halaman web melalui protokol HTTP dan atau HTTPS dari client yang lebih dikenal dengan nama browser, kemudian mengirimkan kembali (respon) hasil permintaan tersebut ke dalam bentuk halaman-halaman web yang pada umumnya berbentuk dokumen HTML.
Dari pengertian diatas, dapat disimpulkan bahwa web server merupakan pelayan (pemberi layanan) bagi web client (browser) seperti Mozilla, Chrome, Internet Explorer, Opera, Safari dan lain sebagainya, supaya browser dapat menampilkan halaman atau data yang anda minta.

Fungsi Web Server

Fungsi utama dari web server adalah untuk mentransfer atau memindahkan berkas yang diminta oleh pengguna melalui protokol komunikasi tertentu. Oleh karena dalam satu halaman web biasanya terdiri dari berbagai macam jenis berkas seperti gambar, video, teks, audio, file dan lain sebagainya, maka pemanfaatan web server berfungsi juga untuk mentransfer keseluruhan aspek pemberkasan dalam halaman tersebut, termasuk teks, gambar, video, audio, file dan sebagainya.
Pada saat anda ingin mengakses sebuah halaman website, biasanya anda mengetik halaman tersebut di browser seperti mozilla, chrome dan lain-lain. Setelah anda meminta (biasanya dengan menekan enter) untuk dapat mengakses halaman tersebut, browser akan melakukan permintaan ke web server. Disinilah web server berperan, web server akan mencarikan data yang diminta browser, lalu mengirimkan data tersebut ke browser atau menolaknya jika ternyata data yang diminta tidak ditemukan.
Beberapa contoh web server yang paling banyak digunakan diantaranya adalah :
  • Apache
  • Apache Tomcat
  • Microsoft Internet Information Services (IIS)
  • Nginx
  • Lighttpd
  • Litespeed
  • Zeus Web Server
Fitur-fitur standar web server adalah :
  • HTTP
  • Logging
  • Virtual Hosting
  • Pengaturan Bandwidth
  • Otektifikasi
  • Kompresi Konten
  • HTTPS
HTTP (Hypertext Transfer Protocol) adalah protokol yang digunakan oleh web server dan web browser untuk dapat berkomunikasi antara satu sama lain. Sedangkan HTTPS (Hypertext Transfer Protocol Secure) adalah merupakan versi aman (secure) dari HTTP. Biasanya protokol HTTP menggunakan port 80 dan protokol HTTPS menggunakan port 443. Untuk mengenal dan membedakan keduanya, anda bisa lihat pada saat anda mengakses suatu halaman website apakah berwalan http:// atau https://.
Web server biasanya telah dilengkapi pula dengan mesin penerjemah bahasa skrip yang memungkinkan web server dapat menyediakan layanan situs dinamis, yaitu situs yang dapat berinteraksi dengan pengunjung dengan memanfaatkan pustaka tambahan seperti PHP dan ASP.

Cara Kerja Web Server

Sederhananya tugas web server adalah untuk menerima permintaan dari client dan mengirimkan kembali berkas yang diminta oleh client tersebut.
Seperti yang sudah saya informasikan diatas bahwa client yang dimaksud disini adalah komputer desktop yang memiliki atau telah menginstall web browser seperti Chrome, Mozilla, Opera dan lain-lain yang dapat terhubung ke web server melalui jaringan internet atau intranet.
Perangkat lunak web server terdapat pada komputer server, dan di komputer ini pula-lah data-data website tersimpan dengan rapih. Sama halnya dengan komputer client, komputer server juga harus terhubung dengan jaringan internet atau jaringan intranet untuk dapat diakses oleh client.
Pada saat client (browser) meminta data web page kepada server, maka instruksi permintaan data oleh browser tersebut akan dikemas di dalam TCP yang merupakan protokol transport dan dikirim ke alamat yang dalam hal ini merupakan protokol berikutnya yaitu Hyper Text Transfer Protocol (HTTP) dan atau Hyper Text Transfer Protocol Secure (HTTPS). Data yang diminta dari browser ke web server disebut dengan HTTP request yang kemudian akan dicarikan oleh web server di dalam komputer server. Jika ditemukan, data tersebut akan dikemas oleh web server dalam TCP dan dikirim kembali ke browser untuk ditampilkan. Data yang dikirim dari server ke browser dikenal dengan HTTP response. Jika data yang diminta oleh browser tersebut ternyata tidak ditemukan oleh web server, maka web server akan menolak permintaan tersebut dan browser akan menampilkan notifikasi error 404 atau Page Not Found.
Meskipun proses atau cara kerja web server diatas seperti sangat rumit, tapi pada prakteknya proses tersebut berlangsung dengan sangat cepat. Anda bahkan bisa sampai tidak menyadari bahwa pada saat anda meminta suatu halaman web, ternyata hal itu membutuhkan proses yang sangat panjang sampai halaman tersebut dapat anda lihat di browser anda.