Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We usually see personal web pages like http://a-site.com/~someone/, in this case, "someone" is a user of "a-site". How to enable this by default, so whenever we add a new user "foo", then http://a-site.com/~foo/ is created automatically? Is the tilde in "~someone" optional, customizable?

Software environment:

Webserver: Apache or Yaws (Erlang based webserver)

share|improve this question
What webserver? Apache? – Michael Mrozek Dec 6 '11 at 6:55
@MichaelMrozek I am actually testing Yaws, yet, solutions using Apache are also appreciated since Apache is currently more widely used. – Ning Dec 6 '11 at 7:33
up vote 2 down vote accepted

For Yaws, you're looking for the tilde_expand configuration option.

There is nothing magical about the ~ character, but it is so common that I wouldn't recommend trying to circumvent it. If you want to forgo it completely, then give users the ability to edit content in /var/www/htdocs/<username>/ themselves.

share|improve this answer

Make sure you have

Include conf/extra/httpd-userdir.conf


LoadModule userdir_module modules/mod_userdir.so

in your httpd.conf.

share|improve this answer

Update this line in httpd configuration

UserDir .www

and ask users to create ~/.www directory themselves in their home directory if they want to share something over web. Ask them to share their files over http(scrutiny on themselves).

In the load module section, add this line

LoadModule userdir_module modules/mod_userdir.so

In order to give each user their own cgi-bin directory, you can use a directive to make a particular subdirectory of a user's home directory cgi-enabled.

<Directory /home/*/.www/cgi-bin/>
Options ExecCGI
SetHandler cgi-script

Restart or HUP httpd service.

share|improve this answer

Your Answer


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.