All emails in my Magento 1.9.2.4 shop : invoice , new registration , contact us.... not work. I recive error log 403.
I haven't make any changes on the site. Can the reason be in the cPanel?
You can run the following commands:
find ./ -type f | xargs chmod 644
find ./ -type d | xargs chmod 755
chmod -Rf 777 var
chmod -Rf 777 media
Related
I am trying to install magento2 on a CentOS server. I am continuously getting permissions issue, the magento diretory is owned by apache and I set permissions to 777 (i know it is bad but just to test) but I still get permissions denied on file write. the path to magento dir is /var/www/html. I set permissions to /var/www/ and all sub-folders to 777 and file owner to apache still same.
also
egrep -i '^user|^group' /etc/httpd/conf/httpd.conf (returns)
User apache
Group apache
any suggestions or ideas, please?
Kind Regards
Sajid
Try following steps
sudo /usr/sbin/groupadd wwwrun
sudo usermod -g wwwrun test
cd /var/www/html/magento2 && sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; && sudo chown -R apache:apache . && sudo chmod u+x bin/magento
where test is the current logged-in user and then restart the http server.
Hi I am trying to install magento2 on a vps centos
I followed the instructions about file permission in magento documentation
http://devdocs.magento.com/guides/v2.0/install-gde/prereq/file-system-perms.html
I got the same erorr while installing :
/var/www/html/magento2/app/etc" Not writable, change the permissions.
Do I need to restart apache after I change some permissions.
Thanks for help.
If you are using the setup wizard, it will ask you for permission to write to the app/etc/env.php
I would advise you to use the bin/magento cli tool to setup the app:
php bin/magento setup:install
But it is fine to temporary allowing the web server to write to your env.php, after the UI wizard finished you can change it back to the correct file permission.
For this you need to clear cache.
php bin/magento cache:flush
or you can switch to the developer mode
php bin/magento deploy:mode:set developer
Use below commands to set permissions and then restart apache:
sudo usermod -g wwwrun <yourusername>
cd /var/www/html/magento2 && sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \; && sudo chown -R apache:apache . && sudo chmod u+x bin/magento
You need run this code:
chcon -R -t httpd_sys_rw_content_t /var/www/html/magento2/
chmod -R a+w /var/www/html/magento2/
Note: Magento2 is folder where you was install magento
I've installed Xenforo on my digitalocean VPS running CentOS 7, I get this error as soon as I open the web page. `The following errors occurred while verifying that your server can run XenForo:
The directory /var/www/html/data must be writable. Please change the permissions on this directory to be world writable (chmod 0777). If the directory does not exist, please create it.
The directory /var/www/html/internal_data must be writable. Please change the permissions on this directory to be world writable (chmod 0777). If the directory does not exist, please create it.
Please correct these errors and try again.
How would I change the permission for the directory so it can be world writable?
Basically data and internal_data are directories in which the user running Xenforo should be able to write, because they will contain attachments, avatar, and other files.
Usually the user running PHP on Apache or Nginx is www-data in the group www-data (user and group have the same name), so all you have to do is letting this user to write on data and internal_data:
chown -R www-data.www-data /var/www/html/data /var/www/html/internal_data
If you want to follow literally the advice given in the error message you can do this instead:
chmod -R 0777 /var/www/html/data /var/www/html/internal_data
But as others commented, this approach is more insecure, because it will permit any user in the system to write in data and internal_data directories.
This is what is recommended for Xenforo 2 on nginx on CentOS per CentMinMod & Xenforo documentation. It is required to do it like this or Xenforo2 will not work. I have used this on multiple sites without issue. Make a backup first to be safe.
find /home/nginx/domains/domain.com/public/ -type f -print0 | xargs -0 chmod 0644;
find /home/nginx/domains/domain.com/public/ -type d -print0 | xargs -0 chmod 0755;
find /home/nginx/domains/domain.com/public/internal_data/ -type f -print0 | xargs -0 chmod 0777;
find /home/nginx/domains/domain.com/public/data/ -type f -print0 | xargs -0 chmod 0777;
find /home/nginx/domains/domain.com/public/internal_data/ -type d -print0 | xargs -0 chmod 0777;
find /home/nginx/domains/domain.com/public/data/ -type d -print0 | xargs -0 chmod 0777;
chmod 0750 /home/nginx/domains/domain.com/public;
With this command I can set all file and folder in "img" to 0775:
chmod 775 -R /var/www/site.com/img/
But would I like change only the file inside the folder img; how can I do?
And for change only the folders?
Thanks
ok,
To recursively change dirs or files rights
find /root/path -type d -print0 | xargs -0 chmod 755
find /root/path -type f -print0 | xargs -0 chmod 644
I was able to access and view the files when i first set it. i then realize that my css sheet was not running so i check the source code in Firefox and realize that i didn't have permission to view this file. so i decided to run a permission on the entire www folder.
Now im getting a 403 error. i tried changing back the permission but still having the same problem. i tried
find /var/www/ -type d -exec chmod 755 {} \;
find /var/www/ -type f -exec chmod 644 {} \;
these didn't work, please help
sudo chmod 0777 -R /var/www
-R is recursive, I assume that your web files are located in /var/www.