Sun Java System Web Server 7.0 Update 7 Administrator's Guide

Customizing User Public Information Directories (UNIX/Linux)

Sometimes users want to maintain their own web pages. You can configure public information directories that let all the users on a server create home pages and other documents without your intervention.

With this system, clients can access your server with a certain URL that the server recognizes as a public information directory. For example, suppose you choose the prefix ~ and the directory public_html. If a request comes in for, the server recognizes that ~jdoe refers to a users’ public information directory. It looks up jdoe in the system’s user database and finds Jane’s home directory. The server then looks at ~/jdoe/public_html/aboutjane.html.

To configure your server to use public directories, follow these steps:

ProcedureConfiguring Document Directories

  1. From the virtual server page, click the Content Handling tab.

  2. Click Document Directories.

  3. Under User Document Directories, choose a user URL prefix.

    The usual prefix is ~ because the tilde character is the standard UNIX/Linux prefix for accessing a user’s home directory.

  4. Choose the subdirectory in the user’s home directory where the server looks for HTML files.

    A typical directory is public_html.

  5. Designate the password file.

    The server needs to know where to look for a file that lists users on your system. The server uses this file to determine valid user names and to find their home directories. If you use the system password file for this purpose, the server uses standard library calls to look up users. Alternatively, you can create another user file to look up users. You can specify that user file with an absolute path.

    Each line in the file should have this structure (the elements in the /etc/passwd file that aren’t needed are indicated with *):


  6. Choose whether to load the password database at startup.

  7. Click Save.

    For more information, see the online help for the User Document Directories page.

    Another way to give users separate directories is to create a URL mapping to a central directory that all of your users can modify.

Restricting Content Publication

In some situations a system administrator may want to restrict which user accounts are able to publish content by means of user document directories. To restrict a user’s publishing rights, add a trailing slash to the user’s home directory path in the /etc/passwd file:

jdoe::1234:1234:John Doe:/home/jdoe:/bin/sh


jdoe::1234:1234:John Doe:/home/jdoe/:/bin/sh

After you make this modification, Web Server will not serve pages from this user’s directory. The browser requesting the URI receives a “404 File Not Found” error and a 404 error will be logged to the web server access log. No error will be recorded to the errors log.

If, at a later time, you decide to allow this user to publish content, remove the trailing slash from the /etc/passwd entry, then restart the web server.

Loading the Entire Password File on Startup

You also have the option of loading the entire password file on startup. If you choose this option, the server loads the password file into memory when it starts, making user lookups much faster. If you have a very large password file, however, this option can use too much memory.