Friday, March 2, 2012

Creating a Virtual Host on Ubuntu without a DNS Server

Previously been discussed on how to build a VirtualHost in Ubuntu, but this article is slightly different because it does not use DNS Server and is only valid for small networks, this article is the same as the previous article Creating a Virtual Host in Apache Web Server, but the difference is the operating system, the in the article Creating a Virtual Host Apache web server using the Windows XP operating system and server package XAMPP whereas in this article use Linux operating system Ubuntu 10.04 without any server package, but installing one by one server separately (see article: install MySQL, PHP, Apache on Ubuntu linux). Had quite an introduction to this article let us discuss it step by step:
 

1. Login as root due to access a web server requires authentication root

     $ sudo-s

2. Go to the directory / etc/apache2/sites-available

     # cd / etc/apache2/sites-available

3. Copy the default file becomes the name of such virualhost www.webku.com

     # cp default www.myweb.com

4. Edit the file www.
myweb.com with your favorite editor

     # pico www.
myweb.com

5. Change and add a few lines below:

     DocumenRoot / data2/SERVER_FILE/htdocs/
myweb
     ServerName
myweb.com
     ServerAlias ​​www.
myweb.com
     <Directory />
     Options FollowSymLinks
     AllowOverride None
     </ Directory>
     <Directory /data2/SERVER_FILE/htdocs/
myweb>
     Options Indexes FollowSymLinks MultiViews
     AllowOverride None
     Order allow, deny
     allow from all
     </ Directory>

6. Activate the virtual host that has been created with the command

     # a2ensite www.
myweb.com

7. Edit the hosts file is located in the directory / etc

     # pico / etc / hosts

8. Add the following lines then save

     127.0.0.1 www.
myweb.com

9. Reload apache2 settings with the command

     # / etc/init.d/apache2 reload

10. Check in by calling www.
myweb.com browser if the page is performing meaningful work you've managed to create a virtual host

0 komentar:

Post a Comment

Hello, visitors please fill your comments here.

thank you !

regards, Rikies.