Unable to check htaccess file - apache

I am new to php and drupal. After i completed work on site in locally i run it but shows below error in log/error.log
Permission denied: [client 127.0.0.1:37590] AH00529: /home/user/public_html/domainname.com/public/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/home/user/public_html/domainname.com/public/' is executable
I gave 777 permission to public folder below like this
chmod -R 777 public/
after i googled i changed the permission to .htaccess file
chmod 644 .htaccess then
I gave permission to parentdirectory (public) folder
chmod 755 public/
then again i installed new one locally(new site) but it shows the same error
but still it shows same error.
Can any one help me from this?

Open the httpd.conf (or apache2.conf) file and search for the User and Group directives. The values here refer to the user/group which will be used for Apache server.
Next, go to /home/user/public_html (or /home/user/public_html/domainname.com whichever is the DOCUMENT_ROOT) and do this:
sudo chown -R USER:GROUP ./
where USER and GROUP are the values of User and Group directives from above. Once that is done, set the htaccess file permissions to 0644 and try.

Related

Giving Apache permission on Joomla folder

I have a Joomla site that the files is owner by root:root. But this way I can't update or install any plugins on Joomla. However when I set de folder's site to the apache owner the site downs return ERROR 500.
How could I fix it?
I've tried set apache owner end set the permissions like below:
chown apache:apache /var/www/html/site
chmod -R 755 /var/www/html/site
Ps.: The site was migrated from another server where the owner of the files is the apache.
Simply run apachectl -S as root or sudo (sudo apachectl -S) and look at the lines which tell User and Group owner.
Other solution, typing the command ps faux will tell you what you need at first column the owner of the process you want to know about.
Also, htop command could help you as same as before if it is installed.
EDIT :
you can also specify -R to do recursive with chown command
I found out the solution. Was just the permissions on files the problem. I don't know why, but when I moved the files of site to another server the folders change the permissions 755 to 655. Changed this permissions everything cames back to normal.
Thanks again!

Symfony, cache error on app_dev.php, and error 500 on app.php

If I try to load directly:
www.myappurl.com/app_dev.php
I have the error:
RuntimeException in ClassCollectionLoader.php line 239:
Failed to write cache file "/var/www/html/myapp/app/cache/dev/classes.php".
If I try to
www.myappurl.com/app.php
I got an 500 error with a blank page.
When I try to load just "www.myappurl.com" it just load the default Apache testing page, saying all is ok, but it doens't redirection to app.php
I've tried everything from
symfony2 : failed to write cache directory
and
Unable to write cache symfony2
I did all that says here:
http://symfony.com/doc/current/book/installation.html#book-installation-permissions
I've made an exact copy from another server to this one, same config, but here I can't load the app.php.
Any help?
EDIT: This is httpd.conf:
https://pastebin.com/dH27ZU2U
The cache error: I had a similar issue and was able to resolve it by ensuring that I had the correct ACL (Access Control List) permissions set. You can investigate your ACL settings by navigating to the directory in question via terminal (if you are using a mac) or some other command line tool and running the command "ls -l". You should see something similar to this next to your file name: "-rw-r--r--+" If you do not see the '+' symbol, then your ACL permissions are not set up properly. Rerun the permissions commands from https://symfony.com/doc/current/setup/file_permissions.html with the addition of -R to apply the permission to all existing files targeting the cache directory specifically. This worked for me, I hope that it helps you.
These Commands are for Symfony 3. If you are using Symfony 2, please update directory var/cache to app/cache
HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1)
sudo chmod -R +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var/cache
sudo chmod -R +a "$(whoami) allow delete,write,append,file_inherit,directory_inherit" var/cache
The app.php error: It's hard to tell what the issue is without more information, but here are a few suggestions that I can make based on what I see posted:
Update line 164 in your httpd.conf to this "DirectoryIndex index.html
app.php" and restart apache. This will allow apache to read your app.php file without writing app.php explicitly in your url. www.myappurl.com
Make sure that you have deleted or changed the permissions of app.php file in your project. The file should be located in the web folder and the permission should be -rw-r--r-- (find this by running ls -l command)
Hope that this helps!

Drush make directory is not writable

I am running a drush make and getting the following error
Directory /Applications/MAMP/htdocs/geoslate/sites/default exists, but is not writable. Please check directory permissions. [error]
Unable to copy /tmp/make_tmp_1365076314_515d695acefc3/__build__/sites/default to ./sites/default. [error]
Cannot move build into place
I am not an expert on permissions in the terminal, can you give me a hand to give the directory the write permisions. I have tried chmod -w /Applications/MAMP/htdocs/geoslate/sites/default and chmod u+x /Applications/MAMP/htdocs/geoslate/sites/default
chmod +w <directory> solved the problem

File writing permission denied in mod_wsgi deployed app

I'm trying to deploy a Pyramid app using mod_wsgi on Apache.
I get IOError: [Errno 13] Permission denied on templates folder, where mako caches his templates, even if I grant write permissions to anybody.
If I remove template caching from my ini file the site runs flawlessly.
I also tried running Apache as the user owning the folder instead of www-data with no luck.
Any clue?
It's an Apache permission issue,
I had to change owner of folder to www-data user and set permissions to 775
chown -R www-data:www-data ~/data
chmod -R 775 ~/data
Also see here but note for Mako 664 permissions will not be enough

cd'ing permissions denied after enabling root user on mac os x 10.6.4

I enabled root in terminal by sudo passwd root and then attempted to cd a rails site folder located on my desktop. I got the error -bash: cd: /Users/fred/Desktop/sitefolder: Permission denied
How to get rid of this error/ enable all permissions for root? Thanks
Are you sure you called cd as root?
If yes, check if the owner of the folder is root. If not call
sudo chown /Users/fred/Desktop/sitefolder root
then check if the owner has reading permission. If not call
chmod 744 /Users/fred/Desktop/sitefolder
(this enables all permissions for owner and only reading permission for group and others). If you don't care much about that folder you may instead call directly
sudo chmod 777 /Users/fred/Desktop/sitefolder
giving all permissions to every user.