How to regain access to home directories through browser after MAMP-wordpress installation

I recently installed wordpress on a Mac via MAMP with root URL, say, example.smt.els.com.
To do this I had to stop the apache server that was running already in order to use the one provided with MAMP.

My problem is that, although the website is running without problems now, no user can access their home directories via example.smt.els.com/~username.

Read More

These /~username pages were accessible prior to wordpress. I have no problem accessing subfolders I create in the root directory (i.e example.smt.els.com/bananas)

I’d appreciate any help.

Related posts

Leave a Reply

1 comment

  1. The configuration of the apache server that is running from MAMP is done below

    /Applications/MAMP/conf/apache/
    

    The first thing that needs to be done is to load the configuration files of the individual users. This can be done by uncommenting the line where the file httpd-userdir.conf is loaded. Hence, the first step is to uncomment the following line:

    $ cat httpd.conf | grep httpd-userdir.conf
    Include /Applications/MAMP/conf/apache/extra/httpd-userdir.conf
    $ 
    

    Now, under the directory extra one can modify the httpd-userdir.conf file so that it is loaded with the options that you want. The first observation is that the httpd-userdir.conf that comes with MAMP has a line that reads:

    UserDir public_html
    

    Notice that this is not the expected directory under OS X. Hence, I would suggest to change that line and make it read like this:

    UserDir Sites
    

    since “Sites” is the expected directory for this purpose under OS X. Otherwise you should notify the users of the system that you are using public_html just like in traditional unix/linux distributions.

    Similarly, further below in the httpd-userdir.conf file you should change the line

    <Directory "/home/*/public_html">
    

    to

    <Directory "/Users/*/Sites">
    

    Note that the MAMP version of httpd-userdir.conf is different in that respect compared to the default httpd-userdir.conf file that comes with the apache that is installed with OS X and can be found under /etc/apache2/extra/ . Compare these two files and use which ever version you prefer for the configuration. Personally, I would go for the default configuration that comes with OS X, meaning that I would use something like this:

    #
    # Users might not be in /Users/*/Sites, so use user-specific config files.
    #
    Include /private/etc/apache2/users/*.conf
    <IfModule bonjour_module>
           RegisterUserSite customized-users
    </IfModule>
    

    since it gives you even more flexibility for the configuration of the individual users.