Trying to run apache server on Mavericks

Solution 1:

Check /var/log/apache2/error_log or /var/log/system.log. You can also try to flush the DNS cache by running sudo killall -HUP mDNSResponder. See http://support.apple.com/kb/ht5343.

Just running sudo apachectl start makes http://localhost show the "It works!" page for me in a 10.9 VM.

Saving

<Directory "/Users/username/Sites/">
  Options Indexes Multiviews
  AllowOverride AuthConfig Limit
  Order allow,deny
  Allow from all
</Directory>

as /etc/apache2/users/username.conf and running sudo apachectl restart makes http://localhost/~username/ point to ~/Sites/.

Uncommenting Include /private/etc/apache2/extra/httpd-vhosts.conf in /etc/apache2/httpd.conf, adding 127.0.0.1 test.dev to /etc/hosts, adding

<VirtualHost *:80>
  DocumentRoot "/Users/username/Sites/test"
  ServerName test.dev
</VirtualHost>

to /etc/apache2/extra/httpd-vhosts.conf, and running sudo apachectl restart makes http://test.dev point to ~/Sites/test/.