FOG Install init.php permission
-
Debian 10:
Running installfog.sh goes well until ‘go to x.x.x.x/fog/management’
The site reports http 500 error. And apache logs show:Got error 'PHP message: PHP Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/var/www/html/fog/service/ipxe): failed to open dir Permission denied in /var/www/html/fog/commons/init.php:119\nStack trace:\n#0 [internal function]:
-
@rets34 Please run
ls -al /var/www/html/fog/service/ipxe
and post output here.Do you have some kind of security framework enabled? Like apparmor or selinux?
-
This post is deleted! -
@sebastian-roth ```
total 59736 drwx------ 2 fogproject www-data 4096 Aug 19 10:39 . drwx------ 3 www-data www-data 4096 Aug 19 10:39 .. -rw-r--r-- 1 fogproject www-data 1966 Aug 19 10:39 advanced.php -rw-r--r-- 1 fogproject www-data 16272 Aug 19 10:39 bgdark.png -rw-r--r-- 1 fogproject www-data 21280 Aug 19 10:39 bg.png -rw-r--r-- 1 fogproject www-data 1139 Aug 19 10:39 boot.php -rw-r--r-- 1 fogproject www-data 8471200 Aug 19 10:39 bzImage -rw-r--r-- 1 fogproject www-data 7870272 Aug 19 10:39 bzImage32 -rw-r--r-- 1 fogproject www-data 234697 Aug 19 10:39 grub.exe -rw-r--r-- 1 fogproject www-data 592 Aug 19 10:39 index.php -rw-r--r-- 1 fogproject www-data 20574204 Aug 19 10:39 init_32.xz -rw-r--r-- 1 fogproject www-data 21161356 Aug 19 10:39 init.xz -rw-r--r-- 1 fogproject www-data 25340 Aug 19 10:39 memdisk -rw-r--r-- 1 fogproject www-data 1839104 Aug 19 10:39 memtest.bin -rw-r--r-- 1 fogproject www-data 202624 Aug 19 10:39 refind_aa64.efi -rw-r--r-- 1 fogproject www-data 29719 Aug 19 10:39 refind.conf -rw-r--r-- 1 fogproject www-data 262592 Aug 19 10:39 refind.efi -rw-r--r-- 1 fogproject www-data 201600 Aug 19 10:39 refind_ia32.efi -rw-r--r-- 1 fogproject www-data 208776 Aug 19 10:39 refind_x64.efi
-
@rets34 Run
sudo chmod 775 /var/www/html/fog/service/ipxe
to fix the error posted above. Though I am wondering why access rights are set so strict on this folder and if others are restricted similarly. -
@sebastian-roth After Running the command and trying again:
Apache2 error.log:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/var/www/html/fog/service/ipxe): failed to open dir: Permission denied in /var/www/html/fog/commons/init.php:119\nStack trace:\n#0 [internal function]: RecursiveDirectoryIterator->__construct('/var/www/html/f...', 4096)\n#1 [internal function]: RecursiveDirectoryIterator->getChildren()\n#2 [internal function]: FilterIterator->next()\n#3 /var/www/html/fog/commons/init.php(119): iterator_to_array(Object(RegexIterator), true)\n#4 /var/www/html/fog/commons/init.php(257): Initiator->__construct()\n#5 /var/www/html/fog/commons/base.inc.php(48): Initiator::startInit()\n#6 /var/www/html/fog/maintenance/backup_db.php(22): require('/var/www/html/f...')\n#7 {main}\n thrown in /var/www/html/fog/commons/init.php on line 119'
-
@rets34 What are the output of the following two commands?
ls -laht /var/www ls -laht /var/www/html
-
@wayne-workman ```
user@server:~$ ls -laht /var/www total 12K drwxr-xr-x 3 root root 4.0K Sep 1 09:25 html drwxr-xr-x 3 root root 4.0K Aug 19 10:27 . lrwxrwxrwx 1 root root 18 Aug 19 10:27 fog -> /var/www/html/fog/ drwxr-xr-x 12 root root 4.0K Aug 18 09:58 .. user@server:~$ ls -laht /var/www/html total 28K drwxr-xr-x 11 www-data www-data 4.0K Sep 1 09:25 fog drwxr-xr-x 3 root root 4.0K Sep 1 09:25 . drwxr-xr-x 3 root root 4.0K Aug 19 10:27 .. -rw-r--r-- 1 www-data www-data 52 Aug 19 10:27 index.php -rw-r--r-- 1 root root 11K Aug 18 10:01 index.html