Apache using symlinks

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Apache using symlinks

Postby ActionParsnip » 23. March 2021 23:09

Hi guys,

I run Apache 2.4.38 on Raspian Buster.

I have index.html in tempfs and is symliked into the folder holding my web content. The index.html changes a lot so I keep it off my SD card to reduce wear. The file is generated using a script. Config is as below:

cat ./website.conf
<VirtualHost *:80>
ServerAdmin me@googlemail.com
ServerName fqdnofwebsite
ServerAlias www.fqdnofwebsite
DocumentRoot /var/www/fqdnofwebsite
<Directory />
Options +ExecCGI +FollowSymlinks -SymLinksIfOwnerMatch
AllowOverride None
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

This is in sites-available and is is symlinked to the sites-enabled folder.

/var/www/fqdnofwebsite is owned by "pi:pi" and the index.html file is owned by "pi:pi" too.

From my client PC on LAN, I have a hosts file so that the name is correct in the request. When I try to hit the server the request is forbidden.

The Apache log file states:

[Tue Mar 23 22:08:37.155319 2021] [core:error] [pid 24631:tid 1884275744] [client 192.168.0.69:58177] AH00037: Symbolic link not allowed or link target not accessible: /var/www/fqdnofwebsite/index.html

The file "/var/www/fqdnofwebsite/index.html" is owned by pi:pi

Status of service shows:

apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-03-23 21:42:45 GMT; 28min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 23923 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Process: 24624 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 23927 (apache2)
Tasks: 55 (limit: 2062)
CGroup: /system.slice/apache2.service
├─23927 /usr/sbin/apache2 -k start
├─24628 /usr/sbin/apache2 -k start
└─24631 /usr/sbin/apache2 -k start

Mar 23 21:52:38 rinse systemd[1]: Reloading The Apache HTTP Server.
Mar 23 21:52:38 rinse systemd[1]: Reloaded The Apache HTTP Server.
Mar 23 21:55:31 rinse systemd[1]: Reloading The Apache HTTP Server.
Mar 23 21:55:31 rinse systemd[1]: Reloaded The Apache HTTP Server.

Can anyone please advise?
ActionParsnip
 
Posts: 3
Joined: 23. March 2021 22:56
XAMPP version: 2.4.38
Operating System: Raspian Buster

Re: Apache using symlinks

Postby Altrea » 24. March 2021 07:35

Hi,

How is your topic related to XAMPP for Linux?
XAMPP does not provide a compilation for ARM processors, so no XAMPP on Raspberry pi.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Apache using symlinks

Postby ActionParsnip » 24. March 2021 11:37

Ahh apologies. I thought this was XAMP (Apache, MySQL, PHP etc). Is this not the case?
ActionParsnip
 
Posts: 3
Joined: 23. March 2021 22:56
XAMPP version: 2.4.38
Operating System: Raspian Buster

Re: Apache using symlinks

Postby Nobbie » 24. March 2021 12:31

No, there is no Xampp for Raspi. The stucture of the Apache configuration in your distribution is similar to the Debian server configuration, it differs heavily from Xampps configuration. Last not least, Xampp is installed into /opt/lampp (hardcoded).

Anyway, i think the problem is the ownership and/or the rights of the file index.html in tempfs (which actually is the physical file to be opened by Apache), the symlink in /var/www/.... is only a link, not the file itself. Keep in mind, that Apache runs with its own user and group (see httpd.conf for USER and GROUP configuration) and there might be also a problem that files in tempfs do only exist in the scope of the logged in user (not sure about that, only looking for some clue). Check all these things, somewhere there will be the problem.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Apache using symlinks

Postby ActionParsnip » 24. March 2021 13:12

Thanks. Will check over and post in a Raspian forum which is more appropriate
Thanks for clarifying.
-AndyW
ActionParsnip
 
Posts: 3
Joined: 23. March 2021 22:56
XAMPP version: 2.4.38
Operating System: Raspian Buster


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 18 guests