Difference between revisions of "Konfigurasi Sederhana Virtual Host di Apache"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Biasanya akan menarik untuk membuat [[Virtual Host]] sehingga di sebuah mesin ada beberapa mesin / [[Web]] yang berjalan sekaligus. Contoh konfigurasi [[Virtual Host]] adalah | Biasanya akan menarik untuk membuat [[Virtual Host]] sehingga di sebuah mesin ada beberapa mesin / [[Web]] yang berjalan sekaligus. Contoh konfigurasi [[Virtual Host]] adalah | ||
− | # vi /etc/apache2/sites- | + | # vi /etc/apache2/sites-enabled/000-default |
Tambahan entry untuk masing-masing mesin / host kira-kira sebagai berikut | Tambahan entry untuk masing-masing mesin / host kira-kira sebagai berikut | ||
− | <VirtualHost *> | + | NameVirtualHost *:80 |
+ | |||
+ | <VirtualHost *:80> | ||
ServerAdmin webmaster@localhost | ServerAdmin webmaster@localhost | ||
ServerName forum.domainanda.com | ServerName forum.domainanda.com | ||
Line 17: | Line 19: | ||
</VirtualHost> | </VirtualHost> | ||
+ | |||
+ | |||
+ | <VirtualHost *:80> | ||
+ | ServerName www.domain.tld | ||
+ | ServerAlias domain.tld *.domain.tld | ||
+ | DocumentRoot /www/domain | ||
+ | </VirtualHost> | ||
+ | |||
+ | <VirtualHost *:80> | ||
+ | ServerName www.otherdomain.tld | ||
+ | DocumentRoot /www/otherdomain | ||
+ | </VirtualHost> | ||
+ | |||
+ | |||
+ | edit file | ||
+ | |||
+ | # vi /etc/apache2/ports.conf | ||
+ | |||
+ | hapus / remark kalimat | ||
+ | |||
+ | 'NameVirtualHost *:80' | ||
+ | |||
+ | menjadi | ||
+ | |||
+ | # 'NameVirtualHost *:80' | ||
==Referensi== | ==Referensi== | ||
* http://httpd.apache.org/docs/ - dokumentasi apache | * http://httpd.apache.org/docs/ - dokumentasi apache | ||
+ | * http://melengo.wordpress.com/2011/09/12/config-virtual-host-apache-2-2-17-dns-server-on-ubuntu-11-04/ | ||
+ | * http://melengo.wordpress.com/2010/12/10/pro-dns-and-bind-book/ | ||
+ | * http://httpd.apache.org/docs/2.2/vhosts/name-based.html | ||
==Pranala Menarik== | ==Pranala Menarik== |
Latest revision as of 07:35, 23 January 2015
Biasanya akan menarik untuk membuat Virtual Host sehingga di sebuah mesin ada beberapa mesin / Web yang berjalan sekaligus. Contoh konfigurasi Virtual Host adalah
# vi /etc/apache2/sites-enabled/000-default
Tambahan entry untuk masing-masing mesin / host kira-kira sebagai berikut
NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName forum.domainanda.com DocumentRoot /var/www/forum <Directory /var/www/forum/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost>
<VirtualHost *:80> ServerName www.domain.tld ServerAlias domain.tld *.domain.tld DocumentRoot /www/domain </VirtualHost>
<VirtualHost *:80> ServerName www.otherdomain.tld DocumentRoot /www/otherdomain </VirtualHost>
edit file
# vi /etc/apache2/ports.conf
hapus / remark kalimat
'NameVirtualHost *:80'
menjadi
# 'NameVirtualHost *:80'
Referensi
- http://httpd.apache.org/docs/ - dokumentasi apache
- http://melengo.wordpress.com/2011/09/12/config-virtual-host-apache-2-2-17-dns-server-on-ubuntu-11-04/
- http://melengo.wordpress.com/2010/12/10/pro-dns-and-bind-book/
- http://httpd.apache.org/docs/2.2/vhosts/name-based.html