LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-05-2020, 08:22 AM   #1
Callumk
LQ Newbie
 
Registered: Feb 2020
Posts: 4

Rep: Reputation: Disabled
SquirrelMail 1.4.22 cannot create initial preference file Ubuntu Server 18.0.4


Hey guys, so I know this question has been asked on many different forums - I've looked at tons of them and still can't find the issue.

I have been using the following guide to set up a SquirrelMail server:
https://www.tecmint.com/setup-postfi...ubuntu-debian/

However, when I try to log in, I get the following message:

Error opening ../data/default_pref
Could not create initial preference file!
/var/local/squirrelmail/data/ should be writable by user www-data

I have already gone into the /var/www/html/squirrelmail dir and done the following:

Code:
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chown -R www-data:www-data /var/www/html/squirrelmail/
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chmod 777 -R /var/www/html/squirrelmail/
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chown -R www-data:www-data /var/www/html/squirrelmail/data/
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chmod 777 -R /var/www/html/squirrelmail/data/
callum@servpalletloopclub:/var/www/html/squirrelmail$ service dovecot restart 
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'dovecot.service'.
Authenticating as: callum
Password: 
==== AUTHENTICATION COMPLETE ===
callum@servpalletloopclub:/var/www/html/squirrelmail$ cd data/
callum@servpalletloopclub:/var/www/html/squirrelmail/data$ ls 
default_pref  index.php
callum@servpalletloopclub:/var/www/html/squirrelmail/data$ ls -ah
.  ..  default_pref  .htaccess  index.php
callum@servpalletloopclub:/var/www/html/squirrelmail/data$ ls -ltha
total 20K
drwxrwxrwx  2 www-data www-data 4.0K Jul 12  2011 .
drwxrwxrwx 16 www-data www-data 4.0K Jul 12  2011 ..
-rwxrwxrwx  1 www-data www-data  480 Jan  6  2011 index.php
-rwxrwxrwx  1 www-data www-data   41 Feb  7  2007 default_pref
-rwxrwxrwx  1 www-data www-data   14 Mar  2  2002 .htaccess
I don't understand what the www-data user could possibly not have write permissions to - anybody have any ideas?
 
Old 02-06-2020, 02:26 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Error opening ../data/default_pref
Could not create initial preference file!
/var/local/squirrelmail/data/ should be writable by user www-data
<snip>
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chown -R www-data:www-data /var/www/html/squirrelmail/
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chmod 777 -R /var/www/html/squirrelmail/
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chown -R www-data:www-data /var/www/html/squirrelmail/data/
callum@servpalletloopclub:/var/www/html/squirrelmail$ sudo chmod 777 -R /var/www/html/squirrelmail/data/
callum@servpalletloopclub:/var/www/html/squirrelmail$ service dovecot restart
<snip
The actual data directory is different than the one you've changed permissions in order to be writable by the apache user
(/var/local/squirrelmail/data instead of /var/www/html/squirrelmail/data)

It's not your fault, but the howto you've followed is not good.
Besides the discrepancies in the directories names it mentions to create users and give them homedir inside the webserver docroot! IMO that's bad practice. Better stick with the default users' dir (like /home/user)
Also it's bad practice to give 777 permissions. Directories need just 755 and files 644

Regards
 
1 members found this post helpful.
Old 02-06-2020, 02:54 AM   #3
Callumk
LQ Newbie
 
Registered: Feb 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi Bathory,

Ah I can't believe I didn't spot that, I need to be more diligent next time!


Also yes I agree, I only gave 777 permissions as a test - once I got it working I would have probably changed permissions to 755 as you mentioned.


Thank you for the help anyway


This thread can be closed now.
 
Old 02-06-2020, 03:08 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by Callumk View Post
Hi Bathory,

Ah I can't believe I didn't spot that, I need to be more diligent next time!


Also yes I agree, I only gave 777 permissions as a test - once I got it working I would have probably changed permissions to 755 as you mentioned.


Thank you for the help anyway


This thread can be closed now.
Cool! You can use the "Thread Tools" on top of the page to mark the thread solved.

Cheers
 
  


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
Squirrelmail SElinux Default preference file not found or not readable terek Linux - Security 11 02-04-2011 10:26 AM
cannot find login preference's window in fedora 14 linuxwhacko Fedora 4 01-27-2011 02:46 PM
Squirrelmail could not create initial preference file KoopaTroopa Linux - Enterprise 2 01-13-2011 12:13 AM
Squirrelmail: Query: CREATE "INBOX.Sent" Reason Given: Cannot create this folder. Chiragrs Linux - Server 2 03-10-2008 11:37 AM
Cannot find "Desktop Preference" menu in gnome using Suse 10 mr_bean Linux - Newbie 2 03-27-2006 11:47 PM

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

All times are GMT -5. The time now is 10:59 PM.

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