I have a symlink at /var/www/domain.example/web/MY_SYMLINK pointing to /var/www/domain.example/web/SOME_FOLDER. This is defined as my document root for the website.
Then I run ln -sfn to change the symlink to something like /var/www/domain.example/web/NEW_FOLDER. So far, so good. If I run ls -a it's possible to see that the change was applied.
If I hit the server at http://domain.example, the website still pointing to the old folder. I know that apache needs to be restarted, so I run service apache2 restart but the change isn't performed. I've tried with apache2 stop/start, reload or graceful. None of them works.
The symlink update is only applied if I go to ISPConfig's control panel and hit Resync.
I wanna be able to perform this from the command line. Anyone know how to do it?
Check that apache is running
Note that Apache recommends using apachectl -k as the command, and for systemd, the command is replaced by httpd -k
This tells the process to kill all of its threads and then exit
A symlink should work fine. You may or may not need to add the directory to /etc/apache2/apache2.conf so that apache knows it is allowed to access the non-standard directory.
Excerpt from '/etc/apache2/acpahe2.conf'
Make sure all permissions, including parents, are in order.