Nginx FastCGI Fix Permission

Overview

Nginx FastCGI Fix Permission

Table of Contents

About

This library was born with the objective of fix the permissions of the folder that nginx automatically generates, to store the cache of your site.

In our case, originally the cache folder comes out like this:

ls -lsa
4 drwx------  2 nobody root 4096 Mar  4 17:54 cache_folder

The problem with this is that if you have a procedure on your site to clear the cache, such as the Nginx Cache plugin for Wordpress, your user will not will be able to clear the contents of the cache folder.

How it works

We set up our script to run on a hook called ExecStartPost on the Nginx service.

With that, after nginx starts or restarts, our script is run, fixing the folder permissions to what we want.

Installation

  1. Open the folder where you want to install the project and run: composer require ejetar/nginx-fastcgi-fix-permission

  2. Then edit the following file: /lib/systemd/system/nginx.service. Add the following line in the [Service] section ExecStartPost= /nginx-fastcgi-fix-permission/fix .
    Example:

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /var/run/nginx.pid)"
ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /var/run/nginx.pid)"
ExecStartPost=/opt/nginx-fastcgi-fix-permission/fix

[Install]
WantedBy=multi-user.target

[Service]
LimitNOFILE=65535
  1. Execute systemctl daemon-reload
  2. Restart nginx and you're done!

Changelog

Nothing for now...

Contributing

Contribute to this wonderful project, it will be a pleasure to have you with us. Let's help the free software community. You are invited to incorporate new features, make corrections, report bugs, and any other form of support. Don't forget to star in this repository! 😀

License

This library is a open-source software licensed under the MIT license.

You might also like...
A tool to automatically fix Twig Coding Standards issues

Twig CS Fixer Installation This standard can be installed with the Composer dependency manager. Add the coding standard as a dependency of your projec

Plugin to diagnose/fix ClassicPress SSL issues.
Plugin to diagnose/fix ClassicPress SSL issues.

ClassicPress SSL Fix This plugin provides a way to work around the issue "cURL error 60: SSL certificate problem: certificate has expired" in ClassicP

Debug with Ray to fix problems faster
Debug with Ray to fix problems faster

Debug with Ray to fix problems faster This package can be installed in any PHP application to send messages to the Ray app. The desktop app: can be us

A tool to automatically fix PHP Coding Standards issues by Dragon Code.

A tool to automatically fix PHP Coding Standards issues by Dragon Code.

This Laravel package merges staudenmeir/eloquent-param-limit-fix and staudenmeir/laravel-adjacency-list to allow them being used in the same model.

This Laravel package merges staudenmeir/eloquent-param-limit-fix and staudenmeir/laravel-adjacency-list to allow them being used in the same model.

A tool to automatically fix PHP Coding Standards issues by Dragon Code.

The Dragon Code Styler Installation Required PHP: ^8.0 Composer: ^2.0 Locally composer global require dragon-code/codestyler Usage When you run the co

A tool to automatically fix PHP Coding Standards issues
A tool to automatically fix PHP Coding Standards issues

PHP Coding Standards Fixer The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP codi

Container Open Inventory ID send bug fix PocketMine-MP plugin

ContainerOpenFixed Container Open Inventory ID send bug fix PocketMine-MP plugin Example use skh6075\containeropenfixed\IWindowType; use pocketmine\ne

Implementation Package Spatie/Laravel-Permission

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

permission generation for all your declared routes with corresponding controller action

Permissions Generator This package add some artisan command to help generating permissions for your declared routes. Each route should have an alias (

A WordPress plugin for managing user permission, education, and communication.

A WordPress plugin for managing user permission, education, and communication. Texas A&M University System

User role and Permission Management system with Paticie package

User role and Permission Management system with Paticie package Installation instruction Download or git clone https://github.com/KKOO727/User-role-ma

This package helps you to associate users with permissions and permission groups with laravel framework
This package helps you to associate users with permissions and permission groups with laravel framework

Laravel ACL This package allows you to manage user permissions and groups in a database, and is compatible with Laravel v5.8 or higher. Please check t

The easiest and most intuitive way to add access management to your Filament Resource Models through `spatie/laravel-permission`
The easiest and most intuitive way to add access management to your Filament Resource Models through `spatie/laravel-permission`

Filament Shield The easiest and most intuitive way to add access management to your Filament Resource Models (more coming soon 😎 ) One Plugin to rule

A user, group, role and permission management for Codeigniter 4

CI4-Auth CI4-Auth is a user, group, role and permission management library for Codeigniter 4. CI4-Auth is based on the great Myth-Auth library for Cod

Plugin Notify OP Or Staff Has Permission antixraype.check when someone breaks ore

General Plugin Notify OP Or Staff Has Permission antixraype.check when someone breaks ore If the message repeats many times, check if the player is us

A PocketMine-MP plugin which allows the users to edit no permission message of commands
A PocketMine-MP plugin which allows the users to edit no permission message of commands

CommandPermissionMessage A PocketMine-MP plugin which allows the users to edit no permission message of commands Have you ever got bored by the red me

Admin user, role and permission management for Laravel Filament
Admin user, role and permission management for Laravel Filament

Filament Access Control Opinionated setup for managing admin users, roles and permissions within Laravel Filament Features Separate database table for

Yet another asynchronous permission management plugin for PocketMine-MP.

GroupsAPI Yet another asynchronous permission management plugin for PocketMine-MP. Features Developer-friendly API Temporary rank/group support Multip

Owner
Ejetar
Ejetar
User role and Permission Management system with Paticie package

User role and Permission Management system with Paticie package Installation instruction Download or git clone https://github.com/KKOO727/User-role-ma

Ninja 2 Mar 4, 2022
This package helps you to associate users with permissions and permission groups with laravel framework

Laravel ACL This package allows you to manage user permissions and groups in a database, and is compatible with Laravel v5.8 or higher. Please check t

Mateus Junges 537 Dec 28, 2022
The easiest and most intuitive way to add access management to your Filament Resource Models through `spatie/laravel-permission`

Filament Shield The easiest and most intuitive way to add access management to your Filament Resource Models (more coming soon ?? ) One Plugin to rule

Bezhan Salleh 329 Jan 2, 2023
A user, group, role and permission management for Codeigniter 4

CI4-Auth CI4-Auth is a user, group, role and permission management library for Codeigniter 4. CI4-Auth is based on the great Myth-Auth library for Cod

George Lewe 15 Dec 16, 2022
Yet another asynchronous permission management plugin for PocketMine-MP.

GroupsAPI Yet another asynchronous permission management plugin for PocketMine-MP. Features Developer-friendly API Temporary rank/group support Multip

null 19 Nov 28, 2022
Tools for checking malware, permission of file php and any on website

webtools Tools for checking malware, permission of file php and any on website You can use the webtools.php file directly. All features can be accesse

ForDeveloperTools 3 Jun 14, 2022
Hierarchical Rol-Permission Based Laravel Auth Package with Limitless Hierarchical Level of Organizations

AAuth for Laravel Hierarchical Rol-Permission Based Laravel Auth Package with Limitless Hierarchical Level of Organizations Features Organization Base

Aurora Web Software Team 23 Dec 27, 2022
Command-line control panel for Nginx Server to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt

EasyEngine v4 EasyEngine makes it greatly easy to manage nginx, a fast web-server software that consumes little memory when handling increasing volume

EasyEngine 2k Jan 4, 2023
Magento-Vagrant-Puppet-Nginx - Installs magento and a nginx server

Magento-Vagrant-Puppet-Nginx Installs Magento MySQL PHP PHP-FPM Nginx n98-magerun Setup git submodule init git submodule update vagrant up Modify pupp

Christian Münch 61 Aug 10, 2022
A tool to automatically fix PHP Coding Standards issues

PHP Coding Standards Fixer The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP codi

null 11.6k Jan 3, 2023