Mountain Lion, Zend Server CE, and Personal Web Sharing

With Macintosh OSX 10.8, personal web sharing has been removed from the Sharing System Preference. 

I have been using the Zend Server CE ( ) as a PHP and Javascript debugging tool and had always fought having two Apache web servers running on my machines. With one file added to the zend apache configuration folder, I have all my users personal file sharing enabled and only one apache configuration to maintain.

Create the file /usr/local/zend/apache2/conf.d/macintosh_pws.conf

vi /usr/local/zend/apache2/conf.d/macintosh_pws.conf
Listen 80
#Include conf/extra/httpd-userdir.conf
# Settings for user home directories
# Required module: mod_userdir
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
UserDir Sites
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
<Directory "/Users/*/Sites">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
Order deny,allow
Deny from all

By default, the Zend Server listens on port 10088, the

Listen 80

line, tells the server to also listen on the default http port of 80. 

The rest of the code is a slightly modified version of the personal web sharing build into Apache ( located in conf/extra/httpd-userdir.conf ). I've changed the linux default of 'public_html' to 'Sites'. 

Restart Zend's Apache server:

$ sudo /usr/local/zend/bin/ restart-apache

And you should be able to visit your website at http://localhost/~username

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk