Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

4 Answers 4

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
add comment

Make sure you have

Include conf/extra/httpd-userdir.conf

and

LoadModule userdir_module modules/mod_userdir.so

in your httpd.conf.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.