phpmyadmin, neginx error.log - Check group www-data has read access and open_basedir - linux

I have this message on phpmyadmin website
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
On the 'click here' page I have this:
Page printscreen
My nginx error are:
2014/06/27 15:08:15 [error] 4922#0: *886 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions.2014/06/27 15:17:07 [error] 5119#0: *939 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions" while reading response header from upstream, client: 1***, server: _, request: "GET /phpmyadmin/js/messages.php?lang=en&db=&token=**** HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/ispconfig.sock:", host: "****:8080", referrer: "https://****:8080/phpmyadmin/chk_rel.php?db=&table=&server=1&target=&token=****"
I give them permissions with this cmd for all 3 files:
chgrp www-data /var/lib/phpmyadmin/blowfish_secret.inc.php
chmod 644 /var/lib/phpmyadmin/blowfish_secret.inc.php
How to fix the open_basedir restrictions?
I checked Google but didn't find anything. Please give me some help or tips how to fix it. Thank you!
Ubuntu version:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"

Here's my configuration:
drwxr-xr-x 3 root root 4096 feb 14 10:05 phpmyadmin/
that's for folder. And for those two files:
-rw-r----- 1 root www-data 60 feb 14 10:05 blowfish_secret.inc.php
-rw-r----- 1 root www-data 0 feb 14 10:05 config.inc.php
Hope this will help. Also check for php5-mcrypt extension. If it's not working properly, use
sudo php5enmod mcrypt
to install it, and then just restart ngnix. here are commands:
chmod 755 /var/lib/phpmyadmin
chmod 664 /var/lib/blowfish_secret.inc.php
chmod 664 /var/lib/config.inc.php
those commands should work. :)

Related

giving /var/www/site1 to www-data:www-data crashes all WP sites on server

-- See Tl;dr below for a short version --
On my ubuntu-16.04 droplet apache2 and php7 both use the user www-data. At some point all three installations of wordpress-4.7.2 seemingly without reason started asking for FTP credentials, indicating they don't have sufficient rights. Each wp instance has it's own mysql database.
I tried to solve this for /site1 with
sudo chown www-data:www-data /var/www/site1/* -R
which shouldn't change anything as this is how the permissions were set already. For whatever reason this caused the browser to return a
HTTP ERROR 500
for the sites in /var/www/site1, /var/www/site2 and /var/www/site3 – nothing works anymore.
The only way I've found to get out of this is to restore the droplet. But each time I try to get the permissions right, I end up with all sites down again.
These are the current permission settings:
drwxr-xr-x 14 root root 4096 Feb 3 XX:14 /var/
drwxrwxr-x 8 www-data www-data 4096 Mar 5 XX:27 /var/www/
drwxr-sr-x 3 www-data www-data 4096 Mar 5 XX:13 /var/www/site1/
drwxrwxr-x 3 www-data www-data 4096 Feb 25 XX:51 /var/www/site2/
drwxrwxr-x 3 www-data www-data 4096 Feb 28 XX:06 /var/www/site3/
The sudo user is member of www-data:
user1#droplet:~$ members www-data
www-data user2 user1
A freshly installed Theme on /site1 caused dozens of PHP Fatal errors like this one:
[Sun Mar 05 19:24:04.003189 2017] [:error] [pid 5632] [client 31.10.138.238:50870]
PHP Fatal error: Uncaught Error: Call to undefined function mysql_escape_string()
in /var/www/site1/html/wp-content/themes/gloria/functions.php:60\nStack trace:\n#0
/var/www/site1/html/wp-settings.php(425): include()\n#1 /var/www/bw/html/wp-config.php(89):
require_once('/var/www/site1/htm...')\n#2 /var/www/bw/html/wp-load.php(37):
require_once('/var/www/site1/htm...')\n#3 /var/www/bw/html/wp-admin/admin.php(31):
require_once('/var/www/site1/htm...')\n#4 /var/www/bw/html/wp-admin/themes.php(10):
require_once('/var/www/site1/htm...')\n#5 {main}\n thrown in
/var/www/site1/html/wp-content/themes/gloria/functions.php on line 60
After deleting the theme, /site1 went back online. I have no idea why. The first two times I ended up restoring the droplet because of
HTTP ERROR 500
this theme wasn't involved. Even though /site1 is back up, /site2 and /site3 remain stuck with
HTTP ERROR 500
Since the removal of the theme in /site1 the Apache Error Log doesn't have any suspicious entries:
[Sun Mar 05 19:56:35.456584 2017] [mpm_prefork:notice] [pid 1671] AH00171: Graceful restart requested, doing restart
[Sun Mar 05 19:56:35.662742 2017] [mpm_prefork:notice] [pid 1671] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Mar 05 19:56:35.662765 2017] [core:notice] [pid 1671] AH00094: Command line: '/usr/sbin/apache2'
Any ideas?
Edit: An instance of ActiveCollab in /var/www/site2/activecollab/ never stopped working during the whole issue. All connection and permission checks done by ActiveCollab for it's own files, folders and database are positive.
Tl;dr: WP1 asks for FTP, I say
sudo chown www-data:www-data /var/www/site1/* -R
WP1, WP2 and WP3 tell the browser to
HTTP ERROR 500
while ActiveCollab in a subfolder of WP2 doesn't give a sh*t and keeps running.
Try these
sudo chmod -R 774 /var/www/yourwordpressfolder
And then
sudo chown -R www-data:www-data /var/www/yourwordpress
Finally
sudo chmod -R 777 /var/www/yourwordpressfolder

Trying to make virtual host in xampp on CENTOS 7

I tried yesterday to make a virtual host.
i did few steps to make it:
i removed the hash (#) in /opt/lampp/etc/extra/ not its:
(hash)Virtual hosts
Include etc/extra/httpd-vhosts.conf
i edited the /opt/lampp/etc/extra/httpd-vhosts.conf to this:
i created directory for pic.localhost i 3 commands via root:
mkdir /opt/lampp/pictures/
chown daemon:daemon 770 -R /opt/lampp/pictures/
chmod 770 -R /opt/lampp/pictures/
i added this following lined to /etc/hosts/ file:
127.0.0.1 pic.localhost
i restarted the xampp(version 5.6.8) and its not working. what i did wrong?
log file picture-access_log shows:
5.29.203.187 - - [01/Jul/2015:18:04:07 +0300] "GET / HTTP/1.1" 403 1036
log file picture-error_log shows:
[Wed Jul 01 18:04:07.173810 2015] [authz_core:error] [pid 24261]
[client 5.29.203.187:57710] AH01630: client denied by server
configuration: /opt/lampp/pictures/

how do you enable all users access to odbc driver in linux

I have setup an odbc connection in linux that connects to MSSQL server:
This is the location and permission of .ini and inst files:
-rw-r--r-- 1 root root 169 Aug 7 17:00 odbc.ini
-rw-r--r-- 1 root root 188 Aug 7 16:40 odbcinst.ini
This is the permission to the mssql server driver:
-rwxrwxrwx 1 root root 1855896 Aug 7 16:39 /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2260.0
When I am logged in as a user to the system, I do ls on that file, I get permission denied error, as follows:
~> ls -l /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2260.0
ls: cannot access /opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2260.0: Permission denied
It has read, write, and execute permission for all users. When I am logged in as a user, not root, I cannot connect to the db from linux. When I am logged in as root, I can establish an ODBC connection the sql server. What I am doing wrong here. I need everyone to establish odbc connection.
others did not have permission on the drivers directory, this command fixed my issue:
chmod -R o+rx /opt/microsoft/msodbcsql/11.0.2260.0

Redmine installation

i have been fighting for many years to install Redmine on Debian/Wheezy.
I followed the following tutorial: enter link description here.
But when I restart my Apache server, the redmine web page only displays the list of the files of the Remdine directory.
Could you please help to solve this problem?
Thank you
EDIT:
I am making progress... Phusion Passenger was not installed, so I did it.
But, I still have another error which is displayed when I connect to my Redmine web page:
Permission denied - /etc/redmine/default/database.yml (Errno::EACCES)
/usr/lib/ruby/vendor_ruby/rails/application/configuration.rb:115:in `read'
/usr/lib/ruby/vendor_ruby/rails/application/configuration.rb:115:in `database_configuration'
/usr/lib/ruby/vendor_ruby/active_record/railtie.rb:78:in `block (2 levels) in <class:Railtie>'
The permissions are the following ones:
-rw-r--r-- 1 www-data www-data 112 août 8 18:11 database.yml
-rw-r--r-- 1 www-data www-data 911 août 8 18:11 session.yml
I finally successed to install and run Redmine.
The permission on the database.yml file was correct but not on the parent directory.
Now it works.

How to allow Apache and MapServer access to data on different file system?

I have a large hard drive I would like to store data mapserver (Runs as a cgi-bin under Apache) but I am ruining in to errors when trying to access the data.
When I try and access any thing in the /bac/data/gis using mapserver I get:
msDrawMap(): Image handling error. Failed to draw layer named 'world'. msShapefileOpen(): Unable to access file. (/var/www/html/gis/world.shp) msShapefileOpen(): Unable to access file. (/bac/data/gis/global/world.shp)
from the mapserver log file:
[Fri Aug 2 01:12:15 2013].100850 CGI Request 1 on process 28658
[Fri Aug 2 01:12:15 2013].105687 msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Fri Aug 2 01:12:15 2013].105731 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Fri Aug 2 01:12:15 2013].105819 msShapefileOpen(): Unable to access file. (/bac/data/gis/global/world.shp)
[Fri Aug 2 01:12:15 2013].105838 msShapefileOpen(): Unable to access file. (/var/www/html/gis/world.shp)
[Fri Aug 2 01:12:15 2013].105848 msDrawMap(): Image handling error. Failed to draw layer named 'world'.
[Fri Aug 2 01:12:15 2013].106077 mapserv request processing time (msLoadMap not incl.): 0.005s
[Fri Aug 2 01:12:15 2013].106085 msFreeMap(): freeing map at 0x1bdfde0.
I also tried accessing data directly using Apache to see if it could read anything in /bac/data/gis. This was done by adding an ailes and directory directive to httpd.cfg file.
This to failed with the flowing error message in the httpd-error log.
[Thu Aug 01 22:52:37 2013] [error] [client 192.168.0.1] (13)Permission denied: access to /gis/ denied (filesystem path '/bac') because search permissions are missing on a component of the path
The file system is mounted as "/bac" and the data is in /bac/data/gis
my httpd directorys are /var/www/[html cgi-bin]/
I have ensured +x permission on all directors in the /bac/dat/gis path. I all so disabled seliux as this is general the first thing I try when faceing an access denied situation.
Is it possible access data on other file system using Apache and cgi-bin scripts such as mapserver?
As arkascha pointed out, the mount points and filesystems are irrelevant when considering access permissions. You should check that your apache user has access to those files:
user#host$ sudo su apache (apache may need to be replaced by httpd, www-data, check your apache config file to see under which user apache runs)
apache#host$ ls /bac/data/gis/global/world.shp
If the ls command returned a permission error, you have determined the cause of your error. In that case check that the permissions on /bac/data/gis/global/world.shp have "+r" for apache (that will probably be for the "others"), and that all the intermediate directories have +x.
sudo chmod o+r /bac/data/gis/global/world.*
sudo chmod o+x /bac
sudo chmod o+x /bac/data
sudo chmod o+x /bac/data/gis
sudo chmod o+x /bac/data/gis/global

Resources