Why can't apache access files in /tmp?

Colin Law clanlaw at gmail.com
Tue Oct 30 15:00:25 UTC 2018


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.  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.
I did see mention that there could be security risks with that though, so
you might like to check on that.

Otherwise put the files somewhere else and have a cron script that cleans
it occasionally.

Colin

>
> --
> Chris Green
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20181030/3ef036df/attachment.html>


More information about the ubuntu-users mailing list