http://localhost --> http://spydeeyk.com (in local box)We can do that.., its called Virtual Host.
1. First add a domain name you want to the host list at /etc/hosts. In this case we add virtual host/domain spydeeyk.com for 127.0.0.1
debian:~# vim /etc/hosts2. Make a file called virtual at /etc/apache2/conf.d
127.0.0.1 localhost spydeeyk.com
127.0.1.1 debian.eepis-its.edu debian
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
debian:~#
edit /etc/apache2/conf.d/virtual, write NameVirtualHost * , then save!
3. Copy /etc/apache2/site-available/default to make a backup.
debian:~# cp /etc/apache2/sites-available/default /etc/apache2/sites-available/default.backup4. Edit /etc/apache2/site-available/default.
NameVirtualHost * --> Remove this lineThis my configuration:
<VirtualHost *>
NameServer your-name-server.com --> Add the virtual host name
ServerAdmin webmaster@localhost
DocumentRoot /var/www/ --> Change to whatever..
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/> --> Change to whatever..
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/ --> Block this
</Directory>...
...
Let's check it at browser..<VirtualHost *>
ServerName spydeeyk.com
ServerAdmin webmaster@localhost
DocumentRoot /home/spydeeyk/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/spydeeyk/public_html>
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>
...
...
hahaha,.. hasil jerih payah ngelab pagi-pagi di kampus tertuang semua disini ya,..
ReplyDelete@ littlebro
ReplyDeletehe2.. :D
wah oprek2 dah jadi hobi mas yak ?!? :)
ReplyDeletesalute euy :)
oya kalo di windows bisa nggak ?! localhostnya di ganti juga ?!
@ afwan auliyar
ReplyDeletehe2.. cuma iseng aja koq.. :D
di windows juga bisa koq.. :)