View Issue Details

IDProjectCategoryView StatusLast Update
0000152Bacula-Webbug-phppublic2016-09-16 12:24
Reportermd3kAssigned Todavide 
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
PlatformVMwareOSCentOSOS Version7
Product Version7.0.1 
Target VersionFixed in Version 
Summary0000152: cache folder must be writable by Apache user
DescriptionI have the same error like in Issue#119
I'm making a new installation on a blank OS

/var/www/bacula-web/index.php on line 26 in function Bweb->__construct

Application error
File /var/www/bacula-web/core/bweb.class.php
Line 52
Exception code 0
Exception message The template cache folder application/view/cache must be writable by Apache user

I've tried:
1) According to the manual
chown -Rv apache: /var/www/html/bacula-web
2) chmod 777 -R /var/www/html/bacula-web/application/view/cache
3) changed the path in global.inc.php
define('VIEW_CACHE_DIR', BW_ROOT . "/application/view/cache");
TagsNo tags attached.

Relationships

duplicate of 0000119 resolveddavide php issue 
related to 0000154 resolveddavide Potential bug in constant definition (global.inc.php) 

Activities

davide

2014-12-15 16:26

manager   ~0000425

Looks like a php bug ... requesting feedback from reporter

davide

2014-12-15 16:30

manager   ~0000426

Last edited: 2014-12-15 16:53

View 2 revisions

Hi,

It looks to be a bug on my side ...

Could you add the line below after you've defined the constant VIEW_CACHE_DIR in global.inc.php

<?php
....
define('VIEW_CACHE_DIR', BW_ROOT . "/application/view/cache");
echo 'View cache dir' . VIEW_CACHE_DIR;
...
?>

And send the path please ?

Regards

md3k

2014-12-15 18:59

reporter   ~0000428

Here's the output:
View cache dir/var/www/html/bacula-web/application/view/cache

Screenshot:
http://take.ms/mwx1R

davide

2014-12-15 21:44

manager   ~0000429

Check if you have SELinux enabled by running

# getenforce
and check log file
/var/log/audit/audit.log

If it's the case, change SELinux context of Bacula-Web files/folders.

Please get back to me as well with

 - Apache logs
 - PHP version

Regards

md3k

2014-12-16 08:06

reporter   ~0000430

Last edited: 2014-12-16 08:07

View 2 revisions

You was right about SELinux. Here's the configuration I have now and some logs.
I end up with disabling Selinux - it fixed the problem.

# getenforce
Enforcing

# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

# php -v
PHP 5.4.16 (cli) (built: Oct 31 2014 12:59:36)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Jul 23 2014 14:48:00

#/var/log/audit/audit.log
type=AVC msg=audit(1418708875.579:1772): avc: denied { write } for pid=4408 comm="httpd" name="cache" dev="dm-1" ino=2454400 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=SYSCALL msg=audit(1418708875.579:1772): arch=c000003e syscall=21 success=no exit=-13 a0=7f627732c4d0 a1=2 a2=0 a3=1 items=0 ppid=1310 pid=4408 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)


#/var/log/httpd/error_log
[Tue Dec 16 08:47:55.593008 2014] [:error] [pid 4408] [client 192.168.37.99:49319] PHP Fatal error: Smarty error: [in index.tpl line 9]: syntax error: unrecognized tag 't' (Smarty_Compiler.class.php, line 590) in /var/www/html/bacula-web/vendor/smarty-2.6.28/libs/Smarty.class.php on line 1094

# semanage fcontext -l | grep /var/www/html
/var/www/html(/.*)?/sites/default/files(/.*)? all files system_u:o
/var/www/html(/.*)?/sites/default/settings\.php regular file system_u:o
/var/www/html(/.*)?/uploads(/.*)? all files system_u:o
/var/www/html(/.*)?/wp-content(/.*)? all files system_u:o
/var/www/html/[^/]*/cgi-bin(/.*)? all files system_u:o
/var/www/html/cgi/munin.* all files system_u:o
/var/www/html/configuration\.php all files system_u:o
/var/www/html/munin(/.*)? all files system_u:o
/var/www/html/munin/cgi(/.*)? all files system_u:o
/var/www/html/owncloud/data(/.*)? all files system_u:o

davide

2014-12-16 11:40

manager   ~0000431

You're welcome ...

I'll update the documentation regarding systems with SELinux enabled.

Regards

davide

2014-12-17 15:41

manager   ~0000433

The documentation have been updated.
http://www.bacula-web.org/docs/installing-latest-version/checking-selinux.html

Thanks for your feedback

Issue History

Date Modified Username Field Change
2014-12-15 15:16 md3k New Issue
2014-12-15 16:24 davide Target Version => 7.0.2
2014-12-15 16:26 davide Note Added: 0000425
2014-12-15 16:27 davide Relationship added duplicate of 0000119
2014-12-15 16:30 davide Note Added: 0000426
2014-12-15 16:30 davide Assigned To => davide
2014-12-15 16:30 davide Status new => feedback
2014-12-15 16:53 davide Note Edited: 0000426 View Revisions
2014-12-15 18:59 md3k Note Added: 0000428
2014-12-15 18:59 md3k Status feedback => assigned
2014-12-15 21:44 davide Note Added: 0000429
2014-12-15 21:44 davide Status assigned => feedback
2014-12-16 08:06 md3k Note Added: 0000430
2014-12-16 08:06 md3k Status feedback => assigned
2014-12-16 08:07 md3k Note Edited: 0000430 View Revisions
2014-12-16 11:40 davide Note Added: 0000431
2014-12-16 11:54 davide Target Version 7.0.2 =>
2014-12-16 12:01 davide Relationship added related to 0000154
2014-12-17 15:41 davide Note Added: 0000433
2014-12-17 15:41 davide Status assigned => resolved
2014-12-17 15:41 davide Resolution open => fixed