Put right permission - owner/group to public_html folder - permissions

I'm new to WHM, cPanel, and CentOS.
I install WHM then create an account for domain app.example.com and user peter
I point the domain name to right IP address but when I run my website app.example.com I got HTTP ERROR 500
Via SSH I log into the server and I find my previous uploaded code into
/home/peter/public_html
Then I run command sudo chown -R peter:peter /home/peter/public_html
and when I look at folders permission and owner they looks like:
I think my HTTP ERROR 500 is about user permission.
Can please help me to add right privileges to a user or what I need to do to my public_html folder be visible to the world (at browser).
What I need to do?

The best thing to know if it's a permissions problem, a bug in the programming of the web application or to see what really happens, is that you look at the log file of the web server (apache, nginx, the one you use). The log will give you more clues. Could you copy the log output when the error occurs?

It seems some required extensions were not activate or had been removed from your VPS. You should check and install/activate them. Then you can test your website again.
P.S: Sorry for my bad english

Related

moodle not working properly after installation

I have installed moodle many times. But this time when i install moodle all steps are completed uptil update profile. (localhost/moodle/user/editadvanced.php id=2) when i enter admin details and update file nothing is displayed. when i try to access moodle module through localhost chrome displays message "web page has a redirect loop".
localhost/moodle/admin/index.php page is not redirected. i have reinstalled Xampp.
in Apache error log i found following
RSA certificate configured for www.example.com:443 does NOT include an
ID which matches the server name
.
i found solution some where to comment include conf/extra/httpd-ssl.conf but it another error is activated in error log
"Sessioncache is not configured"
. Also i have changed port 443 but it didn't work
Find the moodledata folder.
Inside the moodledata
there are many folders
Delete all from Cache
2.Delete all from Session
Restart your browser.
It worked for me.
Hope that works for you.
Thanks for reply. I have found another solution.
While i was accessing a service provided by Linux server i got message that service has been blocked by security settings. I searched and while searching for that problem i found the solution of both.
https://productforums.google.com/forum/#!topic/chrome/DYk8tSV8qM4
go to control panel, programs, click on java, security.
set security to medium.
Java security was set to high which was blocking moodle application.
Delete the cache and the sesson folder data's in the moodle data folder. It will prevent you from redirecting the loop.
It is worked for me.But deleting the whole moodledata folder is not recommended
Just a guess... but if you are using a certificate, have you tried using https in your config.php?
$CFG->wwwroot = 'https://...'

What should the permissions and ownership for Drupal on LAMP stack?

What has me confused is why a directory or part of my Drupal site to suddenly return the message of "Forbidden" - that I, as first use, cannot access various parts of the site in the admin area. I changed the permission on the default/sites/files directory to 777. That probably is giving to too much access to everyone. However, it was only after doing that, that I got a message of Forbidden - that I don't have access to various parts of the admin area. I am the first user.
I changed the permissions on this directory because when I tried to update some modules, I got an error that file could not be created.
I have cpanel/whm on a dedicated vps server. So, one issue is how to find out what the user and group ownership should be on a server that hosts various domains through cpanel. It appears that for other accounts have user:owner permissions that match the account name. I am not sure if the default group:owner should remain as www-data:www-data for example, on Ubuntu or if cpanel/whm says, "make the apache group and user equal to the account name."
Thanks in advance for any help,
Bruce
First of all, I'm going to assume you're talking about Drupal 7, but really, there's little difference in this case.
Try reading about permissions here
Its very simple that the folder should have user:user ownership and correct permissions with folders having 755 permissions respectively. The server might be running on suphp hence you cannot have wrong user with wrong permissions.

Ubuntu 12.04 - Phpmyadmin - 403 forbidden

Background
I am running Ubuntu 12.04, and when i go to my url http://domain_name.com/phpmyadmin/ i am getting the error:
You don't have permission to access /phpmyadmin/ on this server.
I have used a symlink for phpmyadmin which points to
"usr/share/phpmyadmin"
it has permission 777.
Question
why is it showing as permission denied?
Thanks
Aiden
For security reasons Apache does not allow 777 permission.
You can use a hard link (ln) other than a soft link (ln -s).
Or
Download the PhpMyAdmin tarball from the site and decompress it in '/var/www/' directory as root. Then rename the directory to phpmyadmin(or something you need).
Then try to view it via a web browser 'http://localhost/phpmyadmin/'. In the initial stage you will see a wizard to setup PhpMyAdmin. (Sometimes you may need to change the permissions on 'config.inc.php', for that just follow the instructions on the wizard.)

Drupal 7 Login can't view admin bar, Fresh Install via Drush on CentOS 6.3

I've spent quite a few hours trying to figure out what the problem is. The issue is:
Login works but the page doesn't change once I log in as admin. I know that the login works because wrong credentials generate an error. I do not even see the administrative toolbar. No other pages exist on the page, but if I am to, say, input ?q=admin, on user/1, it will go 'Access Denied'
What I've done:
cleared cache and cookies many times
have checked that mod_rewrite works
the cookie path on the drupal settings.php is / and not \
.htaccess is on the drupal root directory, exactly as provided by
drupal.org
in httpd.conf, I have written a new directory and AllowOverride=All
(*note: the parent directory has AllowOverride=None)
Clean URL's are enabled via drush vset
What I suspect the problem is, but don't know how to solve it:
Proxy?
Some permissions that need to be configured on some files/directories
What I have:
CentOS 6.3
Apache 2.2.15
Drush 5.9
Drupal 7.22
Thank you in advance
I can't imagine that this would be a permissions issue, but if it were, you could just start by doing (and btw, I would NEVER recommend doing this on a production server):
cd /<path_in_which_drupal_root_sits>
chown -R apache:apache <drupal_root>
chmod -R 777 <drupal_root>
You might need to sudo to do these, and you will definitely want to bring the chmod permission back down to 775, 755 or 644 as is appropriate to the directory/sub-directory once you're done testing.
This will probably not solve your issue outright, but it will at least help you to eliminate permissions as an issue.
To test proxy issues, you might try installing lynx (command-line http client), and try accessing your site through it using localhost. You should be able to login, and if you get a different result that way than via remote access, you might indeed have some weird proxy or other network issue that's interfering.
Lastly, and this might actually be the most helpful bit here, you ought to inspect your headers before, during and after the login process. You can do this using FireBug or Developer Tools or the like. And, of course, check your Apache access and error logs for anything unexpected or out of the ordinary.
Most likely, though, you just need to reinstall and try it again.
Turns out that it was a SELinux problem. I found out that if I logout via the logout URL and then use https on my website, I can login and use it properly. I needed to reinstall the certificates and setup the security... Thanks for everyone's help.

what user I should run my nginx or php-fpm processes

Ok. Im little bit confused about those permissions in linux so please people help me out. The trouble is that I dont want to run server as root, so I created another user with sudo privileges so he runs the nginx and php-fpm servers (example "sudo_user"). But the trouble is for example I have "some_user" and he has a directory of his web-site "some_user/www.some_user.com" with all the configuration files, including database passwords and so on. I set ownership of all files to some_user:some_user (user:group) and changed permissions to all files 751 (u=rwx,g=rx,o=x so other accounts cant just go in this dir and read every config file) and set to public files permission 755. But my php-fpm runs with "sudo_user" with a group "sudo_user" he don't have a permission to write or read config files in "some_user" directory. What strategy should I take?
Its probably better to create an nginx user and nginx group, and have nginx/php run under that user. Then you can add the user nginx to your some_user/sudo_user's groups with your 751 permissions and you should be set.