LinHES Forums
http://forum.linhes.org/

php_sessions problem solved...
http://forum.linhes.org/viewtopic.php?f=6&t=2378
Page 1 of 1

Author:  kdorff [ Fri Sep 10, 2004 10:06 am ]
Post subject:  php_sessions problem solved...

I posted this as a question in the "installation" forum, but, I guess it wasn't a good enough question because somebody seems to have deleted my previous message. I found the solution so I returned just in case anybody else has the problem.

This issue centers on enabling basic authentication on the MythWeb pages so if you expose your MythWeb on the internet you need a username and password to access your MythWeb.

I won't rehash the entire process step by step, but, in general you must

1. Use "htpasswd" to create a password file
2. Edit /etc/apache/conf/httpd.conf, changing AllowOverride so apache will accept the instance of .htaccess files in the htdocs directories. I changed mine to AllowOverride to All but you can probably be less permissive. You will need to change the AllowOverride for both "/" and for Apache in general.
3. EDIT the /var/www/.htaccess that is distributed by KnoppMyth (but probably comes wholesale from the MythWeb source). The first 4 lines are commented out, uncomment them. The line that points at the password file should be changed to point at the password file you created in step 1.

Now if that is all you do, your site will be protected by basic authentication, but, you will receive an error about php_sessions, a directory not existing or some such. One more change must be made

4. Go back into the .htaccess file and file the line that says something like
Quote:
session.save_path = php_sessions

change this to
Quote:
session.save_path = /tmp

and the error will be resolved. I am not quite sure with it was changed from the default (the default is /tmp) but this fixes it.

Author:  ceenvee703 [ Fri Sep 10, 2004 10:18 am ]
Post subject: 

Cool: I had this same problem and it looks like this will fix it. Thanks for reporting back. I will try to update the wiki as well.

(PS: since your message was a post-installation problem, it was probably removed from Installation for that reason)

Author:  kdorff [ Fri Sep 10, 2004 11:40 am ]
Post subject:  Probably need to read the FAQ

I probably just need to read the FAQ for these forums... I call it Install until everything is up and running. I wouldn't personally consider MythWeb really fully running until it is protected, but, I realize others differ. Most people probably have no need to protect MythWeb.

Author:  mattshaw [ Thu Oct 28, 2004 1:58 pm ]
Post subject:  RE: php_sessions problem solved...

Good help, but I have found a few differences. I am currently running on R4V5, and found the same on R4V4. I will detail these below.

When I first edited /var/www/.htaccess (remembering /var/www is a symbolic link to /usr/share/mythtv/mythweb) the vi session said new file, so there was not a file there provided by the knoppmyth distribution, it was an empty new file, I therefore put the required information in.

I can now access mythweb fine from my internal lan, but when trying to access from outside with a good login I get php session errors (as expected).

I put in the line "session.save_path = /tmp" into my .htaccess file as explained above, and restarted the httpd daemon.

Can't now connect even from my internal lan. Upon checking the apache error log file I see the following entry

[Thu Oct 28 20:20:12 2004] [alert] [client X.X.X.X] /var/www/.htaccess: Invalid command 'session.save_path', perhaps mis-spelled or defined by a module not included in the server configuration

Once I remove the session.save_path comment and restart the webserver everything is fine, except the php sessions problem.

Please help.

Regards
Matt Shaw
matt@shagshaw.com

Author:  wrooster [ Fri Oct 29, 2004 1:24 pm ]
Post subject: 

matt,

that directive goes into your php.ini file, not the .htaccess file:
Code:
jds@mythtv:/ $ find / -name php.ini -print 2> /dev/null
/etc/php4/apache/php.ini
/usr/share/doc/php4/examples/php.ini

jds@mythtv:/ $ grep session.save_path /etc/php4/apache/php.ini
session.save_path = /tmp


after changing php.ini, you must restart apache (=httpd), as root:
Code:
root@mythtv:/# /etc/init.d/apache restart


jim

Author:  mattshaw [ Sat Oct 30, 2004 5:25 am ]
Post subject:  re: php sessions/mythweb

Hey Jim

Thanks for the suggestion, but just checked both of the php.ini files on the system, and they already contain the session.save_path = /tmp directive.

Any other ideas, anyone ???


Cheers

Matt Shaw
matt@shagshaw.com

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/