9.11. Apache webserver

Skolelinux/Debian-edu comes with the Apache webserver, it almost works out-of-the bugs. It's just one small thing missing; telling the configuration file that the users home-directory is not in /home, but rather in /skole/tjener/home0. This has been reported as a bug, see bug 639. You must fix the config file /etc/apache/httpd.conf at about line 342, replace


    /home/*/public_html

with

    /skole/tjener/home0/*/public_html

Then Apache must be restarted

/etc/init.d/apache restart

Then make sure the the user has a directory called public_html with permissions 755 and owned by the user.

mkdir --mode=755 ~username/public_html
chown username:username ~username/public_html

If you don't feel like manually creating these public_html directories, then you can add them to /usr/share/webmin/ldap-users/createhomedir like this


# Make directory for public_html files, readable for everybody.
mkdir "$homedir/public_html"
chmod 0755 "$homedir/public_html"
have a look at default directories for your users.

If you already have created your users, this little one-liner will create public_html for all users:

for dir in $(getent passwd | grep home0 |cut -d":" -f6) ;
do mkdir $dir/public_html ;
chmod 755 $dir/public_html ;
chown --reference $dir:$dir $dir/public_html ;
done

Once the Apache config-file has been fixed, and the user has a directory public_html with correct permissions, then it's time to create a html-file, save it in public_html and see if this works. Create a document, in e.g OpenOffice.org, save it in html- format, and save it in the directory public_html under the name index.html

If everything works, you should be able to see that file in the url http://tjener.intern/~username