A web server is an information technology that processes requests via HTTP, the basic network protocol used to distribute information on the World Wide Web. The term can refer either to the entire computer system, an appliance, or specifically to the software that accepts and supervises the HTTP requests.
Apache
The Apache HTTP Server, colloquially called Apache (/əˈpætʃiː/ ə-PA-chee), is the world's most used web server software. Originally based on the NCSA HTTPd server, development of Apache began in early 1995 after work on the NCSA code stalled. Apache played a key role in the initial growth of the World Wide Web,[4] quickly overtaking NCSA HTTPd as the dominant HTTP server, and has remained most popular since April 1996. In 2009, it became the first web server software to serve more than 100 million websites.
![]() |
Apache WebServer |
Instalasi Apache Web Server
Untuk melakukan instalasi Apache Web Server berikut merupakan langkah-langkahnya.
Pertama berpindahkan ke directory port Apache Web Server
# cd /usr/ports/www/apache24
Versi terbaru dari Apache Webserver merupakan Apache24, kemudian lakukan installasi dengan menggunakan perintah berikut,
# make install clean
Kemudian tambahkan baris kode pada /etc/rc.conf untuk menjalankan service apache secara otomatis ketika server dinyalakan.
# ee /etc/rc.conf
Tambahkan baris kode berikut,
# apache24_enable="YES"
Kemudian lakukan konfigurasi pada file berikut /usr/local/etc/apache24/httpd.conf
# ee /usr/local/etc/apache24/httpd.conf
Pada baris ke 210 ubah dengan contact alamat email Administrator
ServerAdmin harapan@arc.itb.ac.id
Lalu pada baris ke 221 ubah dengan domain dari server serta port yang digunakan, port untuk web adalah 80
ServerName warok.arc.itb.ac.id:80
Jalankan Apache dengan menggunakan perintah berikut,
# apachectl start
Berikut beberapa hal yang perlu diperhatikan pada Apache
# apachectl start
# apachectl restart
# apachectl graceful
# apachectl stop
# apachectl configtest
Perintah graceful sama dengan perintah untuk restart, perintah configtest untuk mengecek konfigurasi sebelum restart dan start program.
/var/log/messages
/var/log/httpd-error.log
/var/local/www/apache24/data
File messages merupakan file yang berisi pesan-pesan yang dihasilkan Apache Server, sedangkan httpd-error.log berisi pesan-pesan error dari Apache Server. Directory /usr/local/www/apache24/data/ merupakan tempat penyimpanan file data web.
Virtual Hosts
Dalam satu Web Server, dapat menampung beberapa domain dan web. Ini dimungkinkan dengan mengaktifkan fitur virtual Hosts pada Apache. Fitur ini dapat diaktifkan dengan mengedit file httpd.conf.
#ee /usr/local/etc/apache24/httpd.conf
Kemudian pada baris 493 hilangkan tanda komentar pada bagian ini,
Include etc/apache24/extra/httpd-vhosts.conf
Kemudian untuk menambahkan satu hosts pada web server tersebut dapat dilakukan dengan mengedit file
/usr/local/etc/apache24/extra/httpd-vhosts.conf
#ee /usr/local/etc/apache24/extra/httpd-vhosts.conf
Berikut merupakan contoh konfigurasi dari virtual host
<VirtualHost*:80>
ServerAdmin harapan@arc.itb.ac.id
DocumentRoot "/usr/local/www/apache24/warok"
ServerName warok.arc.itb.ac.id
# ServerAlias www.warok.arc.itb.ac.id
ErrorLog "/var/log/warok-error_log"
CustomLog "/var/log/warok-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin harapan@arc.itb.ac.id
DocumentRoot "/usr/local/www/apache24/harapan"
ServerName harapan.arc.itb.ac.id
ErrorLog "/var/log/harapan-error_log"
CustomLog "/var/log/harapan-access_log" common
</VirtualHost>
Sumber
https://en.wikipedia.org/wiki/Apache_HTTP_Server
https://en.wikipedia.org/wiki/Web_server
http://www.freebsdmadeeasy.com/tutorials/web-server/configure-apache-web-server-on-freebsd.php
https://www.digitalocean.com/community/tutorials/how-to-install-an-apache-mysql-and-php-famp-stack-on-freebsd-10-1
0 comments:
Post a Comment