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?
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.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With