Site is not working after 777 permission to var folder in Magento2 - error-handling

Hi I need to install an extension in Magento 2 and it was throwing error for writable permission in var folder.
I have given 777 permission recursively
and after that the site is not working .
Can you please suggest me how can I reset the permissions to the Magento2 site?

Magento 2 permissions are described here, and '777' is too much. I suppose, you need to clean cached and generated files that can be broken after the installation of your extension was failed:
$ ./bin/magento cache:clean
switch to the development mode, see the errors in logs (./var/log/) then switch back to production mode:
$ ./bin/magento deploy:mode:set developer
$ ./bin/magento deploy:mode:set production

Related

Prestashop - smarty cache not generating any files - chmod set to 777 for cache and subfolders

i am facing problem with prestashop 1.7.3. For some reason my shop on vps server is not generating any cache files. Im using a megamenu module from templatemonster and i need to cache it due hudge number of queries generated to database on each page load. I've found in google that few other shops are generating succesfuly cache for this mod under folder /cache/smarty/cache
Some dev suggested to add a cache folder to my template but that did not worked aslo.
I've set up all folders to chmod 777 (recursive). There is no php erros in logs.
Have somebody any ideas what to do?
Look here :
Log : in app/logs
Cache : in app/cache/dev and app/cache/prod
OR
Log : in var/logs
Cache : in var/cache/dev and var/cache/prod
Regards

nfsnobody User Privileges

I have setup an NFS file share between two CentOS 6, 64 machines. On the server the folder being shared was originally owned by the root user. On the client it turned up as being owned by nfsnobody. When I tried to write to the folder from the client I got a permissions error. So I changed the folder ownership on the server to nfsnobody and chmod'd it to 777. However, still no joy - I continue to get a permissions error. Clearly, there is more to this. I would be much obliged to any Linux gurus out there (I personally wouldn't merit being called anything more than a newbie) who might be able to help fix this issue.
Edit - I should have mentioned that trying to write to the shared folder from the client actually manages to create a file entry. However, the file size is 0 and the permissions error is reported.
The issue here is to do with the entry in /etc/exports. It should read
folder ip(rw,**all_squash**,sync,no_subtree_check)
I had missed the all_squash bit. That apart, make sure that the folder on the server is owned by nfsnobody. On my setup both my client and server nfsnobodies ended up with a user id if 65534. However, it is well worth checking this (/etc/groups) or else... .
Here are a couple of useful references
How to setup an NFS SErver
NFS on CentOS
For the benefit of anyone looking to setup an NFS server I give below what worked for me on my CentOS 6 64bit machines.
SERVER
yum install nfs-utils nfs-utils-lib - install NFS
rpm -q nfs-utils - check the install
/etc/init.d/rpcbind start
chkconfig --levels 235 nfs on
/etc/init.d/nfs start
chkconfig --level 35 rpcbind on
With this done you should create the folder you want to share
mkdir folder
chown 65534:65534 folder
chmod 755 folder
Now define the folder to be shared/exported. Use your favorite text editor (vi or whatever) to
open/create /etc/exports
folder clientIP (rw,all_squash,sync,no_subtree_check)
Client
Install, check, bind and start as above
mount -t nfs serverIP:folder clientFolderLocation
If all goes well you should now be able to write a little script on your client
<?php
$file = $_SERVER['DOCUMENT_ROOT']."/../nfsfolder/test.txt";
file_put_contents($file,'Hello world of NFS!');
?>
browse to it and find that test.txt now exists on the server with the content "Hello world of NFS". In the example I have placed my mounted drive one level before document_root.

PDF getting created with permission 600?

I'm experimenting a weird issue. Most of the time (almost everytime) my pdf are getting generated with the permission (rwx-r--r--) 644 which is correct.
But 'sometimes'.. and I cannot understand why this happens but they get created with permission (rw-------) 600. this cause a "permission denied" when other systems try to copy or read the PDF...
Did someone already had this issue? Is it possible that is it a problem in my Jasper config ? or the Server config ?
Ps: I'm running my web app on an redhat server (container is Weblogic ).
This happens when the program through which you run and generate PDF is in the same permission that is root.
you can run your PDF generating software ( or whatever you are using ) in home user mode and not root user mode)
Or just go to that folder where your PDF has been generated and run from terminal
user#your_folder>> sudo chown username:username *
give password if asked.... You can use this with every file and folder that has this problem
You will see once you run this command a 'LOCK' icon goes away and file/folder becomes normal
Hope this helps you

Cannot set-up MyPHPadmin in Apache

I just started using Apache, but when I try to run myPHPadmin, I get this error message:
1 - Can't create/write to file '/var/folders/w1/5yx2p9mj7w9bm67gdwhqxwsr0000gn/T/#sql1ba_3_0.MYI' (Errcode: 13)
Another post in the Stack Overflow suggested changing the permissions on the XAMPP file, my.cnf, with this command:
sudo chmod 600 my.cnf
I tried running the code in Mac Terminal, but the result was "No such file or directory."
Does anyone know what I should try next?
This is a permission problem on your datadir (where MySQL wants to write files). Normally, at MySQL installation, correct permissions are set for the user who runs mysqld.
Are you sure that MySQL was installed correctly as part of XAMPP installation?

reputation module installation in phpbb3

Hi i am trying to install phpbb-reputation system i followed the xml file for installation but while executing install_reputation.php i am getting this error ERROR: Could not open the file ./styles/afterburnerafterburner_config.html for reading.There are many errors in the same fashin. where i gues it is not going inside afterburner/template folder where .html file exists. where should i check this?
More error samples:
Refreshing the proFormell template
ERROR: Could not open the file ./styles/proFormellcaptcha_recaptcha.html for reading.
Sounds like it's a permissions issue; if hosting on a LAMP server, just run chmod 755 * -R in the website root directory. Alternatively you could also change file permissions using an FTP client