Why can't apache access files in /tmp?

Chris Green cl at isbd.net
Wed Oct 31 11:48:18 UTC 2018


On Wed, Oct 31, 2018 at 12:06:24PM +0100, Tom H wrote:
> On Tue, Oct 30, 2018 at 4:03 PM Colin Law <clanlaw at gmail.com> wrote:
> > On Tue, 30 Oct 2018 at 14:51, Chris Green <cl at isbd.net> wrote:
> >> On Tue, Oct 30, 2018 at 01:39:13PM +0000, Colin Law wrote:
> >>> On Tue, 30 Oct 2018 at 13:33, Chris Green <[1]cl at isbd.net> wrote:
> >>>
> >>> I want to put some temporary html files in /tmp (well, a
> >>> sub-directory of /tmp) and view them using apache2. I always get
> >>> permission denied and it seems as if apache2 refuses to access any
> >>> files in /tmp.
> >>>
> >>> Could possibly be that the apache systemd script specifies privateTmp
> >>
> >> Yes, I think that's it (or at least it's something to do with
> >> systemd). Whatever, it's a real nuisance.
> >>
> >>
> >> Where can I put files that apache can 'see' and which will get cleared
> >> out at intervals?
> >
> > It should be easy enough to change the systemd startup script, it will
> > likely be in /etc/systemd/system.
> 
> In "/lib/systemd/system/" not in "/etc/systemd/system/" by default.
> 
> 
> > Make a copy of it with a different name and edit that, then disable
> > the usual one and enable yours. If you don't make a copy then it will
> > get overwritten when you update.
> 
> "systemctl edit <unit>" will set up a
> "/etc/systemd/system/<unit>.d/override.conf" drop-in automatically.
> 
I have two files which seem relevant:-

    /lib/systemd/system/apache2.service
    /lib/systemd/system/apache2.service.d/apache2-systemd.conf

Both of them seem to be 'original' as in installed from my
distribution and not changed since.  

I assume the name 'override.conf' isn't actually important and
anything in /etc/systemd/system/apache2.service.d will be acted upon
by systemd. 

Does the override file have to specify everything or can it just
change individual parameters with the rest being set by the files in
/lib/systemd/system?

-- 
Chris Green




More information about the ubuntu-users mailing list