PHP access to error.log and access.log outside openbase directory and root owned.

Discussion in 'General' started by Mark99Mark, May 31, 2024.

  1. Mark99Mark

    Mark99Mark New Member

    I have a fully working ISPConfig Version: 3.2.11p2, Debian Bookworm, apache2 virtual website, set-up with PHP 8.0 and an eCommerce solution.

    I have a php firewall plugin that requires reading of the above two files (error.log & access.log, access log already looking like a symlink) that exist out side of the .web directory and appear to be owned by root.
    ISPConfig is set for: Own error documents.

    I could not find a prior post relevant to this so ask here.
    I am not IT based and have a limited knowledge.

    I'm guessing that I need symlinks or readlink? to the files residing in .log directory under .web base directory to bring in a copy with new [Permissions] owned by the web_user into the .web/log directory so that it can be read by the firewall in the webspace.

    I'm sure there are some security issues with reading the system error log but I am unconcerned as I'm only hosting myself.
    I do not believe write access is needed to the files.

    I could muck around for weeks and not get this right.
    Could somebody help?

    Mark.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    These are not symlinks. These are BIND-Mounts to allow access from within a jail. You can find the matching folders that they are mounted from in /etc/fstab file.

    Which is not related to log files. This is about using or not using own error pages in web/error/ folder.

    No, that's not the case, as no symlinks are used and bind mounts of the folder do not require any special permissions.

    You can read the files from any PHP application within your websites without needing any special permissions. You just have to take care to add the log folder to open_basedir path in PHP, which you can do on the options tab of the website.
     
    ahrasis likes this.
  3. Mark99Mark

    Mark99Mark New Member

    Thankyou Till, for always having the time to reply.

    This is most helpful, I now have a new googling to do. Mark
     

Share This Page