Nginx Laravel Ubuntu Server Composer Update Changed permissions/Not staying - laravel

I have a Ubuntu server running nginx and laravel. I recently had to run a composer update –no-dev and composer-autodump –o. Now I’m getting the error message below when I login.
file_put_contents(/var/www/laravel/storage/framework/cache/data/45/0d/450dd23cd0918654a4bed8a88426d460115cac32): failed to open stream: Permission denied
I reran the command below
sudo chmod -R 777 storage/framework/cache/*
sudo chmod -R 777 storage/*
and I’m still getting the error on initial login. I reload the page after several attempts and it takes me to where I’m trying to go. Does anyone know why this is? Thank you for your help
Is there another command I need to run for the permissions... Thanks

I was able to find the answer from the original guide used.
sudo chmod -R 775 /var/www/laravel/bootstrap/cache

Solution 1:
sudo vi /etc/php/7.2/fpm/pool.d/www.conf
change:
user = www-data
group = www-data
to:
user = vagrant
group = vagrant
Solution 2:
modify Vagrantfile
config.vm.synced_folder ".", "/vagrant/",owner: "www-data", group: "www-data"
owner/group set to www-data, not vagrant

Related

permission denied on installing lxd via snap

I'm trying to install LXD on my Ubuntu via this tutorial https://docs.conjure-up.io/devel/en/user-manual#users-of-lxd in it says I have to follow these steps:
sudo snap install lxd (no problem in installing)
/snap/bin/lxd init (I get the below error)
Error: Failed to connect to local LXD: Get http://unix.socket/1.0:
dial unix /var/snap/lxd/common/lxd/unix.socket: connect: permission
denied
can anyone tell me how to fix it?
Looks like for some reason the permissions on the unix.socket are not correct. (I tried this myself and works fine). The permission on my unix.socket look like this:
srw-rw---- 1 root lxd 0 Nov 7 18:02 unix.socket
I would try:
sudo chown root:lxd /var/snap/lxd/common/lxd/unix.socket
sudo chmod 664 /var/snap/lxd/common/lxd/unix.socket
sudo chmod u+s /var/snap/lxd/common/lxd/unix.socket
If not then it could be an issue with your /var/snap/lxd/common/lxd/ directory. Does it even exist?
Proper way according to Ubuntu page is:
sudo apt install lxd
sudo lxd init
sudo adduser <your-user> lxd
newgrp lxd
Now you are ready to launch:
lxc launch ubuntu:22.04 test

Installation error message with TestLink for Mac

I am trying to install Testlink on OS X for Mac. However, I am getting the following message which will not let me continue with installation. I have seen solutions for other operating systems but not for Mac. I am inexperienced with Mac. Any help appreciated. Thanks!
I resolved it..
chmod 777 /Applications/XAMPP/xamppfiles/htdocs/testlink-1.9.16/gui/templates_c
sudo mkdir /var/testlink/logs/
sudo mkdir /var/testlink/upload_area/
Then give the last two directories writeable permissions:
sudo chmod 777 /var/testlink/logs/
sudo chmod 777 /var/testlink/upload_area/
Check whether the /var/www/html/testlink/gui/templates_c directory is writable (logged with the user used to run the webserver process).
To resolve this issue try to follow steps:
ssh into the machine you are installing
move to the testlink main directory, in my case: cd /var/www/html/testlink/gui
change the permision of templates_c: sudo chmod a+w templates_c
Now try to install testlink again.

Elasticsearch won't start on centos, permission denied

I installed elasticsearch this way :
retrieved the tar.gz on windows, extracted it and put it on a zip
uploaded the zip over ssh on a server and use 'unzip file' to unzip it.
I modified the elasticsearch file so that it has this line
export JAVA_HOME = "/home/xxx/project1/jdk1.8.0_73_linux64"
just below
#!/bin/sh
now when I go into /home/xxx/project1/elasticsearch/bin and type
./elasticsearch
I get
-bash: ./elasticsearch: Permission denied
What could I do to get more information about the problem?
I'm logged as user xxx
Thanks.
The problem is, that you've installed elastic being logged in as root. Now you're surely logged in as not root. If you're working as a user with root privileges, you potentially could start elastic, but it tells you, you can't run in as root. The owner of your elastic folder is root (he installed it). So, all you need to do is to change the owner of a folder to your xxx-user (to let him run elastic). You can easily do it executing a command:
chown -R new_owner path
for example, user is xxx and path is /opt/elasticsearch-2.3.5:
chown -R xxx /opt/elasticsearch-2.3.5
"-R" parameter ensures, that not only folder, but all files inside will recursively change the owner you provide.
Try to install using the package Yum Install for elasticsearch.
Else try: Its sounds like the user permission to access the files.
Ensure that you have downloaded the linux distribution (Optional) Since you have mentioned its tar.gz.
If you have extracted using sudo command then you need to change the user permission for elasticsearch folder to logged in user OR start the elasticsearch using sudo command
sudo ./elasticsearch -d
Check the execution permission if not please do the same by following command
sudo chmod +x /home/xxx/project1/elasticsearch/bin/elasticsearch.sh
Try this things if not please create a chat window and invite me.
Looking ahead I will immediately say that the ES app doesn't work using the sudo
In my case with ES 6.8.1 version on ubuntu i solved the problem using this steps:
Add the current user(or any other) to ES group:
sudo adduser <yourName> elasticsearch
Add possibility to execute ES:
sudo chmod +x /usr/share/elasticsearch/bin/elasticsearch
Then i changed owner of some paths**, in my case these were:
sudo chown -R <yourName>:elasticsearch /etc/default/elasticsearch
sudo chown -R <yourName>:elasticsearch /etc/elasticsearch
sudo chown -R <yourName>:elasticsearch /var/log/elasticsearch
**I started the application several times and then looked where I had no permission
Then i started ./usr/share/elasticsearch/bin/elasticsearch and saw the long-awaited JSON on port 9200 :)
Hope this will help someone.

Laravel Homestead permission denied to .bash_aliases

I just setup a vagrant box using laravel/homestead on Mac OS 10.9. I get the following error after I connect via SSH:
-bash: /home/vagrant/.bash_aliases: Permission denied
Haven't seen this when I provisioned on my Windows setup. What could be causing it?
To fix this I just did the following, though I can't figure why this was necessary to begin with:
sudo chown $USER:$USER ~/.bash_aliases

" Existing configuration file (./config.inc.php) is not readable. "?

just installed XAMPP on my Mac. When I was trying to modify the upload dir in config.inc.php it says that the file was locked, and can't be unlocked due to the fact that I don't have permission to modify the folder. So I changed the my permission to the folder, and file was not locked anymore but I can't access 'phpmyadmin' anymore in my browser via http://localhost/phpmyadmin/, everytime I try, it says "Existing configuration file (./config.inc.php) is not readable."
I googled the solution, from this page, it says to use chown root:cpanelphpmyadmin config.inc.php to change the permission of the file. I did, but it says chown: cpanelphpmyadmin: Invalid argumentin my terminal window. I am get desperate here, anyone help me, please!
by the way, I tried deleting everything in the XAMPP folder in App folder, and create a new one, it doesn't work
rasel#rasel-Dell:~$ sudo -s
rasel#rasel-Dell:~$ type your password
root#rasel-Dell:/# cd /opt/lampp/phpmyadmin
root#rasel-Dell:/opt/lampp/phpmyadmin# chmod 644 config.inc.php
root#rasel-Dell:/opt/lampp/phpmyadmin# cd /
root#rasel-Dell: /opt/lampp/lampp restart
That's all, it works for me.
For OSX Mavericks and XAMPP 1.8.2-5 and 1.8.3-4 versions, you need to use the same chmod 644 mentioned above, but the directory is different.
cd /Applications/XAMPP/xamppfiles/phpmyadmin/
sudo chmod 644 config.inc.php
[enter your password]
I have solved the problem by creating a new config.inc.php file, copying all of the original locked config.inc.php content there and modifying the line
$cfg['Servers'][$i]['password'] = 'myserverpassword';
and deleting the original locked file. This is in case you are looking for changing the XAMPP configuration file so that you can access the servers where you have put a new password.
cd /Applications/XAMPP/xamppfiles/phpmyadmin/
sudo chmod 777 config.inc.php
[enter your password]
After you change your config.inc.php, you need to type:
sudo chmod 644 config.inc.php
Only sudo chmod 644 didnt work for me.
If you are using ubuntu 14.04 what you actually need to do is:
Go to terminal
type --> sudo nautilus
a file dialogue will be opened.
navigate the folder to computer/opt/lampp/phpmyadmin/config.inc.php
open the file
check for $cfg['Servers'][$i]['password'] = '';
change the above LOC to $cfg['Servers'][$i]['password'] = 'root';
and try opening the phpmy admin. Your problem will be successfully solved.

Resources