Open_basedir in Virtualmin

18 posts / 0 new
Last post
#1 Thu, 07/26/2012 - 03:24
marid

Open_basedir in Virtualmin

Hi I have Virtualmin on Centos with mod_fcgid and try setup open_basedir to work my script. This my oen_basedir path: /home/domain/public_html:/home/domain/tmp:/usr/lib/php:/usr/share/pear

This not work

I tested it on other hosting panel with setup open_basedir automatically and my script was working. I don't want chcange Virtualmin. Can you help me?

Thu, 07/26/2012 - 08:37
andreychek

Howdy,

When you say it doesn't work, what happens exactly? What errors do you see?

And do any errors show up in the logs, in $HOME/logs/error_log?

Thanks!

-Eric

Thu, 07/26/2012 - 19:55
marid

Script use Virtualmin remote api to create accounts. When it is on Virtualmin server result is 'you already hosting this domain', 'this usrname alredy exist'.

When I use it on server with setup open_basedir first time my result was 'account created'

I haven't anything in error log

Fri, 07/27/2012 - 04:45
ronald
ronald's picture

open_basedir isn't needed on a server running mod_fcgid and can only lead to errors.
However I think your error has to do with something else but it's not clear to me what you are trying to achieve.
Did you look in other logs to find somekind of error?
If it is because of open_baserdir then there would some permission errors in some log..

Sat, 07/28/2012 - 04:22
marid

It's my error log. It is something with mod_fcgid?

[Sat Jul 28 11:58:34 2012] [emerg] [client 84.31.19.258] (22)Invalid argument: mod_fcgid: can't lock process table in pid 12040, referer: http://domain.com/order/

Sun, 07/29/2012 - 09:41
marid

Ok it is mod_fcgid issue https://issues.apache.org/bugzilla/show_bug.cgi?id=48949

So how I can use mod_fastcgi or suphp with Virtualmin? Use mod_php for shared hosting is not secure.

Sun, 07/29/2012 - 15:23
andreychek

A lot of folks use CGI, and find the performance with it is just fine.

You could try switching to CGI (in Server Configuration -> Website Options), and see if your open_basedir settings work for you.

-Eric

Mon, 07/30/2012 - 10:26
marid

Is it poossible run one domain with cgi and others with fcgid?

Mon, 07/30/2012 - 10:31
andreychek

Sure!

You can configure that by going into Server Configuration -> Website Options, and changing the PHP Execution Mode.

That setting is per-domain.

-Eric

Mon, 07/30/2012 - 13:32
marid

I create domain with cgi mode and have internal server error

my error log:

Premature end of script headers: php5.cgi

Mon, 07/30/2012 - 13:42
andreychek

Howdy,

Are there any other errors accompanying that one?

That error just means that the PHP script died unexpectedly -- which can happen, but if that's all there is, that's going to be hard to track down :-)

If there's any errors in addition to that one, that'd really help determining what the issue is.

-Eric

Mon, 07/30/2012 - 14:12
marid

I had some additional directives in vhost for mod_fcgid, delete it and now have this error log

php5.cgi: line 5: [: ne: binary operator expected PHP Fatal error: Call to a member function config() on a non-object in /home/panel/public_html/includes/class_style.php on line 75

Tue, 07/31/2012 - 14:52
marid

I have made fresh installnVirtualmin on my test server and site run with cgi still loading and loading.... Noting in error log.

Tue, 07/31/2012 - 22:37
andreychek

So just to clarify -- is that with or without enabling the open_basedir setting?

And does it work in FCGID mode?

-Eric

Wed, 08/01/2012 - 00:59
marid

With cgi and enable/diasble open_basedir i have same error

php5.cgi: line 5: [: ne: binary operator expected PHP Fatal error: Call to a member function config() on a non-object in /home/panel/public_html/includes/class_style.php on line 75

With fcgid site work but I have error when creating account

(22)Invalid argument: mod_fcgid: can't lock process table in pid 12040

Wed, 08/01/2012 - 09:10
andreychek

Howdy,

Well, the error you're getting in CGI mode seems to be a PHP issue... if that all had been working before on another system -- could you be seeing a PHP compatibility issue?

That is, if it was working on an earlier PHP version previously, and this is a more recent PHP version you're using now -- it's possible that your application worked with that earlier PHP version, but not this new one.

There's certainly other possibilities as well -- but what you're seeing is a PHP code error.

The error you're getting with FCGID -- it looks like the PHP script isn't running at all (perhaps due to the open_basedir setting), so it may not even be getting a chance to try executing the PHP code.

-Eric

Wed, 08/01/2012 - 17:37
marid

I tested it with php from atomic, remi and base repo without any effect. I also try php 5.4 and have same error with cgi. I don't know how setup open_basedir correctly.

Script working only with mod_php but it not help me anyway.

Thu, 08/02/2012 - 12:15
marid

Wth mod_fastcgi I have same error like with cgi. My decision is move to suphp. With Virtualmin it is easy ;)

Topic locked