Results 1 to 8 of 8

Thread: How do I get user/public_html to work?

  1. #1

    Default How do I get user/public_html to work?

    I am trying to enable user public_html on my lamp machine. I just want it to run in localhost for development purposes. It seem easy enough from what I have read but, I have not had any success.

    A phpinfo.php file in /srv/www/htdocs tells me mod_userdir is enabled.

    I have a phpinfo.php and index.php file in the user/public_html directory.

    In mod_userdir.conf I have set the path with 'UserDir public_html' and 'UserDir enabled MyUserName'.

    According to the instructions I have seen I did not think I would have to include MyUserName, but Apache did not start if I did not include the user name.

    I have tried to access the file here http://localhost/home/MyUserName/ as is and with both phpinfo.php and index.php appended, but I just get Object not found! Error 404.

    The permissions of those files make them accessible to everyone. If it make a difference I am running Suse 11.3, KDE4

    What else do I need to do to make this work?

  2. #2
    Join Date
    Aug 2008
    Location
    Behind the 8 ball
    Posts
    116

    Default Re: How do I get user/public_html to work?

    Try http://localhost/~MyUserName

    Also check /var/log/apache2/error_log for errors

  3. #3
    Join Date
    Nov 2009
    Location
    Pennsylvania, USA
    Posts
    405

    Default Re: How do I get user/public_html to work?

    What is mod_userdir.conf?

    Do you have document root set correctly in your httpd.conf file?

    Mine looks like this.

    Code:
    #
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #
    DocumentRoot "/home/wschw01/public_html"
    and I have User/Group set to

    Code:
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User wschw01
    Group www
    Desktop: AMD Athlon(tm) II X3 455 3.3 Ghz | 4 GB RAM | GeForce GT 630

  4. #4

    Default Re: How do I get user/public_html to work?

    Thanks for the replies, but still not working.

    The ~ does not help.

    rafter22, it looks like you are editing your httpd.conf, which is generally not a good idea.
    The mod files are the ones to edit. They are suppose to override the general settings in httpd.conf. Anybody, please correct me if I am wrong about that.

    My root document is set to /srv/www/htdocs, as it should be and works fine, but I want to add ~user/public_html.

    There has to be something I am over looking.

    BTW, the mod_userdir.conf is in the same directory as the httpd.conf file.

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,105
    Blog Entries
    15

    Default Re: How do I get user/public_html to work?

    Hi
    Works fine if you have created the directory ~/public_html then it's just http://yoursite/~username/

    You shouldn't have to modify anything? And it does need to be ~username.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6
    Join Date
    Aug 2008
    Location
    Behind the 8 ball
    Posts
    116

    Default Re: How do I get user/public_html to work?

    Ok, I did a quick setup and it seems to be working. In the /etc/apache2/mod_userdir.conf file I have the following.
    Code:
    #
    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    #
    
    <IfModule mod_userdir.c>
            # Note that the name of the user directory ("public_html") cannot easily be
            # changed here, since it is a compile time setting. The apache package
            # would have to be rebuilt. You could work around by deleting
            # /usr/sbin/suexec, but then all scripts from the directories would be
            # executed with the UID of the webserver.
            #
            # To rebuild apache with another setting you need to change the
            # %userdir define in the spec file.
    
            # not every user's directory should be visible:
            UserDir disabled root
    
            # to enable UserDir only for a certain set of users, use this instead:
            #UserDir disabled
            #UserDir enabled user1 user2
    
    
            # the UserDir directive is actually used inside the virtual hosts, to
            # have more control
            #UserDir public_html
    
            <Directory /home/*/public_html>
    
                    AllowOverride FileInfo AuthConfig Limit Indexes
                    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    
                    <Limit GET POST OPTIONS PROPFIND>
                            Order allow,deny
                            Allow from all
                    </Limit>
    
                    <LimitExcept GET POST OPTIONS PROPFIND>
                            Order deny,allow
                            Deny from all
                    </LimitExcept>
    
            </Directory>
    
    </IfModule>
    Let me know if this helps.

    Hiatt

  7. #7
    Join Date
    Nov 2009
    Location
    Pennsylvania, USA
    Posts
    405

    Default Re: How do I get user/public_html to work?

    Quote Originally Posted by thedarpone View Post
    Thanks for the replies, but still not working.

    The ~ does not help.

    rafter22, it looks like you are editing your httpd.conf, which is generally not a good idea.
    The mod files are the ones to edit. They are suppose to override the general settings in httpd.conf. Anybody, please correct me if I am wrong about that.

    My root document is set to /srv/www/htdocs, as it should be and works fine, but I want to add ~user/public_html.

    There has to be something I am over looking.

    BTW, the mod_userdir.conf is in the same directory as the httpd.conf file.
    Sorry, I was following the directions from Configuration Files - Apache HTTP Server and from the Compiling and Installing directions "Next, you can customize your Apache HTTP Server by editing the configuration files under PREFIX/conf/.

    $ vi PREFIX/conf/httpd.conf

    Have a look at the Apache HTTP Server manual under docs/manual/ or consult Apache HTTP Server Version 2.2 Documentation - Apache HTTP Server for the most recent version of this manual and a complete reference of available configuration directives."

    In the usr/local/apache2/conf folder I see my httpd.conf file, a folder called original, and a folder called extra.

    In the original folder there is another httpd.conf file and a folder called extra. In that extra folder I have 11 more conf files all starting with httpd.

    In the extra folder, in the conf folder, I have the same 11 files.

    No mod_userdir.conf file to be found anywhere.

    Then again my root document was set to /usr/local/apache2/htdocs before I edited my httpd.conf file.

    Then again I manually installed Apache in /usr/local, not from a rpm.

    Good luck.
    Desktop: AMD Athlon(tm) II X3 455 3.3 Ghz | 4 GB RAM | GeForce GT 630

  8. #8
    Join Date
    Nov 2009
    Location
    Pennsylvania, USA
    Posts
    405

    Default Re: How do I get user/public_html to work?

    Ok, I installed the Apache rpm from the repo and even though it is still v2.2.15 I found the mod_userdir.conf file.

    So whatever works I guess. Since building it from the .tar.gz file doesn't provide me with any mod files, am I supposed to create them myself, or follow the documentation, and edit the httpd.conf file?

    I'll follow the directions that came with the software.
    Desktop: AMD Athlon(tm) II X3 455 3.3 Ghz | 4 GB RAM | GeForce GT 630

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •