I am trying to set up virtual host so when I type ben in browser, the broswer shows the content of /Applications/XAMPP/htdocs/ben/public. At the moment when it works the way I want it to but when I go to http://localhost, it shows the content of /Applications/XAMPP/htdocs/ben!
One major concern was that there seems to be a conflict between Mac's server and XAMPP's server. So I have made my changes in both Mac;s server and XAMPP's. Doing that I have still not successed. Please check this and see if you can help me. Thank you.
So here is what I did:
1 - In /etc/hosts I added 127.0.0.1 ben (this seems to be the effective hosts file!)
2 - In /Applications/XAMPP/etc/hosts also I added 127.0.0.1 ben (this hosts file seems to be in-effective!)
3 - In /Applications/XAMPP/etc/httpd.conf I added Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
4 - In /etc/apache2/ httpd.conf I added Include /private/etc/apache2/extra/httpd-vhosts.conf
5 - In /etc/apache2/extra/httpd-vhosts.conf I added
- Code: Select all
<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/htdocs/ben/public/"
ServerName ben
ErrorLog "/Applications/XAMPP/vhosts/z/local-error.log"
<Directory "/Applications/XAMPP/htdocs/ben/public">
Allow from all
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Thank you for your time