Setting Virtual Host pada Ubuntu 10.10
Screenshot of Ubuntu version 10.10 (Photo credit: Wikipedia) |
Saat ini saya akan memberikan beberapa langkah - langkah agar dapat setting virtual host pada ubuntu 10.10.
Langkah - langkahnya sebagai berikut:
1. Buat file yang berhubungan dengan project Anda tanpa ekstensi file di /etc/apache2/sites-available.
Misalnya project.
2. Di dalam file project di dalamnya tuliskan,
<VirtualHost *:80>3. Masuk ke terminal dan ketikkan:
# name server admin
ServerAdmin webmaster@testing_project.localhost
# server name yang akan di tulis di url browser [http://testing_project.localhost/]
ServerName testing_project.localhost
# Dokumen root proyek
DocumentRoot /home/deploy_user/project
# log error, nama terserah
ErrorLog /var/log/apache2/testing_project-error.log
LogLevel warn
# log custom nama terserah
CustomLog /var/log/apache2/testing_project-access.log combined
# path direktori
<Directory "/home/deploy_user/project">
Options +FollowSymLinks -Indexes
AllowOverride All
order allow,deny
allow from all
<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
<IfModule mod_php4.c>
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>
</Directory>
</VirtualHost>
sudo a2ensite project
4. Kemudian Edit file hosts menggunakan perintah: sudo gedit /etc/hosts
# tambahkan di file tersebut
127.0.0.1 project.localhost
5. Kemudian restart server apache
sudo /etc/init.d/apache2 restart
6. Kemudian masuk ke browser lalu ketikkan http://project.localhost.
Semoga article ini dapat membantu.
terimakasih, artikelnya sangat membantu. :D
BalasHapussama2. Senang bisa membantu. :)
HapusHi there I am so grateful I found your site, I really found
BalasHapusyou by error, while I was browsing on Askjeeve for something else, Anyhow I am here now and would just like to say thanks a lot
for a marvelous post and a all round interesting blog (I also love the theme/design), I don’t have
time to look over it all at the moment but I have saved it and also included your
RSS feeds, so when I have time I will be back to read a lot more, Please do
keep up the fantastic b.