You will need to set up virtual hosts.
1. Open "Applications/XAMPP/xamppfiles/etc/httpd.conf" and uncomment the following line:
- Code: Select all
Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
2. In the same file, add the line
- Code: Select all
AcceptMutex Flock
above the line you just uncommented. The 'AcceptMutex Flock'-line need to be added because of a bug in XAMPP that caused that using multiple ports was not working.
3. Open "Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf", there you can specify your virtual hosts.
For example, if you want that port 1000 directs you to the directory '/Applications/XAMPP/xamppfiles/htdocs/mywebsite/', replace the contents of the file with this:
- Code: Select all
Listen 1000
NameVirtualHost *:1000
<VirtualHost *:1000 >
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/mywebsite"
</VirtualHost>
4. Restart Apache or XAMPP to get your virtual host working.
A server error may occur if you have .htaccess-file inside the 'mywebsite'-directory, if that's the case add the following as well to the 'httpd-vhosts.conf'-file:
- Code: Select all
<Directory "/Applications/XAMPP/xamppfiles/htdocs/mywebsite">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
There are more possible variables for VirtualHost you can set. In the example I had only specified DocumentRoot. For example, you can also set 'ServerAdmin' (e-mailaddress) and 'ErrorLog' (filepath of where servererrors should be stored). You will see some of the possible variables when you first open the 'httpd-vhosts.conf'-file.