I’m trying to set up Apache HTTPD to use a folder within my document directory as its root. I set a symbolic link to that directory from /var/www/html:
coarse:~$ file /var/www/html
/var/www/html: symbolic link to /home/coarse/Documents/site/
coarse:~$ stat /home/coarse/Documents/site/
File: /home/coarse/Documents/site/
Size: 182 Blocks: 0 IO Block: 4096 directory
Device: XXXXX Inode: XXXX Links: 5
Access: (0755/drwxr-xr-x) Uid: ( 1000/ coarse) Gid: ( 1000/ coarse)
Context: unconfined_u:object_r:user_home_t:s0
Access: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
Modify: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
Change: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
Birth: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
coarse:~$ stat /var/www/html
File: /var/www/html -> /home/coarse/Documents/site/
Size: 33 Blocks: 0 IO Block: 4096 symbolic link
Device: XXXXX Inode: XXXX Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:httpd_sys_content_t:s0
Access: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
Modify: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
Change: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
Birth: 2026-11-28 XX:XX:XX.XXXXXXXXX +XXXX
coarse:~$ namei -l /home/coarse/Documents/site/
f: /home/coarse/Documents/site/
dr-xr-xr-x root root /
drwxr-xr-x root root home
drwx------ coarse coarse coarse
drwxr-xr-x coarse coarse Documents
drwxr-xr-x coarse coarse site
The Apache virtual user needs read and search access to that directory, so the directory and its subdirectories have permissions drwxr-xr-x, and all files therewithin have perms -rw-r--r--. Being a symbolic link, the link itself has perms lrwxrwxrwx.
However, if I were to log in as Apache, none of that seems to matter, and the link looks broken:
apache:~$ file /var/www/html
/var/www/html: broken symbolic link to /home/coarse/Documents/site/
I have the site set up in the exact same way on another computer, and it works there. Why doesn’t it work here? If more information is required, what should I do to get it?
This computer runs CentOS Stream 10, and my other computer runs Ubuntu 26.04.1 LTS.