LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Squirrelmail local login works but not from somewhere else (https://www.linuxquestions.org/questions/linux-server-73/squirrelmail-local-login-works-but-not-from-somewhere-else-755304/)

cojones 09-15-2009 04:40 AM

Squirrelmail local login works but not from somewhere else
 
Hello,

I just installed Squirrelmail and tested it locally (http://localhost/squirrelmail) and it works but when I try to login externally (http://www.example.com/squirrelmail) I get following error messages:
Error opening ../config/default_pref
Could not create initial preference file!
/var/lib/squirrelmail/data/ should be writable by user www-data
Please contact your system administrator and report this error.

Does anyone know why this could be? Permissions are set correctly cause it's working locally...

bathory 09-15-2009 05:02 AM

Does /var/lib/squirrelmail/data/ default_pref exist?

cojones 09-15-2009 05:41 AM

No and I think it doesn't need to be there cause the pref file for my account was correctly created when I logged in locally and it's in that directory. I copied it there anyway to try but no change, same error.

bathory 09-15-2009 06:06 AM

Use the squirrelmail configtest (http://localhost/squirrelmail/src/configtest.php) to see if you find any problem.
And double check the permissions in /var/lib/squirrelmail/data:
Code:

ls -l /var/lib/squirrelmail
ls -l /var/lib/squirrelmail/data


cojones 09-15-2009 06:18 AM

I did that configtest.php. No errors and then I logged in using the link on configtest.php and it worked because it was locally. Tried it externally and it didn't work.

Permissions:
ls -l /var/lib/squirrelmail
drwxr-xr-x 2 www-data www-data 4096 2009-09-15 12:29 data

ls -l /var/lib/squirrelmail/data
-rwxr-xr-x 1 www-data www-data 41 2009-09-15 12:29 default_pref
-rw------- 1 www-data www-data 52 2009-09-15 11:22 me@example.com.pref

bathory 09-15-2009 06:39 AM

What happens if you try to log in using me@example.com as username?
Btw what distro are you using?

cojones 09-15-2009 06:39 AM

I just did a configtest.php externally and look what I got:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/lib/squirrelmail/data/) is not within the allowed path(s): (/var/www/vhcs2/gui/:/etc/vhcs2/:/proc/:/var/www/virtual/:/tmp/) in /var/www/vhcs2/gui/tools/squirrelmail/src/configtest.php on line 226
ERROR: Data dir (/var/lib/squirrelmail/data/) does not exist!

I guess I just need to add /var/lib/squirrelmail/data/ to the open_basedir?

cojones 09-15-2009 06:41 AM

That's the username I was using all the time. I'm using Debian.

bathory 09-15-2009 06:51 AM

Quote:

I guess I just need to add /var/lib/squirrelmail/data/ to the open_basedir?
I guess you have to add just /var/lib/squirrelmail

cojones 09-15-2009 07:26 AM

Tried it and didn't help, now put data and attach to a allowed path and changed the paths via squirrelmail_config and I get:
ERROR: Data dir (/var/lib/squirrelmail/data/) does not exist!

I only need to change it via squirrelmail_config, right? I restarted Apache and cleared the cache. Weird.

bathory 09-15-2009 07:45 AM

It's weird indeed. The strange thing is that it works for localhost.
I know little about apache in debian, but IIRC you have to run "a2ensite www.example.com" to enable a vhost. Have you done that?

cojones 09-16-2009 03:01 AM

The domain is working for sure cause I can access www.example.com

I keep changing the directory in the squirrelmail-configuration but always get ERROR: Data dir (/var/lib/squirrelmail/data/) does not exist! Is there maybe some other config file that has this value?

bathory 09-16-2009 03:16 AM

It's written in config.php. You can edit it by hand, or use conf.pl (/etc/squirrelmail/conf.pl) for this.

cojones 09-16-2009 03:26 AM

squirrelmail-configure is conf.pl so that's pretty much the same. i don't know... i'm gonna try another webmail interface.

bathory 09-16-2009 03:43 AM

Looking at my config.php, there are 2 options: provider_uri and domain. Change them and see if it helps.


All times are GMT -5. The time now is 12:15 PM.