Virtual hosts on Mac OS X Leopard with XAMPP
To set this up with xampp on Mac OS X,
vi /Applications/xampp/etc/httpd.conf
And uncomment:
# Virtual hosts
Include /Applications/xampp/etc/extra/httpd-vhosts.conf
For subsequent additions of named hosts to your Apache configuration, start here:
vi /Applications/xampp/etc/extra/httpd-vhosts.conf
Added (following their dummy-host example quite closely)
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot "/sites/example/htdocs"
ServerName example.dev
ServerAlias www.example.dev
ErrorLog "logs/example.dev-error_log"
CustomLog "logs/example.dev-access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerName myagaric_svn.dev
ServerAlias www.myagaric_svn.dev
ServerAdmin webmaster@localhost
DocumentRoot "/sites/myagaric_svn/www"
ErrorLog "logs/myagaric_svn_error.log"
CustomLog "logs/myagaric_svn_access.log" common
</VirtualHost>
... but some other step is needed for the browser to look there at all, i think. Ah yes, here:
/Users/ben/Documents/Ebony/Web Development/subdomains, multiple domains with virtualhosts.txt
But it's out of date.
In 10.5, the functions typically previously associated with NetInfo Manager have been moved to some Directory nonsense, and the Accounts pane of System Preferences.
But this command still works:
sudo vi /etc/hosts
Added this line:
127.0.0.1 example.dev
Comments
Hi Benjamin, I'm kinda new
Hi Benjamin,
I'm kinda new for Mac, and I want to set a virtual host for my gf Mac.
in the first line
vi /Applications/xampp/etc/httpd.conf
is it run on a terminal?
to open httpd.conf on mac xampp?
and
sudo vi /etc/hosts
is it the same setting for windows to access
c:\windows\system32\drivers\etc\hosts
I hope those commands run on the terminal...
Regards.
Yes
That is run in terminal (and
vi
opens a text editor) but i'm not sure what, if anything, translates directly to Windows.Hi Yes, in windows is
Hi
Yes, in windows is c:\windows\system32\drivers\etc\hosts. The syntax is the same (127.0.0.1 example.dev).
Very usefull information! Thanks for sharing!
Worked like a charm!
it worked like a charm. Thank you very much!
Permissions not working
Hey there, I've followed this and edited it to suit my site.
Every single file comes up with an error though:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
seo-reports.local
Sun Sep 4 20:49:34 2011
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1
Please help!
education requirements
Thank you for the information.
I seem to be learning backwards. I have learned static and dynamic web development using MAMP and need to delve deep into the back end.
What would be a sane course of action in topics to learn, books for self paced learning etc the back end.
Thanks you
Post new comment