FreeBSD 14
Sponsored Link

Apache httpd : Enable Userdir2024/01/30

 

Enable userdir. Users can create websites under their own home directory by this setting.

[1] Enable UserDir setting.
root@www:~ #
vi /usr/local/etc/apache24/httpd.conf
# line 179 : uncomment

LoadModule userdir_module libexec/apache24/mod_userdir.so
# line 503 : uncomment

Include etc/apache24/extra/httpd-userdir.conf
root@www:~ #
vi /usr/local/etc/apache24/extra/httpd-userdir.conf
# line 18-22

<Directory "/home/*/public_html">
    AllowOverride All     # change if you need
    Options None          # change if you need
    Require method GET POST OPTIONS
</Directory>

root@www:~ #
service apache24 reload

[2] Create a test page with a user and access to it from any client computer with Web browser.
freebsd@www:~ $
mkdir public_html

freebsd@www:~ $
chmod 711 /home/freebsd

freebsd@www:~ $
chmod 755 /home/freebsd/public_html

freebsd@www:~ $
vi ./public_html/index.html
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
UserDir Test Page
</div>
</body>
</html>
Matched Content