Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in exception handler #271

Closed
JulienAerts opened this issue Oct 1, 2014 · 5 comments
Closed

Error in exception handler #271

JulienAerts opened this issue Oct 1, 2014 · 5 comments

Comments

@JulienAerts
Copy link

Hi ,

I know this issue was already discuss many time .But i follow everything and i read other issues . I applied correctly the permission to the storage folder . I follow advice from technogenius ...but i always get this error .

I have a version running on iis and i didn't have any issue with permission .

Now i'm trying to set-up this on centos.

Error in exception handler: The stream or file "/var/www/snipe-it/app/storage/logs/log-apache2handler-2014-10-01.txt" could not be opened: failed to open stream: Permission denied in /var/www/snipe-it/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:80

thank you for your support .

@adam820
Copy link

adam820 commented Oct 1, 2014

You may want to check if SELinux is enabled (it is, by default, on most CentOS installations). If so, even if the folder/file has the right permissions, if it doesn't have the right security context, access will still get denied. You can check it's status by running getenforce from the command line, as a root user.

If it says Enabled, you can temporarily set it to Permissive by running setenforce 0, If this clears up the issue, you either need to disable SELinux (not recommended), or attempt to set the correct security context on the files (most likely with a restorecon -R /var/www/snipe-it, which will attempt to set the correct default http contexts for the files and directories below it, recursively).

@technogenus
Copy link

This error is likely due to incorrect read/write permissions on the storage folder. The easiest way to fix the permissions is to set apache as the group for the whole folder structure then set permissions to 754 for the whole directory, then set permissions 774 for the app/storage folder. Of course, this assumes you have a standard, out-of-the-box apache install which runs using an account in the apache group.

Apache, PHP and SnipeIT work fine under SE Linux, but there is an extra step needed if you are running CentOS 7.0+. You can find a full step-by-step for Centos and a completely AUTOMATED installer script here:
http://www.cordeos.com/snipeit

@JulienAerts
Copy link
Author

Hi thank you for your reply , i'm using centos7 so i will take the time to follow the guide from technogenus .I check Se Linux and it's in enforcing mode like it should . My folders and files seems to have the good security context .

@JulienAerts
Copy link
Author

Thank you for your support guys ! I was now able to make it work . i follow the guide from http://www.cordeos.com/snipeit for CentOS 7.0.

You can close this issues .

@JulienAerts
Copy link
Author

For more explication on my side , i think this is what was missing :
To leave SELINUX security in place, you will need to make the following change to its behavior in CentOS 7.0
setsebool -P httpd_unified 1

diwanicki added a commit to diwanicki/snipe-it that referenced this issue Nov 23, 2014
clarification of where to actually install and run composer commands; added SELinux fix from issue snipe#271; additional cleanup of application key generation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants