Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Yukinarija

Pages: [1]
1
Hello Igor,

This seems to made it work!
Could you please elaborate? What was the issue in suPHP? How did those quotes help out and how did you know?

Either I am too tired to figure it out, or its a bit tricky.


2
Also, I would like to add that the scripts themselves are bash scripts, example names are:

CreateServer

(without .sh at the end).

These are started by the web server from a php based website.


3
CentOS 6 Problems / Forks run as nobody - but scripts can't see anything
« on: November 01, 2015, 02:43:39 PM »
Hello there,

I am installing this piece of software for my client, and he wants to use CentOS Web Panel, which I must admit - looks better than at first I was hoping it to be.

We're having this issue, where the PHP/BASH software is always failing due to:
wget: command not found
ls: command not found
etc..

Since the server is working well, I begun to go after HTTPD processes.

Code: [Select]
[root@server ~]#  cat /etc/redhat-release
CentOS release 6.7 (Final)

Code: [Select]
[root@server ~]# ps faux | grep httpd
root     31870  0.0  0.0 103356   856 pts/0    S+   09:35   0:00          \_ grep httpd
root      9332  0.0  0.0  59168  3684 ?        Ss   07:26   0:00 /usr/local/apache/bin/httpd
nobody   17413  0.0  0.0  59536  3472 ?        S    08:25   0:00  \_ /usr/local/apache/bin/httpd
[root@server ~]#

So httpd forks run as nobody, okay. So I checked if nobody sees linux paths.

Code: [Select]
[root@server ~]# su nobody -s /bin/bash
bash-4.1$ wget
wget: missing URL

Code: [Select]
[root@server ~]# su nobody -s /bin/bash
bash-4.1$ echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
bash-4.1$


So the user 'nobody' seems okay in itself. So this problem is somewhere between PHP and the interfacing with the Linux user.

I tried to use:

Code: [Select]
<?php
print shell_exec'whoami' );
?>

But the window is empty, same command works well on any other server and returns the active user.

Additionally, if we override the scripts, by setting a PATH variable in the script, commands such as wget are found, but ls and $HOME paths seem loose info somewhere.

Code: [Select]
if [ "$(ls -I '^.' $HOME/$tpl_file_path)" == "" ]
When ran via the browser - it gets a false, i.e. no files exist in the folder. If we do this from the nobody user - it returns a proper dir listing (with files existing)


Anybody could give some tips on what to do? Been working on this for 3 hours with no further results. PHP Info is here: http://tinyurl.com/pgft6mo
Cheers.


Pages: [1]