Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up virtual host on XAMPP

I've installed XAMPP on Ubuntu in '/opt/lampp' directory and would like to set up some VirtualHosts. Apache Virtual Host tutorial instructs to place

<VirtualHost *:80>
...
</VirtualHost>

code in '/etc/apache2/sites-available/[virtualhostname].conf'. The problem is that I don't have 'apache2' folder in '/etc'. I also don't have 'sites-available' directory in '/opt/lampp/apache2'.

I have '/opt/lampp/etc/httpd.conf' and '/opt/lampp/etc/extra/httpd-vhosts.conf' files though. Which ones shall I use to set the VH up?

like image 676
Alan Avatar asked Apr 09 '14 12:04

Alan


People also ask

How can we set virtual host in local machine?

Create a new virtual host This file is located at C:\MAMP\bin\apache\conf\extra\httpd-vhosts. conf . With your editor, open the configuration file and at the end of the document add the code snippet below. Apache configuration files use directives to set rules that should be followed by the server.

How do I run multiple websites on Xampp?

By default XAMPP is setup to run at http://localhost and serve pages that are kept under C:/xampp/htdocs. In this situation, if you want to develop multiple websites, you will need to create a folder under C:/xampp/htdocs for each website and keep the website files thereunder.


1 Answers

You should use /opt/lampp/etc/extra/httpd-vhosts.conf, but before you should add your servername to your .hosts file and uncomment inclusion of of the httpd-vhosts.conf in the /opt/lampp/etc/httpd.conf.

like image 87
potashin Avatar answered Oct 10 '22 16:10

potashin