Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all
                </LimitExcept>
        </Directory>
</IfModule>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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