I have installed a LAMP stack on my OpenSUSE 11.4 server. Currently, the DocumentRoot is set to /srv/www/htdocs but I want my users to be able to use ~/public_html just as they would in a shared hosting environment.

What Apache configuration changes do I need to make?

Do I need to change any settings in MySQL or in anything else that runs on the server?


You need to make sure that mod_userdir is loaded and enabled. The following commands turn it on in my Debian-packaged version of Apache. This should work fine for OpenSUSE, although you might need to adjust the path to the module in the LoadModule directive. The command might already be in your httpd.conf but just commented out. At a minimum you will need LoadModule and the first UserDir directive, although the second one to prevent root from using that directory is probably a good idea.

LoadModule userdir_module /usr/lib/apache2/modules/mod_userdir.so
<IfModule mod_userdir.c>
        UserDir public_html
        UserDir disabled root

        <Directory /home/*/public_html>
                AllowOverride FileInfo AuthConfig Limit Indexes
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST OPTIONS>
                        Order allow,deny
                        Allow from all
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.