Setting up virtual host on XAMPP (in Macbook)

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Setting up virtual host on XAMPP (in Macbook)

Postby behnampmdg3 » 14. March 2014 18:33

Hello;

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
behnampmdg3
 
Posts: 11
Joined: 12. November 2013 02:30
Operating System: Mac Os 10.6

Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 54 guests