I'm stumped on a shared install

Having trouble installing serendipity?
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

I'm stumped on a shared install

Post by jdc »

Hello!

I have searched the forum and googled a bunch with no luck, I hope someone can point me in the right direction.

I have followed the directions from http://www.s9y.org/41.html with no success (using links to htmlarea and templates).

If anyone has any ideas or needs more info, post/ask away!

The setup:

Main install of serendipity under /servers/web/s9y
Shared install under /home/user/public_html/blog
PHP 5.2.3
Apache 2

/servers/web/s9y is owned by web.web (apache UID/GID)
/home/user/public_html/blog is owned by user.web, as are the files in it.

For testing, I have the main install set up under an alias (call it www.foo.org/blog) with the user directory install as a virtual host (user.foo.org).

The main install works perfectly.

The user install, however... When I go to the URL, I receive the following errors:

Warning: require_once(s9y/index.php) [function.require-once]: failed to open stream: Operation not permitted in /home/user/public_html/blog/index.php on line 6

Fatal error: require_once() [function.require]: Failed opening required 's9y/index.php' (include_path='.:/usr/lib/php/:/server/web/s9y/:/server/web/s9y/bundled-libs/:/home/user/public_html/blog/') in /home/user/public_html/blog/index.php on line 6


Apache.conf:
<VirtualHost *:80>
ServerName user.foo.org
DocumentRoot /home/user/public_html/blog
<Directory "/home/user/public_html/blog">
AllowOverride All
</Directory>
php_value include_path ".:/usr/lib/php/:/server/web/s9y/:/server/web/s9y/bundled-libs/:/home/user/public_html/blog/"
php_admin_value open_basedir "/usr/lib/php/:/server/web/s9y/:/home/user/public_html/blog/"
</VirtualHost>
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: I'm stumped on a shared install

Post by garvinhicking »

Hi!

What do you mean with "main install"? You actually don't need to "install" the serendipity in /servers/web/s9y! Actually, that would make problems. That directory really only is the core acting for user installations. Only user directories are installed.

So, you should remove the file '/servers/web/s9y/serendipity_config_local.inc.php' as this would indicate the master version being installed, and no user installation being properly spawnable.

Also you need to change your apache.conf include_path setting to:

Code: Select all

php_value include_path '.:/usr/lib/php/:/server/web/:/server/web/s9y/:/server/web/s9y/bundled-libs/:/home/user/public_html/blog/"
php_admin_value open_basedir "/usr/lib/php/:/server/web/:/server/web/s9y/:/home/user/public_html/blog/"
[code]

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

Still no joy...

Post by jdc »

What do you mean with "main install"? You actually don't need to "install" the serendipity in /servers/web/s9y! Actually, that would make problems. That directory really only is the core acting for user installations. Only user directories are installed.
Main install refers to the decompressing of the tarball downloaded from the site. I ran the installer for that one in a host alias to make sure the web server and php are able to run the scripts.
So, you should remove the file '/servers/web/s9y/serendipity_config_local.inc.php' as this would indicate the master version being installed, and no user installation being properly spawnable.

Also you need to change your apache.conf include_path setting to:
OK, done, and still no joy. I still get the same errors when I go to the virtual domain for the user.

I tried moving the current /server/web/s9y directory and untarring from the original downloaded tarball, same results. By everything I have found, this should work, but for some reason it's not.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Still no joy...

Post by garvinhicking »

Hi!
Main install refers to the decompressing of the tarball downloaded from the site. I ran the installer for that one in a host alias to make sure the web server and php are able to run the scripts.
Ah, okay, that's fine then. So no serendipity_Config_local.inc.php file is in the shared directory, only in the user directory?
OK, done, and still no joy. I still get the same errors when I go to the virtual domain for the user.
Did you check permissions?

The error tells us that no "s9y/index.php" file can be included. However that file is in /server/web/s9y/index.php". When not having the include path set to /server/web/ (like you had before) that would be a reason that file cannot be found. Now that you changed the include path, it should work. Maybe you need to restart apache for the changes to take effect.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

Re: Still no joy...

Post by jdc »

garvinhicking wrote:Ah, okay, that's fine then. So no serendipity_Config_local.inc.php file is in the shared directory, only in the user directory?
Actually, looking at the users directory, there isn't a serendipity_Config_local.inc.php file. It would appear that the script doesn't ever get that far to generate one.
garvinhicking wrote:Did you check permissions?

The error tells us that no "s9y/index.php" file can be included. However that file is in /server/web/s9y/index.php". When not having the include path set to /server/web/ (like you had before) that would be a reason that file cannot be found. Now that you changed the include path, it should work. Maybe you need to restart apache for the changes to take effect.
Permissions:

Everything in /server/web/s9y is owned by web.web (the user and group that apache runs under)

Everything under /home/user/public_html/blog is owned by the user with the group of web (except for the symlinked directories, those are owned by the apache user). I believe I have even tried setting everything to 777 with no luck.

And believe me, I've been restarting apache every time I make a change to the apache config file. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Still no joy...

Post by garvinhicking »

Hi!

Can you show me the exact error message you now get with the modified apache?

Sorry for mentioning themissing config_local file.I didn't understand that the error message is the only thing you get - I thought you were able to install a user blog already.

What we need to find out is why "include 's9y/index.php'" does not workin your case - this can only happen if the "include_path" does not properly point to the base directory where s9y is installed in. Maybe it conflicts with another open_basedir setting?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

It Lives! was- Re: Still no joy...

Post by jdc »

garvinhicking wrote:Can you show me the exact error message you now get with the modified apache?
Warning: require_once(s9y/index.php) [function.require-once]: failed to open stream: Operation not permitted in /home/user/public_html/blog/index.php on line 6

Fatal error: require_once() [function.require]: Failed opening required 's9y/index.php' (include_path='.:/usr/lib/php/:/server/web/s9y/:/server/web/s9y/bundled-libs/:/home/user/public_html/blog/') in /home/user/public_html/blog/index.php on line 6
garvinhicking wrote:Sorry for mentioning themissing config_local file.I didn't understand that the error message is the only thing you get - I thought you were able to install a user blog already.

What we need to find out is why "include 's9y/index.php'" does not workin your case - this can only happen if the "include_path" does not properly point to the base directory where s9y is installed in. Maybe it conflicts with another open_basedir setting?
No worries on the config file bit. :)

As for the open_basedir setting, I though of that... The open_basedir in the apache conf is the only open_basedir I have set, the one in php.ini is commented out.

Now here is a kicker... I checked my php.ini, found that safe mode was on. Turned it off, it complained about an open_basedir restriction... I removed it from https.conf, and the system appears to be working now. :D

The shared install directions, are they written assuming that safe mode will be on? Personally, I'd rather have safe mode on and get this working than leaving it off, and I am willing to work with the forum and try different things to make it work with safe mode. If nothing else, it helps the community increase the knowledge base.
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

Whoops, spoke too soon...

Post by jdc »

Looks like things are not working perfectly...

The javascript stuff is broken on the plugin config page, as is the SSL support for the login...

I do have another virtual host for the web mail under an SSL link, however, using SSL for the login from the directory alias I mentioned earlier does work. :?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Whoops, spoke too soon...

Post by garvinhicking »

Hi!

In the fatal error messag,e did you notice that '/server/web/' was NOT in the include_path, as I said it must be?

Anyways - shared installation also works in SafeMode,if the open_basedirs are properly configured. SafeMode itself onlyputs stronger restrictions on files so that web owners etc. must fit properly on each other. If all is configured (which is hard to achieve, but doable) it works with s9y shared install.
The javascript stuff is broken on the plugin config page, as is the SSL support for the login...
The javascripts and SSL login have been reworked in the serendipity 1.2-beta version, you might want to try that!

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

Re: Whoops, spoke too soon...

Post by jdc »

garvinhicking wrote:In the fatal error messag,e did you notice that '/server/web/' was NOT in the include_path, as I said it must be?
Sorry, my mistake, it is in there. I just turned safe mode back on and went to the page:

Code: Select all

Warning: require_once(s9y/index.php) [function.require-once]: failed to open stream: Operation not permitted in /home/user/public_html/blog/index.php on line 6

include_path='.:/usr/lib/php/:/server/web/:/server/web/s9y/:/server/web/s9y/bundled-libs/:/home/cynical/public_html/blog/') in /home/user/public_html/blog/index.php on line 6
garvinhicking wrote:Anyways - shared installation also works in SafeMode,if the open_basedirs are properly configured. SafeMode itself onlyputs stronger restrictions on files so that web owners etc. must fit properly on each other. If all is configured (which is hard to achieve, but doable) it works with s9y shared install.

The javascripts and SSL login have been reworked in the serendipity 1.2-beta version, you might want to try that!
I am.

serendipity-1.2-beta1.tar.bz2 is the tarball I grabbed.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Whoops, spoke too soon...

Post by garvinhicking »

Hi!

Hm, with enabled SafeMode, it might be that requires/include from a user directory require that the permissions on the shared installation files are members of the same group (or even with matching owners).

I'm not that experienced with safe mode, but I think you can relax the GID/UID check with some php.ini option...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

Re: Whoops, spoke too soon...

Post by jdc »

garvinhicking wrote:Hm, with enabled SafeMode, it might be that requires/include from a user directory require that the permissions on the shared installation files are members of the same group (or even with matching owners).
I would agree, but what?

I added this to the vhost confg:

Code: Select all

php_admin_value safe_mode_include_dir   /usr/lib/php/:/server/web/:/server/web/s9y/:/home/user/public_html/blog/
And I seem to have gotten further, I now get:

Code: Select all

Warning: Smarty error: unable to read resource: "index.tpl" in /server/web/s9y/bundled-libs/Smarty/libs/Smarty.class.php on line 1095
Closer, but still not yet there.
garvinhicking wrote:I'm not that experienced with safe mode, but I think you can relax the GID/UID check with some php.ini option...
Which I did:

Code: Select all

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = Off
Is there anyone who can share their php setup with me? I can only think that it has something to do with the way php was compiled on the server and/or the php.ini.

A normal install works, but I don't want to suck up any more disk space than needed if I can help it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Whoops, spoke too soon...

Post by garvinhicking »

Hi!

That Smarty error means that PHP cannot access the "templates_c" or "templates" directory of either the local or shared install. Can you check the permissions and ownerships of those directories? Maybe you also need to include them specifically to your safe_mode include listing?
Is there anyone who can share their php setup with me? I can only think that it has something to do with the way php was compiled on the server and/or the php.ini.
I myself sadly don't use shared installs on my personal servers. Maybe Jannis who operates supersized.org on shared install mode can contribute this, I'll ask him.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jhermanns
Site Admin
Posts: 378
Joined: Tue Apr 01, 2003 11:28 pm
Location: Berlin, Germany
Contact:

Post by jhermanns »

recap:
  1. Each user blog has it's own serendipity_config_local.inc.php file with the correct settings (it's own database and/or table prefixes)
  2. Each user blog has it's own uploads directory
  3. Each user blog has the db set correctly (see 1)
  4. Each user blog has all paths set correctly in the config table
  5. You answered each of the above questions with yes?
:)
jdc
Regular
Posts: 13
Joined: Fri Jun 08, 2007 4:49 am

Post by jdc »

jhermanns wrote:recap:
  1. Each user blog has it's own serendipity_config_local.inc.php file with the correct settings (it's own database and/or table prefixes)
  2. Each user blog has it's own uploads directory
  3. Each user blog has the db set correctly (see 1)
  4. Each user blog has all paths set correctly in the config table
  5. You answered each of the above questions with yes?
The user in question has a serendipity_config_local.inc.php file that I created in an effort to troubleshoot, otherwise no, the install procedure doesn't get that far before being stopped.

Everything else is yes, excect for "Each user blog has all paths set correctly in the config table"... which config table is being referred to? If it's the apache config file, yes, it is set correctly per the readme for shared installs.
Post Reply