Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 10:16:28

Author Topic: Testing Kloxo-mr 6.5.1b on a VM  (Read 11271 times)

0 Members and 1 Guest are viewing this topic.

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Testing Kloxo-mr 6.5.1b on a VM
« on: 2014-07-02, 13:52:46 »
Hi all,

I'm testing kloxo 6.5.1b on a VM (need to be able to debug that php-fpm issue with sabredav)

Dummy domain is now working for me in http://IP/~admin/

Need guidance...
Thanks!

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #1 on: 2014-07-02, 14:27:40 »
Tryed to switch from apache to nginx and back to apache... /usr/sbin/httpd.event: No such file or directory.

yeah sure... lost internet while moving from nginx to apache...
FIxed..


But the problem pressists:
You don't have permission to access /~admin/ on this server.


After assgning a default domain (for admin), now it serves me a white page with this:
"No input file specified. "
« Last Edit: 2014-07-02, 15:47:36 by nmpribeiro »

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #2 on: 2014-07-03, 14:18:21 »
[Wed Jul 02 21:01:19 2014] [error] [client 192.168.56.1] FastCGI: server "/home/kloxo/httpd/default/default.0fake" stderr: Unable to open primary script: /home/admin/public_html/index.php (Operation not permitted)

Strange...

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #3 on: 2014-07-03, 14:28:13 »
There are the code inside website to refer to /home/admin/public_html/index.php instead /home/admin/<domain>/index.php.

Try change it.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #4 on: 2014-07-03, 14:33:55 »
Thank you MR!

Well, now it's ready to experiment in a VM :)

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #5 on: 2014-07-03, 14:49:58 »
Sorry, but this is something else:

[Wed Jul 02 21:32:10 2014] [error] [client 192.168.56.1] FastCGI: server "/home/kloxo/httpd/default/default.0fake" stderr: Unable to open primary script: /home/admin/public_html/test/index.php (Operation not permitted)

Cause I can access public_html/index.php, however, test and everythign else I make I cannot.

ls -la:
drwxr-xr-x  6 admin apache 4096 Jul  2 21:29 .
drwxr-x--x  5 admin apache 4096 Jul  2 21:18 ..
drwxr-xr-x  2 admin admin  4096 Jul  2 21:17 cgi-bin
drwxr-xr-x  2 admin admin  4096 Aug 23  2013 images
-rw-r--r--  1 admin admin  2240 Jul  2 21:17 index.html
drwxr-xr-x  2 admin admin  4096 Jul  2 21:29 test

and in test folder:
drwxr-xr-x 2 admin admin  4096 Jul  2 21:29 .
drwxr-xr-x 6 admin apache 4096 Jul  2 21:29 ..
-rw-r--r-- 1 admin admin    31 Jul  2 21:29 index.php

and yes, public_html points to those dir I "ls -la" before:

[root@centos-test admin]# ls -la
total 36
drwxr-x--x   5 admin apache 4096 Jul  2 21:18 .
drwxr-xr-x. 23 root  root   4096 Jul  2 08:55 ..
-rw-r--r--   1 admin admin    18 Jul 18  2013 .bash_logout
-rw-r--r--   1 admin admin   176 Jul 18  2013 .bash_profile
-rw-r--r--   1 admin admin   124 Jul 18  2013 .bashrc
drwxr-xr-x   2 admin apache 4096 Jul  2 09:30 kloxoscript
drwxr-xr-x   5 admin admin  4096 Jul  2 08:54 Maildir
lrwxrwxrwx   1 root  root     27 Jul  2 21:18 public_html -> /home/admin/template.local/
-rw-r--r--   1 admin admin    11 Mar 10 22:37 .qmail
drwxr-xr-x   6 admin apache 4096 Jul  2 21:29 template.local

?

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #6 on: 2014-07-03, 14:55:58 »
I see... html is accessed, while php throws the error...

I guess my php installation is messed up still

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #7 on: 2014-07-03, 15:03:58 »
FYI, '/home/admin/public_html/' is symlink of the first domain or other domain where you set as 'domain default'.

In your server, '/home/admin/public_html/' is symlink of '/home/admin/template.local/'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #8 on: 2014-07-03, 15:08:36 »
Yes, I can access .html files, not php... and if I switch to mod_php_itk, then php works. But perhaps would be good to have some sort of way to reinstal a selected php with a certain type of fpm (and really replace contents if there are, so we could have almost a clean install everytime we switch these on or off).

Having mixed results while doing so from webserver config UI.

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #9 on: 2014-07-03, 16:49:25 »

I wanted to debug an app with php-fpm, however, with this setup (clean install from 6.5.1b as for 3 Jan 14):

[root@centos-test owncloud]# sh /script/sysinfo

A. Kloxo-MR: 6.5.1.b-2014063001

B. OS: CentOS release 6.5 (Final) x86_64

C. Apps:
   1. MySQL: mysql55-5.5.38-1.ius.el6.x86_64
   2. PHP: php54-5.4.29-3.ius.el6.x86_64
   3. Httpd: httpd-2.2.27-1.mr.e6.x86_64
   4. Lighttpd: --uninstalled--
   5. Hiawatha: hiawatha-9.6-2.mr.el6.x86_64
   6. Nginx: --uninstalled--
   7. Cache: --uninstalled--
   8. Dns: bind-9.8.2-0.23.rc1.el6_5.1.x86_64
   9. Qmail: qmail-toaster-1.03-1.3.38.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.16.mr.el6.x86_64

D. Php-type (for Httpd/proxy): php-fpm_event

E. Memory:
                total       used       free     shared    buffers     cached
   Mem:           996        702        293          0         78        395
   -/+ buffers/cache:        228        767
   Swap:          815          3        812


I am receiving "No input file specified. " from  " http://192.168.56.103/~admin/owncloud/ "
If I change to mod_php_itk, then all works fine, but all the other Php-type seam to break the php serving from the server.

------- END OF GENERAL PURPOSE TESTING, BEGINING OF PHP-FPM and OwnCloud Case Scenario Test -------

All with this error: from httpd/error_log:

[Wed Jul 02 23:29:08 2014] [error] [client 192.168.56.1] FastCGI: server "/home/kloxo/httpd/default/default.0fake" stderr: Unable to open primary script: /home/admin/public_html/owncloud/index.php (Operation not permitted)

Logs from php-fpm/* show nothing.

Please, beare in mind that I really want to make a test scenario only "php" with type "php-fpm" and owncloud. Not with mod_php_itk which works well.
How can I put php-fpm to spit some errors here?

Thanks in advance

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #10 on: 2014-07-03, 16:52:31 »
Making php  Display Errors and Log Errors, in Config php outputs a new but interesting string:

"Access denied. "

httpd/error_log now has more details:

[Wed Jul 02 23:39:27 2014] [error] [client 192.168.56.1] FastCGI: server "/home/kloxo/httpd/default/default.0fake" stderr: PHP message: PHP Warning:  Unknown: open_basedir restriction in effect. File(/home/admin/template.local/owncloud/status.php) is not within the allowed path(s): (/home/kloxo/httpd/:/tmp/:/usr/share/pear/:/var/lib/php/$
[Wed Jul 02 23:39:27 2014] [error] [client 192.168.56.1] FastCGI: server "/home/kloxo/httpd/default/default.0fake" stderr: PHP message: PHP Warning:  Unknown: failed to open stream: Operation not permitted in Unknown on line 0
[Wed Jul 02 23:39:27 2014] [error] [client 192.168.56.1] FastCGI: server "/home/kloxo/httpd/default/default.0fake" stderr: Unable to open primary script: /home/admin/public_html/owncloud/status.php (Permission denied)


Mustafa, this one is for you... default domain obeys "open_basedir" restrictions that do not encompass the domain's dir in user folder... we need to fix this...
« Last Edit: 2014-07-03, 16:54:42 by nmpribeiro »

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #11 on: 2014-07-03, 17:05:34 »
After going to http://forum.mratwork.com/kloxo-mr-technical-helps/php-detection-program-can-not-get-the-memory-and-cpu-information/ reply #1 from Mustafa I was able to get this working again:


nano /etc/php-fpm.d/default.conf

and added ":/home/admin" to open_basedir restriction


Obviously, be carefull when you add stuff, since it's the wrong user. Remember to chmod -R apache:apache all once and a while. Or else, Mustafa... there must be some way to assign these as vars that could be read from php-fpm to be able to execute chrooted but also able to use and exec admin's files.

Guess it's a bug in the dev 6.5.1b
« Last Edit: 2014-07-03, 17:15:00 by nmpribeiro »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #12 on: 2014-07-03, 17:10:41 »
Default open_basedir for admin is '/home/admin/:/tmp/:/usr/share/pear/:/var/lib/php/session/:/home/kloxo/httpd/script/:/home/kloxo/httpd/disable/' where declare inside /etc/php-fpm.d/admin.conf.

So, possible your php code try to access to other then above path. That it.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #13 on: 2014-07-03, 17:12:42 »
No reason to add '/home/admin' in default.conf, except your code need it. That it.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline nmpribeiro

  • Valuable Member
  • *
  • Posts: 69
  • Karma: +1/-0
    • View Profile
Re: Testing Kloxo-mr 6.5.1b on a VM
« Reply #14 on: 2014-07-03, 19:18:14 »
I see what you mean. But that means http://IP/~admin/ is being processed with php-fpm chrooted from admin user? Might have some misconfiguration in my config then. Because my php code is only trying to access from /home/admin/template.local/owncloud/index.php other scripts and files inside /home/admin/template.local/owncloud/* not outside this dir.

When I have time, I'll generate a phpinfo() from there to check if we have "/home/admin/" in open_basedir, but I'm predicting I won't be able even to process the php file with <?php phpinfo(); ?> file itself, only html's, because I only have access to open_basedir directories that are in default.conf and nothing else. Since this domain doesn't resolve any IP (it's not mine), It's hard to access it other then http://IP/~admin/ to debug it.

I have no resources to test it further. But I can provide you the VM if you want (it's just a playground VM).

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.032 seconds with 19 queries.

web stats analysis