How To Create XAMPP Virtual Host For Domain !!

Posted: March 25, 2009 in Linux, linux security, linux server
Tags:

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.

Comments
  1. aminesoft says:

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

  2. soulshady says:

    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

  3. aminesoft says:

    thnakx soulshady

  4. سيف عبدالرزاق says:

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s