Subdomain wildcard pada Ubuntu dengan bind9 – Part II
| Posted in Programming, ubuntu | Posted on 16-05-2008
1
Menyambung artikel sebelumnya, kali ini kita akan membuat konfigurasi Virtual Host agar setiap request yang masuk langsung diarahkan ke domain utama.
Pertama, edit file konfigurasi default apache: /etc/apache2/sites-available/default
Ubah nilai NameVirtualHost dan VirtualHost menjadi *
$ sudo pico /etc/apache2/sites-available/default
sehingga menjadi:
NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhostDocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</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 warnCustomLog /var/log/apache2/access.log combined
ServerSignature OnAlias /doc/ “/usr/share/doc/”
<Directory “/usr/share/doc/”>
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory></VirtualHost>
Kemudian buat file konfigurasi Virtual Host baru untuk domain kita.
$ sudo pico /etc/apache2/sites-available/situskita.tld
Kita akan menambahkan ServerAlias yang akan mengarahkan semua request *.situskita.tld ke domain utama.Dan arahkan DocumentRoot ke lokasi kerja anda.




