LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-02-2009, 03:09 PM   #1
sarajevo
Member
 
Registered: Apr 2005
Distribution: Debian, OpenBSD,Fedora,RedHat
Posts: 228
Blog Entries: 1

Rep: Reputation: 31
squirrelmail on openBSD, Permission denied (13) in /htdocs...


Hi all,

I am trying without success to resolv problem I have with squirrelmail, but no success. So any hint will help me a lot.

I configured postfix+mysql+imap+squirrelmail. It is possible to catch mails using let say evoulution.
Squirrelmail configuration went ok, but now when I try to log in I got error message

" You must be logged in to access this page. "

on official squirrelmail web page is for this error stated

" SquirrelMail error message

You must be logged in to access this page

Solution

If this is a problem for all end users, make sure that the PHP is configured to use session cookies (PHP configuration directive session.use_cookies). Also make sure that the web server has permission to read and write in the directory specified by the PHP configuration directive session.save_path. Note that a web server running under changed root conditions might have this setting relative to the changed web server root and not to the file system root. Sessions are described in the [PHP manual]. Don't forget to restart the web server after reconfiguring PHP. "

I checked php.ini and there is for session.save_path, session.use_cookies stated

session.save_path = "/tmp"
session.use_cookies = 1

But I still have same problem. I restarted web server as well.

I tried to change location and put full path /var/www/tmp but nothing helped. Any suggestion is welcome. OS=openBSD-44, php-5.2.6, nysql-5. )

I suppose there is some, permission problem, but based on this info it seems, all ok, ...suggestions are welcome and thank you in advance.
Another thing, in error.log of web server when I try to log in I got following error:

[Fri Jan 2 22:48:15 2009] [error] PHP Warning: Unknown: open(/tmp/sess_4ueq61hrbldi0aa1rq9dluddr0, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Fri Jan 2 22:48:15 2009] [error] PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
[Fri Jan 2 22:48:28 2009] [error] PHP Warning: session_write_close() [<a href='function.session-write-close'>function.session-write-close</a>]: open(/tmp/sess_4ueq61hrbldi0aa1rq9dluddr0, O_RDWR) failed: Permission denied (13) in /htdocs/webmail/src/redirect.php on line 167
[Fri Jan 2 22:48:28 2009] [error] PHP Warning: session_write_close() [<a href='function.session-write-close'>function.session-write-close</a>]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /htdocs/webmail/src/redirect.php on line 167
[Fri Jan 2 22:48:28 2009] [error] PHP Warning: session_write_close() [<a href='function.session-write-close'>function.session-write-close</a>]: open(/tmp/sess_4ueq61hrbldi0aa1rq9dluddr0, O_RDWR) failed: Permission denied (13) in /htdocs/webmail/functions/auth.php on line 70
[Fri Jan 2 22:48:28 2009] [error] PHP Warning: session_write_close() [<a href='function.session-write-close'>function.session-write-close</a>]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /htdocs/webmail/functions/auth.php on line 70
 
Old 01-02-2009, 04:39 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you use the default OpenBSD apache don't forget that it's runnng chrooted into /var/www by default, so you should check that the directory /var/www/tmp exists and has the correct permissions.

Regards
 
Old 01-03-2009, 01:32 AM   #3
sarajevo
Member
 
Registered: Apr 2005
Distribution: Debian, OpenBSD,Fedora,RedHat
Posts: 228

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Hi Bathory, yes it is default openBSD, I resolved this issue by changing permisions
chmod -R 777 /var/www/tmp. This is still close system without logging from outside, and I am wondering what are correct permissions for /tmp directory.

Now it is like this

drwxrwxrwx 2 www www 512 Jan 3 00:07 tmp

Thank you for commenets and kind regards,


Quote:
Originally Posted by bathory View Post
If you use the default OpenBSD apache don't forget that it's runnng chrooted into /var/www by default, so you should check that the directory /var/www/tmp exists and has the correct permissions.

Regards
 
Old 01-03-2009, 06:30 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Glad to see it worked.
As for the permissions of the chrooted /tmp directory
Code:
chmod -R 755 /var/www/tmp
should be enough.

Regards
 
Old 01-04-2009, 10:55 AM   #5
sarajevo
Member
 
Registered: Apr 2005
Distribution: Debian, OpenBSD,Fedora,RedHat
Posts: 228

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by sarajevo View Post
Hi Bathory, yes it is default openBSD, I resolved this issue by changing permisions
chmod -R 777 /var/www/tmp. This is still close system without logging from outside, and I am wondering what are correct permissions for /tmp directory.

Now it is like this

drwxrwxrwx 2 www www 512 Jan 3 00:07 tmp

Thank you for commenets and kind regards,
Hi Bathory,

thank you for commnent. Iw works now, I am able to log in via web to mail server.
But, even I can send mail from shell from server ( telnet mail.server.com 25....mail from: .... etc ) to external addresess like yahoo. Via web I can not do that.
I have error like

Jan 4 18:43:51 mail postfix/smtpd[20058]: connect from localhost.domain.com[::1]
Jan 4 18:43:51 mail postfix/smtpd[20058]: NOQUEUE: reject: RCPT from localhost.domain.com[::1]: 554 5.7.1 <me@yahoo.com>: Relay access denied; from=<me@domain.com> to=<me@yahoo.com> proto=ESMTP helo=<192.168.1.120>
Jan 4 18:43:51 mail postfix/smtpd[20058]: lost connection after RCPT from localhost.brijeg.com[::1]
Jan 4 18:43:51 mail postfix/smtpd[20058]: disconnect from localhost.domain.com[::1]

Preaty confused, and I read thay parameter mynetworks in main.conf should state networks to which postfix should trust, I am trying to send message from machine via web, and that machine is in same network fragment.

Suggestions are welcome and thank you in advance

Kind regards too all
 
Old 01-04-2009, 06:47 PM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I'm not familiar with postfix, but from the error you get and reading a little about the mynetworks option, I guess you should check /etc/hosts that localhost and localhost.localdomain resolve in the same address (IPv4 and IPv6) and use something like the 3rd example:
Quote:
mynetworks = 127.0.0.0/8 168.100.189.0/28 [::1]/128 [2001:240:587::]/64
(note the brackets for IPv6 addresses), or disable IPv6 if you don't need it.

Regards

Last edited by bathory; 01-05-2009 at 02:25 AM.
 
Old 01-06-2009, 07:23 AM   #7
sarajevo
Member
 
Registered: Apr 2005
Distribution: Debian, OpenBSD,Fedora,RedHat
Posts: 228

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Hi Bathory,

thank you for your comment,
it was everything ok with parameter mynetworks in main.cf.
The problem why I was not able to send mail via squirrelmail interface was authentications parametes. I changed them when running ./configure in /var/www/htdocs/webmail/.
And there is welknown squirrelmaill config screen. Playing with server setings and enabling same auth parameters for smtp as for imap it helped.

Thank you for comments and all best

Kind regards,
 
Old 05-12-2009, 05:59 AM   #8
BJIce
LQ Newbie
 
Registered: May 2009
Posts: 2

Rep: Reputation: 0
Another similar question

Hi Bathory,

I have another similar question. After I install my openBSD 4.5 I've encounter this problem when I send mail vie shell there is no problem everything work just perfect, but when I try to send mail via PHP -> mail() function it just return false. Now I've read a lot of info on the topic and finally understand that the problem is because of this chrooted apache mode that I thing is important but I don't know how to make my mail function /which using sendmail/ working properly with this chrooted mode. If you can help I'll be very grateful.

Regards
 
Old 05-12-2009, 06:34 AM   #9
BJIce
LQ Newbie
 
Registered: May 2009
Posts: 2

Rep: Reputation: 0
I found it

Hi again,

I found the answer here http://www.cyberciti.biz/tips/howto-...-lighttpd.html when you follow every step one by one it works fine.

Thank anyway
Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
Permission Denied poboxjosh Linux - Newbie 8 08-17-2008 04:10 PM
squirrelmail permission denied error Pooh Linux - Security 5 08-12-2007 06:32 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM
access denied on squirrelmail / dovecot / SE Linux policy rioguia Linux - Security 2 07-06-2005 11:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration