how to create virtual hosts with xampp in my mac?

Irgendwelche Probleme mit XAMPP für Mac OS X? Dann ist hier genau der richtige Ort um nachzufragen.

how to create virtual hosts with xampp in my mac?

Postby joscarvazquez » 12. June 2008 15:58

Hi everyone!

I need to create a virtual host in my mac in order to continue a book-course that i am reading. In this book i am told to use NetInfo Manager so that i can duplicate the "localhost". But actually Leopard does'nt run NetInfo Manager any more. Could you please tell me how to proceed to work with a virtual host in my mac? I have succesfully installed Xampp for mac and it runs ok.

I will appreciate your attentions,

regards from barcelona,

oscar
joscarvazquez
 
Posts: 3
Joined: 15. May 2008 13:57

Postby Nobbie » 21. June 2008 11:27

Virtualhost is an Apache Feature which is independent from the OS. Simply follow the Apache Documentation in order to install vhosts:

http://httpd.apache.org/docs/2.0/en/vhosts/
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04

Postby lvdg » 22. June 2008 16:54

Nobbie is right. Thats the way to configure apache.

But you have to tell you mac how to handle your (sub) domains.
Therefore you have to edit the file /private/etc/hosts (in OSX)

foreach subdomain you want to add, add a line to the hosts file like
Code: Select all
127.0.0.1         mysubdomain.localhost


This is working for me now. But I'm stuck with some trouble with the XAMPP screen. If I go to mysubdomain.localhost/ , I get redirected to mysubdomain.localhost/xammp/index.php, witch is oviously not found.

The second dissapointment is that I can't get "catch all" subdomains.
It is possible in the httpd.conf:
For example, if I want to catch *.subdomain.localhost, that done by:

Code: Select all
<VirtualHost 127.0.0.1>
        ServerName subdomain.localhost
   ServerAlias  subdomain.localhost *.subdomain.localhost
</Virtualhost>


But it is not possible in your hosts file.

You can not do something like
Code: Select all
127.0.0.1         *.subdomain.localhost
lvdg
 
Posts: 1
Joined: 22. June 2008 16:43

Re: how to create virtual hosts with xampp in my mac?

Postby Basir » 10. January 2010 05:07

You might have found the solution by now but I am posting the following link which may be useful for others. It is a step by step instructions on how to create virtual hosts in xampp that works.

http://blog.noutash.com/2010/01/10/xampp-virtualhosts-domain/
Basir
 
Posts: 1
Joined: 10. January 2010 05:04


Return to XAMPP für macOS

Who is online

Users browsing this forum: No registered users and 9 guests