I’ve setup an Apache alias on a subdomain, which points to a directory outside the document root like this:
Alias / /home/keyhelp/www/webmail/plugins/xcalendar/caldav/
<Directory "/home/keyhelp/www/webmail/plugins/xcalendar/caldav">
Require all granted
AllowOverride All
</Directory>
This works as expected with a index.html file but not with index.php even if there is a .htaccess in the directory leading all requests to index.php.
In the Apache error log I get:
[Thu Mar 31 08:50:08.574396 2022] [proxy_fcgi:error] [pid 376501:tid 140039026099968] [client XX.XX.XXX.XXX:58410] AH01071: Got error 'Primary script unknown'
System: Debian 11.3, Apache 2.4.53, PHP 7.4.28
Thanks!
2
Answers
So it turned out to be a permission issue. I found this thread which helped me to track down the issue, as I'm also using php-fpm. I needed to add the executable bit for others on the keyhelp directory, which was the only directory in the tree without this bit set, by using:
And I needed to add the path
/home/keyhelp/www
to theopen_basedir
config of php. Now everything is working fine.In my case the line
SetHandler application/x-httpd-php
needed to be removed from Apache config file.You may need to add
<Directory /var/www/yourdirectory> DirectoryIndex index.php </Directory>
Hope this helps someone.