How To Create XAMPP Virtual Host For Domain !!

25 03 2009
www

Virtual Host For Domain

In this post, I will explain how to create apache virtual host.

Virtual host is apache feature to allow us to make our website with it own domain in our computer . So we can access our website through “real” url. yes !!

so , we will make a virtual host for www.yourname.com domain. you can use .org – .com – .net …etc

mmmmm…… next steps

1 // open your terminal .. and return :)

If you installing lampp in /opt you need, you must be root  to edit /opt/lampp/etc/httpd.conf file. ok

2 // Use

sudo gedit /opt/lampp/etc/httpd.conf

3 // And add this line in the last file:

include /home/username/website/extra-httpd.conf

save and close ok……

4 // now..

Open your text editor

And add these lines

<VirtualHost 127.0.2.1>
ServerName www.yourname.com
DocumentRoot /home/username/website/www.yourname.com

<Directory /home/username/website/www.yourname.com>
AllowOverride All
Options All
</Directory>
</VirtualHost>


Save this file as extra-httpd.conf in /home/username/website, as we define in httpd.conf file. ok

5 // add host :

Then, we must add the IP address we use above to /etc/hosts file.

add : ip > 127.0.2.1 and domain www.yourname.com

6 // if you have ubuntu

Go to System >> Administration >> Network.
Change to the tab to Hosts, and  click Add,  enter the IP address and the server name.


Actions

Information

5 responses

25 03 2009
aminesoft

the author of this post is aminesoft ;)
if you want copy to any place
you can ;)
GPL
good luke for all :)

3 04 2009
soulshady

well well i notice that u r so perfect so inane Xd i like all this i’ll try it buti wish that is secure

16 04 2009
aminesoft

thnakx soulshady

24 08 2009
سيف عبدالرزاق

Salamo Alikom
why you did not make BSD license ,are you Algerian .

24 08 2009
abdessmed mohamed amine

و عليكم السلام
yes i am Algeria :)
i don’t like BSD license :(
thnakx

Leave a comment