Find the answer to your Linux question:
Results 1 to 2 of 2
i'm running apache webserver on Slack9.1. www directory is in /var/www/html . My question is ; i want to set www directories for all users in their home directory, which ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jan 2004
    Location
    Istanbul,Turkey
    Posts
    151

    web host for all users


    i'm running apache webserver on Slack9.1.

    www directory is in /var/www/html .

    My question is ; i want to set www directories for all users in their home directory, which can be called by typing localhost/~username .
    i want this process to be aoutomotic, i.e. when i add a new user to system, the required directories will be created and localhost/~newuser gives a default under constraction page. How can i set this system up?

    Thank You!
    Have a nice day

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    you would need to write your own "adduser" shell script, that does the normal adduser stuff, but additionally creates the ~/public_html/ directory and copies a "template" index.html into it. A bash script would proberly be workable, but im not an expert.

    In your httpd.conf of apache, ensure you have a line like:

    Code:
    <IfModule mod_userdir.c>
        UserDir public_html
    </IfModule>
    where "public_html" is the name of the directory that the script as above creates.

    Jason

Posting Permissions

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