Enable UserDir

Enable userdir, users can create websites with this setting.

[1] Configure httpd.

[[email protected] ~]# vi /etc/httpd/conf.d/userdir.conf

# line 17: comment out
#UserDir disabled

# line 24: uncomment
UserDir public_html

# line 31-35
<Directory "/home/*/public_html">
    AllowOverride All  # change
    Options None       # change
    Require method GET POST OPTIONS

[[email protected] ~]# systemctl restart httpd

[2] If SELinux is enabled and also enable CGI except default location like above, add rules like follows.

[[email protected] ~]# dnf install checkpolicy policycoreutils-python-utils -y
[[email protected] ~]# setsebool -P httpd_enable_homedirs on
[[email protected] ~]# restorecon -R /home

[3] Create a test page with a user and access to it from client PC with web browser. It's OK if following page is shown.

[[email protected] ~]$ mkdir -p public_html
[[email protected]nux ~]$ chmod 711 /home/future
[[email protected] ~]$ chmod 755 /home/future/public_html
[[email protected] ~]$ echo "UserDir Test Page" > /home/future/public_html/index.html