2

We usually see personal web pages like http://example.com/~someone/, in this case, "someone" is a user of "example.com".

How to enable this by default, so whenever we add a new user "foo", then http://example.com/~foo/ is created automatically? Is the tilde in "~someone" optional, customizable?

Software environment:

Webserver: Apache or Yaws (Erlang based webserver)

  • 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
2

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.

5

For Apache, see if http://httpd.apache.org/docs/2.2/en/mod/mod_userdir.html#userdir and http://httpd.apache.org/docs/2.2/en/howto/public_html.html helps.

2

Make sure you have

Include conf/extra/httpd-userdir.conf

and

LoadModule userdir_module modules/mod_userdir.so

in your httpd.conf.

1

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
</Directory>

Restart or HUP httpd service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.