Professional Web Applications Themes

Setting up public_hml - Linux Setup, Configuration & Administration

Hi, I'm relatively new to Linux, and I'm trying to get Apache daemon setup. Apache seems to be running fine b/c I can stop and start the server, as well as open a browser and access the index.html page in \var\httpd\www\index.html by typing the URL [url]http://localhost/index.html[/url]. What I'd now like to do is setup a public_html folder for the users on the system. I've searched through the FAQ for apache, read the configuration instructions for Apache by Redhat, as well as a Google search, but alas can't seem to get an answer to a basic questions. I know my question ...

  1. #1

    Default Setting up public_hml

    Hi,

    I'm relatively new to Linux, and I'm trying to get Apache daemon setup.
    Apache seems to be running fine b/c I can stop and start the server, as well
    as open a browser and access the index.html page in
    \var\httpd\www\index.html by typing the URL [url]http://localhost/index.html[/url].
    What I'd now like to do is setup a public_html folder for the users on the
    system.

    I've searched through the FAQ for apache, read the configuration
    instructions for Apache by Redhat, as well as a Google search, but alas
    can't seem to get an answer to a basic questions.

    I know my question is probably common, yet I could not find the answer, how
    do you set up users webserver accounts on Linux? I assume you create a
    folder in the their \home\username\ folder. do you do this manually? do
    you let Apache configuration tool to do this? Is this apart of the Apache
    setup?

    Here's what I've tried
    1. Create a folder with public sharing activated, in \home\user\public_html.
    2. Added the \home\user\public_html directory to the Default Virtual
    Server's list of Directories.
    3. Start and stopped the apache service.

    didn't work

    I'm running RedHat 7.3 with Apache on an i386 using the KDE 3.0 desktop.

    Thanks,
    Justin


    Justin Birtwell Guest

  2. #2

    Default Re: Setting up public_hml

    Justin Birtwell <justin.birtwellverizon.net> wrote:
    > Hi,
    >
    > I'm relatively new to Linux, and I'm trying to get Apache daemon setup.
    > Apache seems to be running fine b/c I can stop and start the server, as well
    > as open a browser and access the index.html page in
    > \var\httpd\www\index.html by typing the URL [url]http://localhost/index.html[/url].
    so far so good :)
    > What I'd now like to do is setup a public_html folder for the users on the
    > system.
    >
    > I've searched through the FAQ for apache, read the configuration
    > instructions for Apache by Redhat, as well as a Google search, but alas
    > can't seem to get an answer to a basic questions.
    that cannot be.

    [url]http://www.google.com[/url]
    search for
    public_html apache

    4th hit.


    <IfModule mod_userdir.c>
    UserDir public_html
    </IfModule>

    > folder in the their \home\username\ folder. do you do this manually? do
    > you let Apache configuration tool to do this? Is this apart of the Apache
    > setup?
    have the user make a dir called public_html in hist $HOME and set the
    above in apache's main cfg file.

    apachectl restart and you're done

    [url]http://localhost/~username/[/url] should make the index file of
    /home/username/public_html/ come up
    >
    > Here's what I've tried
    > 1. Create a folder with public sharing activated, in \home\user\public_html.
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ what is that?

    hth, armin

    --

    life, the universe and everything
    [url]http://www.dtch.org[/url]

    armin walland Guest

  3. #3

    Default Re: Setting up public_hml

    armin walland <geschreigmx.at> wrote:
    ><IfModule mod_userdir.c>
    > UserDir public_html
    ></IfModule>
    sorry, i forgot; of course you have to load the userdir module first to
    make that work like this:

    LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so


    adjust the path to fit your installation
    --

    life, the universe and everything
    [url]http://www.dtch.org[/url]

    armin walland Guest

  4. #4

    Default Re: Setting up public_hml

    armin walland wrote:
    > /mod_userdir.so
    I am thinking of doing the same thing. Do you mean that the /public_html is
    in the user's own $HOME, not anywhere in the normal www directory? What
    about public_html/cgi-bin?

    Doug.
    --
    Registered Linux User No. 277548.
    They say lightning never strikes twice in the same place. My typing is
    about as accurate. Apologies for any typos that slip in. - Doug.
    Doug Laidlaw Guest

  5. #5

    Default Re: Setting up public_hml

    "Justin Birtwell" <justin.birtwellverizon.net> wrote in message news:<YQw1b.75$t57.48nwrdny01.gnilink.net>...
    > Hi,
    >
    > I'm relatively new to Linux, and I'm trying to get Apache daemon setup.
    > Apache seems to be running fine b/c I can stop and start the server, as well
    > as open a browser and access the index.html page in
    > \var\httpd\www\index.html by typing the URL [url]http://localhost/index.html[/url].
    > What I'd now like to do is setup a public_html folder for the users on the
    > system.
    >
    > I've searched through the FAQ for apache, read the configuration
    > instructions for Apache by Redhat, as well as a Google search, but alas
    > can't seem to get an answer to a basic questions.
    >
    > I know my question is probably common, yet I could not find the answer, how
    > do you set up users webserver accounts on Linux? I assume you create a
    > folder in the their \home\username\ folder. do you do this manually? do
    > you let Apache configuration tool to do this? Is this apart of the Apache
    > setup?
    >
    First you need the directive to allow user pages:
    (from slackware's httpd.conf; slightly edited)
    #
    # UserDir:
    # The name of the directory which is appended onto a user's
    # home directory if a ~user request is received.
    #
    <IfModule mod_userdir.c>
    UserDir pub/html # I renamed it
    </IfModule>

    #
    # Control access to UserDir directories. The following is an example
    # for a site where these directories are restricted to read-only.
    #
    <Directory /home/*/pub/html> # same dir with '/home/*/'
    Order allow,deny
    Allow from all
    </Directory>
    -----------

    A user request is given by "http://host/~bob"; this config snippit
    will serve pages from '/home/bob/pub/html'. The user is responisble
    for creating the directory(s), ensuring that the directory is
    world-browsable (because in most cases apache does not run as root and
    this is a _good_ thing), and ensuring that pages are there to serve
    up. Those must also be world readable.

    See [url]http://httpd.apache.org/[/url] -- and click the doentation link for
    your apache version.

    -t.
    beltorak Guest

  6. #6

    Default Re: Setting up public_hml

    Doug Laidlaw <laidlawsmyaccess.com.au> wrote:
    > I am thinking of doing the same thing. Do you mean that the /public_html is
    be careful here ^
    a / at the beginning of a path indicates an absolute path.
    > in the user's own $HOME, not anywhere in the normal www directory? What
    correct
    > about public_html/cgi-bin?
    if you want that you have to add a "ScriptAlias" directive do your
    apache's config file.

    apache really has a lot of doentation so please try to read it before
    asking.


    hth, armin

    --

    life, the universe and everything
    [url]http://www.dtch.org[/url]

    armin walland Guest

  7. #7

    Default Re: Setting up public_hml

    "You don't have permission to access / on this server."

    Ok here's what I've done.

    1. checked the httpd.conf file. Settings seemed Ok.
    LoadModule userdir_module /usr/lib/apache/mod_userdir.so

    # Doents
    DoentRoot /var/www/html
    UserDir public_html
    IndexOptions FancyIndexing

    2. set 755 permission on the public_html folder in
    /home/username/public_html
    chmod 755 /home/username/public_html
    3. Checked for RedHat bug 6.0 bug that fileter out html files listed in a
    previous thread.
    4. Set the Directory Permissions in httpd.conf
    <Directory "/home/*/public_html"> # same dir with '/home/*/'
    Order allow,deny
    Allow from all
    </Directory>

    I save my changes to httpd.conf. Stop/Start apache and try accessing a file
    in the users public_html folder [url]http://localhost/~username/index.html[/url] and I
    get:
    "You don't have permission to access / on this server."


    Thanks for the help,
    Justin

    Should I paste my entire httpd.conf here?

    Justin Guest

  8. #8

    Default Re: Setting up public_hml

    Peter T. Breuer wrote:
    >
    >
    > Justin <Justin.birtwellverizon.net> wrote:
    >> "You don't have permission to access / on this server."
    >
    > Read the error log.
    >
    > Peter
    Peter _YOU_ are an error log!
    Baho Utot Guest

  9. #9

    Default Re: Setting up public_hml


    "Justin" <justin.birtwellverizon.net> wrote in message
    news:l262b.15727$kF1.14764nwrdny02.gnilink.net...
    > Can anyone tell me what I'm doint wrong? It's going on day 3 and I still
    > can't seem to get users's public_html files working.
    $ cd /home/user
    $ chmod 755 public_html
    $ cd public_html
    $ chmod 755 *

    And so forth... Just go through and set 755 permissions on all
    subdirectories and files. You might technically get away with less
    permissions, but this is a place to start...


    David Guest

  10. #10

    Default Re: Setting up public_hml

    David wrote:
    > "Justin" <justin.birtwellverizon.net> wrote in message
    > news:l262b.15727$kF1.14764nwrdny02.gnilink.net...
    >
    >>Can anyone tell me what I'm doint wrong? It's going on day 3 and I still
    >>can't seem to get users's public_html files working.
    I'm coming into this thread late, so forgive me if this has already been
    mentioned. Take a look in your httpd.conf file and make sure that
    the public_html facility is enabled; it's disabled by default in RH9
    (and, I understand, later Apache releases).

    Steve Martin Guest

  11. #11

    Default Re: Setting up public_hml

    David wrote:
    > "Justin" <justin.birtwellverizon.net> wrote in message
    > news:l262b.15727$kF1.14764nwrdny02.gnilink.net...
    >
    >>Can anyone tell me what I'm doint wrong? It's going on day 3 and I still
    >>can't seem to get users's public_html files working.
    >
    >
    > $ cd /home/user
    > $ chmod 755 public_html
    > $ cd public_html
    > $ chmod 755 *
    >
    > And so forth... Just go through and set 755 permissions on all
    > subdirectories and files. You might technically get away with less
    > permissions, but this is a place to start...
    I had 60 seconds.

    #!/bin/sh

    homedirs="`ypcat passwd |cut -f6 -d:;cut -f6 -d:/etc/passwd`"
    for homedir in $homedirs; do
    # Use obscurity to permit symbolic links for public_html
    if [ -d $homedir/public_html/. ]; then
    echo "Setting permissions on $homedir directories"
    find $homedir -type d -exec chmod a+rx -print
    echo "Setting permissions on $homedir files"
    find $homedir -type f -exec chmod a+r -print
    echo "Links are your own problem"
    find $homedir -type l -print
    else
    echo "No $homedir/public_html found, ignoring"
    fi
    done

    Nico Kadel-Garcia Guest

Similar Threads

  1. setting up RDS
    By Onyx9 in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 0
    Last Post: January 23rd, 05:58 PM
  2. Setting Up PHP
    By Dalton Seymour in forum PHP Development
    Replies: 1
    Last Post: September 21st, 06:51 PM
  3. Help w/ setting up ASP.NET pls.
    By Jm in forum ASP.NET General
    Replies: 4
    Last Post: August 12th, 02:20 PM
  4. 16 bit setting
    By panchakshari webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 0
    Last Post: July 12th, 05:46 AM
  5. Setting Up A FTP
    By Dave in forum Windows Networking
    Replies: 0
    Last Post: June 30th, 05:59 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139