This is the first time I've ever used apache, so there's a pretty good chance I'm doing something horribly wrong. I followed some instructions online to edit /private/etc/apache2/httpd.conf make my web root folder at ~/Sites. I have a couple projects that I want to have inside that folder, so I looked into it and saw that I had to set up virtual hosts.

When I uncommented this line in httpd.conf: #Include /private/etc/apache2/extra/httpd-vhosts.conf. I try to restart apache by enabling web sharing, but it flashes yellow and then turns off. The vhosts file is the default one, and commenting out the VirtualHost entries makes it so it works again.

Any ideas what is going wrong, or where I could check a log where it tries to start up? /var/log/apache2 folder does not have logs that show it starting up and failing.

Here's my vhosts file:

# Use name-based virtual hosting.
NameVirtualHost *:80

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.

<VirtualHost *:80>
   DocumentRoot "/users/me/Sites/mysite"
   ServerName mysite.dev
  • Try starting it from the Terminal: apachectl start and check the output there. Also doublecheck for a /var/log/apache2/error_log file. – Gerry Jun 20 '12 at 13:40
  • Thanks. I used apachectl -t and it showed: 'Invalid command '\xc2\xa0', perhaps misspelled or defined by a module not included in the server configuration.' I changed the file encoding to UTF-8 and then retyped the config, and it worked. – Paul Jun 20 '12 at 20:47

You must log in to answer this question.

Browse other questions tagged .