
#Mac os x apache not working mac os
A Cleaner Configurationīefore I being, I assume you already installed and configured Apache on Mac OS X.įirst, open the Terminal app and switch to the root user to avoid permission issues while running these commands. To do that, you need to configure virtual hosts. You could mimic multiple sites by creating subdirectories and access a site at localhost/somesite. This is essentially a single site configuration.
#Mac os x apache not working mac os x
Primarily, we would rather access the site using a name like somesite.local. By default, the Apache configuration on Mac OS X serves files from /Library/WebServer/Documents accessed by the name locahost. The term Virtual Host refers to the practice of running more than one web site on a single machine.īy default, the Apache configuration on Mac OS X serves files from /Library/WebServer/Documents accessed by the name locahost. What are Virtual Hosts?įrom the Apache Virtual Host documentation: In the same amount of steps (two), you can adopt a more manageable configuration. Furthermore, Apache configurations often get reset when upgrading Mac OS X. To mountaindogmedia's point, this becomes difficult to manage. Over the years, I have created many virtual hosts. You need to edit the Apache configuration to include this file and enable virtual hosts. In fact, this is the default configuration for many servers.īy default, the Apache Virtual Host configuration on Mac OS X is located in a single file: /etc/apache2/extra/nf.

Indeed, mountaindogmedia, this is an easier way. I think it would be easier to manage host files and changes. Jason, have you tried a modified Include statement for virtual hosts to map a directory? So instead of /etc/apache2/extra/nf as indicated, one would use /etc/apache2/extra/vhosts/*.conf and then just create a nf for the first virtual host, and then add/edit/delete vhost files as needed. If you read the Apache SSI link I included at the beginning of this tip you'll know that all I had to do here was add the "Includes" option to the "Options" directive in this file, and then everything magically started working.įWIW, I'm using Apache 1.3.33 on Mac OS X 10.4.Mountaindogmedia left the following comment on my post for installing Apache, PHP, and MySQL on Mac OS X: Here's my /private/etc/httpd/users/al.conf configuration file as it appears now, with the SSI's working: Options Indexes MultiViews Includes AllowOverride None Order allow,deny Allow from all (I was just editing the /etc/httpd/nf file.) Once I modified this configuration file, so it contained the contents shown below, then restarted Apache, my SSI's starting working. I hadn't seen any mention of this file anywhere before, and sure enough, it was getting parsed last, after all my other configuration efforts. Processing config file: /private/etc/httpd/users/al.conf When I issued the start command I saw something I hadn't seen before. The key on the Mac was that instead of restarting Apache, I decided to stop and start Apache manually, like this: sudo apachectl stop

Oh, you do have to do the setup work as shown in this Apache SSI configuration document, but on Mac OS X the setup is a little different. Wow, for me, getting Apache server side includes (SSI's) to work on my Apple Mac OS X installation was nothing like what I read elsewhere. A $2 donation will help keep this site running!
