Monday, February 18, 2013

Start an Apache Web Server in Mac OS X Mountain Lion

In OS X Mountain Lion the Web Sharing preference panel has been removed. The Apache web server remains bundled with Mac OS X though, but you’ll need to turn to the command line to enable the web server.
  1. Create and edit the following file /etc/apache2/users/USERNAME.conf (replace "USERNAME" with the actual account)
  2. Its contents should be as follows:
    <Directory "/Users/USERNAME/Sites/">
    Options Indexes Multiviews
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    </Directory>
  3. start the actual server: sudo apachectl start
  4. accessing http://127.0.0.1/ will simply display It works!
  5. files stored under /Users/USERNAME/Sites/ will be accessible from http://127.0.0.1/~USERNAME
  6. stop/restart your Apache web server with sudo apachectl stop|restart
Source: http://osxdaily.com/2012/09/02/start-apache-web-server-mac-os-x/

More info here: http://reviews.cnet.com/8301-13727_7-57481978-263/how-to-enable-web-sharing-in-os-x-mountain-lion/
and here: http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php-and-phpmyadmin-osx-108-mountain-lion



No comments: