You are on page 1of 4

Oleh Syaiful Watoni, ST.

1
SMK PASUNDAN 2 BANDUNG
TEKNIK KOMPUTER
DAN JARINGAN
Modul 2
WEB SERVER
DI Linux Debian
Oleh Syaiful Watoni, ST. 2
WEB SERVER
Pengertian Webserver
Web Server atau apache merupakan salah satu fasilitas di Linux yang berfungsi
untuk menampilkan halaman web. Webserver atau sering disebut apache di Linux
walaupun sekarang sudah ada apache untuk windows. Dalam konfigurasi webserver ini
kita akan menyertakan bahasa pemograaman PHP dan databasenya MySql agar dapat
support dengan web-web yang akan ditampilkan.
Paket Yang Perlu Diinstall
Apache2
Apache2-doc
Apache2-utilities
Php.x.x
Php-mysql
Mysql-server.x.x
Lalu lakukan penginstalan apabila paket di atas belum terinstal.
#apt-get install apache2
#apt-get install php5
#apt-get install php5-mysql
#apt-get install mysq-server5
Konfigurasi Apache
File untuk konfigurasi apache terletak pad directory /etc/apache2/sites-enabled/,
editlah file 000-default.
#vim /etc/apache2/sites-enabled/000-default
lalu tambahkan file seperti yang di bawah ini.
ServerName www.wanna.co.id
Oleh Syaiful Watoni, ST. 3
ServerName ialah nama server utama dari webserver
VirtualHost 192.168.8.1
VirtualHost ialah IP virtual host yang kita kita gunakan
DocumentRoot /var/www/web
DocumentRoot adalah letak directory web anda
Sehingga isi file-nya seperti di bawah ini.
NameVirtualHost *
<VirtualHost 192.168.10.21 >
ServerAdmin webmaster@localhost
ServerName www.pasundan.org
DocumentRoot /var/www/web
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Ditambahkan apabila direktori web
anda di simpan didalam /var/www
Oleh Syaiful Watoni, ST. 4
Alias /mail "/usr/share/squirrelmail"
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Lalu pada bagian akhir buatlah directory dengan nama web didalam directory /var/www.
Dan buatlah file index.html lalu isi file tersebut dengan biodata anda.
#cd /var/www
#mkdir web
#cd web
#vim index.html
Nama : Nama Anda
Kelas : XI.
Hobi :
Lalu simpan.
Restartlah service apache dengan perintah :
#/etc/init.d/apache2 restart
Apabila berhasil cobalah akses dengan perintah lynx.
#lynx www.pasundan.org
Apabila muncul halaman biodata anda maka web server sudah berhasil!!

You might also like