how do you enable all users access to odbc driver in linux - 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

Related

uglifyjs command permission denied

I have a strange problem about my uglifyjs command.
The uglifyjs file looks like below
#!/usr/bin/env /usr/local/bin/node
// -*- js -*-
"use strict";
require("../tools/exit");
var fs = require("fs");
var info = require("../package.json");
And when Apache run it under its user (daemon), I got permission denied error in the PHP log.
/usr/bin/env: /usr/local/bin/node: Permission denied
I checked those file permissions and all users have read and run permission.
lrwxrwxrwx 1 root root 50 May 13 2019 /usr/local/bin/node -> /home/ec2-user/.nvm/versions/node/v6.11.1/bin/node
-rwxrwxr-x 1 ec2-user ec2-user 29851602 Jul 11 2017 /home/ec2-user/.nvm/versions/node/v6.11.1/bin/node
-rwxr-xr-x 1 root root 28880 Aug 1 2018 /usr/bin/env
I am using AWS EC2 server.
Please help me and thanks in advance.

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

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

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. :)

CentOS and fontconfig: Cannot load default config file

I'm getting following error when using imagick:
Fontconfig error: Cannot load default config file
My script is working but i would like to fix this (is filling up log file).
OS is:
# cat /etc/redhat-release
CentOS release 5.10 (Final)
I was looking trough internet little bit and this is causing problem:
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
Folder exists:
# ls /etc/fonts/ -all
total 64
drwxr-xr-x 4 root root 4096 Jul 9 2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x 2 root root 4096 Jan 3 2012 conf.avail/
drwxr-xr-x 2 root root 4096 Apr 14 2013 conf.d/
-rw-r--r-- 1 root root 5239 Jan 12 2008 fonts.conf
-rw-r--r-- 1 root root 6907 Jan 12 2008 fonts.dtd
But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.
Account under with script is run is created with WHM.
Please help :)
I manage to solve my problem. chroot was making trouble.
I need to:
log with root account
find jailed environment of account on with i run script (in my case /home/virtfs/[username])
to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts
Posting an answer for CentOS 7 in 2021:
yum install fontconfig
More info here:
https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

svn permission issue - txn-current-lock: Permission denied

I setup svn on my local system /svn/repos/myproject by following this tutorial. I'm able to view the repo in browser.
But when it try to import new project I couldn't through svn client ( rapid svn ) it shows following error:
Execute: Import
Error while performing action:
Can't open file '/svn/repos/myproject/db/txn-current-lock': Permission denied
Svn directory permissions:
→ ls -l /svn
total 12
drwxrwxr-x 2 root root 4096 Feb 15 12:09 permissions
drwxrwxr-x 4 apache apache 4096 Feb 15 12:09 repos
drwxrwxr-x 2 root root 4096 Feb 15 12:09 users
Repo directory:
→ ls -l
total 8
drwxrwxr-x 3 root root 4096 Feb 15 12:09 conf
drwxrwxr-x 7 apache apache 4096 Feb 15 12:09 myproject
How to solve this issue?
I've given 777 permission to repos directory which solved this issue. But i got another issue like Couldn't perform atomic initialization.
I think this is due to incompatible sqlite version with subversion we're using, this can be solved by updating svnadmin command,
svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/repos/myproject

Resources