Yii web application ownership and permissions - linux

I have a php application uploaded on my server. It is written in yii framework.
www-data is the owner and group of the project root folder.
permission is set currently to 775 recursively.
but app is not working. I get following error in the browser:
Not Found
The requested URL /task/site/login was not found on this server.
Any idea how can I correct the situation?

Related

Node.js web application => Error: EACCES: permission denied, open '/opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-scripts/error.log'

When I was developing my web application in my VSCode, everything was working perfectly fine. Then I deployed it to my web hosting service and I get this error. Does anyone know how I can fix this issue?
This particular web application (Node.js application) is deployed on a subdomain whereas I have another application on my main domain created with React.js that does not encounter this issue.
This is my first time asking dev questions, so if there's any further information needed, just ask :)
The error on my website
As you see, this is permission error.
If my guess is right, it seems you developed on windows and going to deploy it on Linux server.
Usually, you don't get permission error on windows but on Linux, we often see that kinds of permission errors.
try this
chmod 777 (directory path of log file)
for example, if you are on Ubuntu, and the log file is in "share/log/log.txt"
sudo chmod 777 share/log -R
check this link here

apache2 on ubuntu webserver rejects permission to access any other file than the delivered index.html

I am trying to set up a webserver running on Ubuntu. I have installed Apache and changed the root directory to an other directory within /var/www/. When I copy the index.html provided by Apache to that directory, I can access that file via remote webbrowser. But if I want to use a different index.html file, even really basic ones, I get an error: "Forbidden You don't have permission to access this resource". I have also tried to download that html, alter just a few lines and put it back on to the server with the result that it also shows that error. If I rename the initially provided index.html to index2.html I can still access it. I do not understand how it is possible that only this exact file is working.
I have tried to grant more permissions with Directory and restarted Apache but it won't work. I am rather new to Linux and Apache, can only use the terminal on my webserver and I do not know what else to do. Please help.
Change the permissions on the file, too, not just the folder. Pretty sure this fix it.
For diagnostic correction, allow permission for all by typing:
sudo chmod -R 777 /path/to/index.html

Folder permissions to Nodejs Express + Apache with Proxy

I have a Linux Ubuntu with Apache serving files (PHP app) from "public/" folder. Inside this folder (public/node/), I have a nodejs express running via Apache ProxyPass/ProxyReverse. Everything works. But when I try to upload a file with the nodejs application (a simple/small API) and save to "public/node/fileupload", I got an error:
code: "EACCES"
errno: -13
This directory (and all others inside public/) has 775 permissions, and the user that started the nodejs application (my own user, not root) is at the same group as Apache (www-data).
If I change the public/node/fileupload directory permission to 777, the upload works and the owner of file is the user that started the nodejs express (my own user, as said above). But, you know, set a directory as chmod 777 is not a good choice.
Do you know how can I avoid the use of chmod 777 on "public/node/fileupload" to allow file upload to a configuration like this?
Thank you in advance.

Apache: wrong owner and permission of uploaded file

I have a website running on apache server.
Yesterday, I logged in to my server and restarted passenger, apache server.
I restarted using command:
touch /tmp/restart.txt
After that, I noticed that the new uploaded files are changed ownership to paelz (my username) and permission to -rw-------. The files were uploaded by some other users using the website.
The older files has owner apache and permission: -rw-r--r--.
As a result, the website cannot load the new uploaded files. However, it can load the older ones.
If I run chmod 644 on the new uploaded files, the website can load the files normally. However, I want a permanent solution.
I want the new uploaded file owned by apache and has permission as the old ones.
My question is what caused this issue and how can I fix it.
Finally I found the answer.
It is not related to apache. It is related to passenger instead.
https://stackoverflow.com/a/4232091/1319283
By default, passenger will run your app as the user who owns the
config/environment.rb or config.ru file, see
The config/environment.rb is owned by my account so passenger will run the app as my account.

Permission about apache files

I have a really strange problem about the permission of Apache. When I copy a directory or file to /var/www/html and visit it from my browser, it says I don't have permission. But when I make a new directory or file with the exactly same name, path, owner, group and permission, I can visit it from my browser.
The owner of the file is root and the permission of it is -rw-r--r--. I used to try some more open permission but is doesn't work, too.
By the way, my system is centos 6.0.
Check for directory settings in apache config files. You can look for details here; http://httpd.apache.org/docs/current/mod/core.html#directory

Resources