Shared File System for Apache

SYSTEM INFORMATION
OS type and version Ubuntu 22.04
Virtualmin version 7.8.2

Hello,

I’m trying to load balance apache2 across multiple instances using a shared file system.

The layout is a bit like this:

  • /etc/apache2 is a symlink on all the instances on a shared mounted share
  • site files are also on a shared mounted share (virtual server files)
  • log files for virtual server are also on the mounted share

I’ve also symlinked /var/lock/apache2, /var/log/apache2 and /var/run/apache2

On the initial instance, this configuration works without issue. When I access the desired url, it loads the page as expected.

Then I’ve made an image of the initial instance (same exact configuration), meaning that all shared file systems are already mounted and pointing to the correct locations.

What I am seeing is when I attempt to load the url, it shows the apache default page instead of showing the page defined in the virtual server.

I’ve checked the symlinks and file permissions, everything seems to be correctly configured on the cloned image.
It works fine if I point the url to to the initial image, but not on the cloned one.

I am not sure what I’m doing wrong, or what I missed.

Any help getting this setup to work would be greatly appreciated.

Some programs don’t follow sym links. A quick search seems to include Apache for security reasons. Some indications that can be over ridden but that’s as far as I read.

My base instance is working properly with symlinks in place (config, logs, etc), I don’t believe symlinks are the issue here.
I also checked permissions on the directories, they’re set exactly the same way.

The second instance is a functional image of the second one after all the configuration was established, so in practice they point to the same things.

Well, the configs and logs aren’t served up by Apache. Not sure what ‘etc’ would be included. But, like I said, I did a quick search to see if Apache followed symlinks and it was ‘iffy’ at best. Look into it or don’t.

I figured out the problem using apache2ctl -S

My virtualhost server configuration was set to the local ip of the base instance. Changing that to * solved the issue and everything worked as expected.

Thanks!

2 Likes

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.