Recursive write permissions for Apache user - ssh

Hello I am trying to install Prestashop on my LAMP server via SSH but when run the installation process. I got these error.
The Prestashop files are located in /var/www/html What should I do?

Thanks Morris Mukiri,
I tried all the chmod, chown, chgrp , but the prestashop error message still there .
Your suggestion of "allow apache do writes" worked !
setsebool -P httpd_enable_cgi on
setsebool -P httpd_unified on
setsebool -P httpd_builtin_scripting on
These few lines did the magic.

Find the Apache user and change the owner of the folders recursively.
E.g., if the Apache user is apache then:
chown -R apache:apache /var/www/html/config /var/www/html/cache...

Change the permissions for the document root folder
sudo chmod -R 755 /var/www/html/
You might want to add yourself to the same group as apache using
useradd -G {group-name} username
Try adding a rule in Selinux to allow apache do writes
sudo setsebool -P httpd_enable_cgi on
sudo setsebool -P httpd_unified on
sudo setsebool -P httpd_builtin_scripting on

Related

{Done] Permissions for Data folder on external Harddrive

So i reinstalled Nextcloud on my Pi, because i got now an external harddrive to connect. So i used:
sudo ln -s media/pi/Elementals/Nextcloud/data /var/www/nextcloud/data
and i changed the the owner inside var /www/nextcloud to www-data for the data folder there.
Still i cant install it. I tried to change the owner of /media/pi/Elementals/Nextcloud/data. But cant change it.
im using:
chown -R www-data:www-data data/
Even thos when i use:
sudo -u www-data bash
and then create a folder its owned by pi.
What i did wrong ?
Got it:
used fstab used there ntfs-3g
I think you forgot to add sudo the command should be
sudo chown www-data /path/to/data/

file permission magento2 app/etc

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

Warnings and errors appearing on site after changing ubuntu user permissions Amazon EC2 server

My site is running on a EC2 Amazon server under Ubuntu/Apache2.
My site was running fine until I changed the permissions for user 'ubuntu' by doing this command:
chown -R ubuntu /var/www/html
Now my site is spitting out warning messages and errors :(
www.kaysboutique.co.uk
I did this because I wanted to be able to write files via FileZilla after following this answer:
Amazon AWS Filezilla transfer permission denied
Fixed by running these:
sudo chown www-data -R /var/www/html
If not fixed, run sudo chown -R www-data /var/www/html
First to fix the pb try to restore the initial user and group for html directory by using this command :
sudo chown -R www-data:www-data /var/www/html
And if you need to add new user to www-data group use this command :
sudo useradd -g www-data [username]
sudo passwd [username]

Apache File permissions issue in Ubuntu

I'm trying to use Apache to access a file on my Documents folder.
I tried the following:
sudo chown -R www-data:www-data /home/$USER/public_html
sudo adduser $USER www-data
sudo chmod -R 775 /home/$USER/public_html
As suggested by this post:
https://askubuntu.com/questions/26848/permissions-issue-how-can-apache-access-files-in-my-home-directory
Although this works, now I cannot edit or the files directly as the user (without using sudo), despite being a member of the www-data group. The only solution that seemed to work is using chmod -R 777 (which I rather not do).
Turns out all I had to do is restart the OS and it was sorted!

ubuntu : can't cd to /var/www despite being in www-data group

Am trying to set up a web site in an apache2 www folder on ubuntu 12.04 LTS.
Installed the LAMP as per the manual: sudo apt-get install lamp-server^
Then have done:
$ usermod -g www-data myuser
$ sudo chown -R www-data:www-data /var/www
$ sudo chmod -R go-rwx /var/www
$ sudo chmod -R g+rw /var/www
$ sudo chmod -R o+r /var/www
So, was going to copy files into www..
But when I (as myuser) try to
$ cd /var/www
I get :
-bash: cd: /var/www: Permission denied
Not sure what to do now...myuser is in the www-data group...
But, one thing that might not be right is that my user is only in sudo and www-data... should it be in users as well?
Thanks
You need to add executable permissions to a folder in order to be able to cd into it.
So, you should have done:
$ sudo chmod -R g+rwx /var/www