PHPMyAdmin write auth log failes

blyleven

Verified User
Joined
May 7, 2015
Messages
8
Hi all,

Since I've updated my server with the latest DirectAdmin, Custombuild 2 and phpMyAdmin 4.4.4 I'm getting the following error on each page request within phpMyAdmin:

Warning in ./libraries/logging.lib.php#62
fopen(./log/auth.log): failed to open stream: Permission denied

Backtrace

./libraries/logging.lib.php#62: fopen(
string './log/auth.log',
string 'a',
)
./libraries/logging.lib.php#90: log_to_file(
string 'cms',
string 'ok',
)
./libraries/common.inc.php#1021: PMA_logUser(string 'cms')
./sql.php#14: require_once(./libraries/common.inc.php)


Even after updating to phpMyAdmin 4.4.5, rebuilding apache and rebuilding php and after rebooting the complete server, this error still pops up.

This are the rights and user:group for the "log" folder:
4 drwxr-xr-x 2 webapps webapps 4096 mei 7 11:11 log

When I create a file called auth.log myself and chmod it with 0777 the error is gone. But this should not be the right method I guess...
 
What's your PHP mode set in the options.conf file? Is that mod_php without mod_ruid2?
 
Content of options.conf

This is in my options.conf

php1_release=5.5
php1_mode=mod_php
php2_release=no
php2_mode=php-fpm
 
May you post your mod_ruid2 value from the options.conf too?
 
-

I now have a strange issue. I've built my own CMS using Laravel framework. The core of the cms operates for example on the domain cms.domain.com (/home/user/domains/cms.domain.com/public_html/)
Before I've updated the software I could upload files using Moxiemanager into an "uploads" folder in a client's user folder, like: "/home/client/domains/client.com/public_html/uploads/". Now I can't anymore. I've tried chowning the folder to apache, root, everything, but still no luck. What could this be? My users can't upload any files anymore.
 
If you use mod_ruid2 you NOT have to change permission and owner of files.

Please run:

chown -R USER:USER /home/USER/domains/cms.domain.com/public_html/*
find /home/USER/domains/cms.domain.com/public_html/ -type d -exec chmod 755 {} \;
find /home/USER/domains/cms.domain.com/public_html/ -type f -exec chmod 644 {} \;

Change USER with the actual user and domain.com with the actual domain to restore all owner and file permissions.

Regards
 
Please try the following too:
Code:
cd /usr/local/directadmin/custombuild
./build mod_ruid2
 
-

Thank you very much! I guess everything is OK now. I've upgraded my Moxiemanager license so I can use the FTP method for filetransfers across all vhosts.
 
-

Goodmorning! Sorry got one more issue. I'm using laravel, a php framework which writes daily plain text log files. When the files are created they get the following permissions:

-rw-r--r-- 1 apache access 46305 mei 18 08:08 cms-2015-05-18.log

Now, when I access the application it shows the following error:

Error in exception handler: The stream or file "/home/*/domains/*/app/storage/logs/cms-2015-05-18.log" could not be opened: failed to open stream: Permission denied in....

I thought php_mod and mod_ruid2 would take care of this? Now I manually have to perform a chown and chmod action before the application can actually write to this logfile. Also... where does group "access" come from? Shouldn't that more be like "apache"?
 
Are you sure you're using mod_ruid2?

Have you tryed recompile it and rewrite confs using custombuild?

Are you sure the file who is creating those logs is running under the right user?

Regards
 
I've now got the same issue as well... Strange. I've tried all the above and I'm not having any luck.

Warning in ./libraries/logging.lib.php#62
fopen(./log/auth.log): failed to open stream: Permission denied

Backtrace

./libraries/logging.lib.php#62: fopen(
string './log/auth.log',
string 'a',
)
./libraries/logging.lib.php#90: log_to_file(
string 'da_admin',
string 'ok',
)
./libraries/common.inc.php#1021: PMA_logUser(string 'da_admin')
./index.php#12: require_once(./libraries/common.inc.php)
 
1) To test, create a file:
Code:
/var/www/html/phpMyAdmin/info.php
and add this code:
http://help.directadmin.com/item.php?id=532

Then it view it through apache.
Let us know what the uid/gid values are.
You might need to edit the disable_functions in the php.ini to temporarily allow "system" so we can see the output.

2) Then also check the permissions on the folder, and the log itself:
Code:
cd /var/www/html/phpMyAdmin
ls -lad log
ls -la log/*
and let us know what it shows.

3) Lastly, paste us this output:
Code:
cd /usr/local/directadmin/custombuild
./build options
John
 
uid=48(apache) gid=48(apache) groups=48(apache),502(access)


cd /var/www/html/phpMyAdmin
[root@host2 phpMyAdmin]# ls -lad log
drwxr-xr-x 2 webapps webapps 4096 Jun 4 22:23 log
[root@host2 phpMyAdmin]# ls -la log/*
ls: cannot access log/*: No such file or directory


./build options
Apache: 2.4.12
Nginx (reverse proxy): 1.8.0
mod_ruid2: 0.9.8
ModSecurity: no
Dovecot: 2.2.18
Dovecot configuration: yes
AWstats: no
Exim: no
exim.conf update: no
BlockCracking: no
Easy Spam Fighter no
SpamAssassin: 3.4.1
ClamAV: 0.98.7
MySQL: 5.6.25
MySQL backup: yes
MySQL backup directory: /usr/local/directadmin/custombuild/mysql_backups
PHP (default): 5.6 as mod_php
phpMyAdmin: 4.4.9-all-languages
ProFTPD: no
Pure-FTPd: 1.0.38
RoundCube webmail: 1.1.1
Replace "php.ini" with './build all' and './build php_ini': no
Auto updates/notifications: no
Run "clean" every time: yes
Run "clean_old_webapps" every time: yes
Run "clean_old_tarballs" every time: yes
Show texts in bold: yes
SquirrelMail: 1.4.23-20150507_0200
Zend Guard Loader: yes
ionCube loader: no
Suhosin: no
 
Back
Top