Author Topic: (SOLVED) Problems with permissions and database during installation  (Read 14451 times)

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Hello guys,

As you can see is my first time using roundcube, and while i was installing it i notice a variable named identities_level and i need some one to explain this to me, because i cannot anywhere an explanation about it for dummies.

The situation is that i want to set my roundcube, to push and send mails from a hosted mail server, to be used in a private network by a group of people. Roundcube is hosted in a local server of this private network.

I am using a recent version of roundcube (1.2.2) and i have the following options available to this variable:

- Many identities with possibility to edit all params
- Many identities with possibility to edit all params but not email address
- One identity with possibility to edit all programs
- One identity with possibility to edit all programs but not email address
- One identity with possibility to edit only signature

Anyone available to help this noob?  :-[

Thanks!
« Last Edit: October 18, 2016, 07:37:51 AM by SipriusPT »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Question about identities_level
« Reply #1 on: October 11, 2016, 10:08:53 AM »
The setting refers to identities (Setting -> Identities) not actual mail accounts. Actual mail accounts need to be setup on the mail server.

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Question about identities_level
« Reply #2 on: October 11, 2016, 10:13:02 AM »
The setting refers to identities (Setting -> Identities) not actual mail accounts. Actual mail accounts need to be setup on the mail server.

Thanks for the fast reply SKaero.

So what means those identities?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Question about identities_level
« Reply #3 on: October 11, 2016, 12:04:03 PM »
Identities allow you send email from multiple email addresses from one account. Creating an identity doesn't create the email account and if you add an email as a identity it doesn't necessarily mean you can receive email from that address you still have to create the email account on the mail server. Does that answer your question?

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Question about identities_level
« Reply #4 on: October 11, 2016, 12:40:47 PM »
Identities allow you send email from multiple email addresses from one account. Creating an identity doesn't create the email account and if you add an email as a identity it doesn't necessarily mean you can receive email from that address you still have to create the email account on the mail server. Does that answer your question?

Didnt know that was possible. Thanks DKaero!

I have also one more question about the config file, i already generate it and paste it in the especific folder, but i am getting this output:

Quote
Check config file

defaults.inc.php:  OK
config.inc.php:  NOT OK(Unable to read file. Did you create the config file?)
Check if directories are writable

Roundcube may need to write/save files into these directories

/Library/Server/Web/Data/Sites/Default/roundcubemail/temp/:  NOT OK(not writeable for the webserver)
/Library/Server/Web/Data/Sites/Default/roundcubemail/logs/:  NOT OK(not writeable for the webserver)
Use chmod or chown to grant write privileges to the webserver

Check DB config

DSN (write):  NOT OK(Could not read config file)
Test filetype detection

Fileinfo/mime_content_type configuration:  OK
Mimetype to file extension mapping:  OK
   

I have made a checke in my config file to see if there was a missing <?php ?> part and i notice that there was only the beginning of the section, the end was missing, so i generate another config file and i got the same result. After that i add the ?> and still nothing.

I am using a MAC OS X and my file is being storage at:

/Library/Server/Web/Data/Sites/Default/roundcubemail/config/

To me doesnt seem a problem with privileges because i already set those to 777 at roundcubemail and still nothing.

If its necessary i could start a new tread for this different issue.

Thanks again!


Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Question about identities_level
« Reply #5 on: October 11, 2016, 03:52:32 PM »
I have made a checke in my config file to see if there was a missing <?php ?> part and i notice that there was only the beginning of the section, the end was missing, so i generate another config file and i got the same result. After that i add the ?> and still nothing.
PHP doesn't require there to be an ending ?> at the end of the file and its purposely not there because it can cause problem if there happens to be a space after the end of the php code. The error your seeing means it can't load the config file not that there is any problem in it since it is unable to get that far.

To me doesnt seem a problem with privileges because i already set those to 777 at roundcubemail and still nothing.
There is something wrong with the permissions, most likely the web server requires files to under a specific user and/or privileges set (some web server configurations will not allow access of files set to 777.)

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Question about identities_level
« Reply #6 on: October 12, 2016, 05:01:51 AM »
To me doesnt seem a problem with privileges because i already set those to 777 at roundcubemail and still nothing.
There is something wrong with the permissions, most likely the web server requires files to under a specific user and/or privileges set (some web server configurations will not allow access of files set to 777.)

But i really dont understand how can be, because both defaults.inc.php and config.inc.php had the same permissions and user owner.

When i changed the default permissions on files, i changed both files permissions to 777 (both defaults.inc.php and config.inc.php) and defaults.inc.php continues OK except the config.inc.php.

I notice that the main folder of the website was owned by a user called root and the subfolder roundcubemail was under another user, but both in the same group of privileges (admin) =/

This is how i have now privileges in those subfolders and folder:

Quote
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/config
total 128
-rw-r--r--@ 1 root  admin    164 28 Sep 20:30 .htaccess
-rw-r--r--@ 1 root  admin   3983 28 Sep 20:30 config.inc.php.sample
-rw-r--r--@ 1 root  admin  51625 28 Sep 20:30 defaults.inc.php
-rw-r--r--@ 1 root  admin   2815 28 Sep 20:30 mimetypes.php

Quote
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/
total 440
-rwxrwxrwx@  1 root  admin    1940 28 Sep 20:30 .htaccess
-rwxrwxrwx@  1 root  admin  136602 28 Sep 20:30 CHANGELOG
-rwxrwxrwx@  1 root  admin    9954 28 Sep 20:30 INSTALL
-rwxrwxrwx@  1 root  admin   35147 28 Sep 20:30 LICENSE
-rwxrwxrwx@  1 root  admin    3736 28 Sep 20:30 README.md
drwxr-xr-x@ 12 root  admin     408 28 Sep 20:30 SQL
-rwxrwxrwx@  1 root  admin    3403 28 Sep 20:30 UPGRADING
drwxr-xr-x@ 19 root  admin     646 28 Sep 20:30 bin
-rwxrwxrwx@  1 root  admin    1353 28 Sep 20:30 composer.json-dist
drwxr-xr-x@  6 root  admin     204 28 Sep 20:30 config
-rwxrwxrwx@  1 root  admin   12412 28 Sep 20:30 index.php
drwxr-xr-x@  9 root  admin     306 28 Sep 20:30 installer
drwxr-xr-x@  3 root  admin     102 28 Sep 20:30 logs
drwxr-xr-x@ 35 root  admin    1190 28 Sep 20:30 plugins
drwxr-xr-x@  8 root  admin     272 28 Sep 20:30 program
drwxr-xr-x@  8 root  admin     272 28 Sep 20:30 public_html
-rwxrwxrwx@  1 root  admin      26 28 Sep 20:30 robots.txt
drwxr-xr-x@  4 root  admin     136 28 Sep 20:30 skins
drwxr-xr-x@  3 root  admin     102 28 Sep 20:30 temp
drwxr-xr-x@  9 root  admin     306 28 Sep 20:32 vendor

Quote
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/
total 304
-rw-r--r--@  1 gfe-tecserver  admin    6148 11 Oct 10:32 .DS_Store
drwxr-xr-x   2 root           wheel      68 23 Jun  2014 NetBoot
-rw-r--r--   1 root           wheel  102749 14 May  2014 Server.png
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.de -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/de.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.en -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/en.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.es -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/es.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.fr -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/fr.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.it -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/it.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.ja -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/ja.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.ko -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/ko.lproj/default.html
lrwxr-xr-x   1 root           admin      88 23 Jun  2014 default.html.nl -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/nl.lproj/default.html
lrwxr-xr-x   1 root           admin      91 23 Jun  2014 default.html.zh-CN -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/zh_CN.lproj/default.html
lrwxr-xr-x   1 root           admin      91 23 Jun  2014 default.html.zh-TW -> /Applications/Server.app/Contents/ServerRoot/usr/share/web/locales/zh_TW.lproj/default.html
-rw-r--r--   1 root           wheel    7782 23 Jun  2014 favicon.ico
-rw-r--r--   1 root           wheel     269 23 Jun  2014 info.php
drwxr-xr-x@ 22 root           admin     748 28 Sep 20:32 roundcubemail

I am using the default folder for websites that came with the websites app.

What kind of privileges do you recommend or suggest?

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Question about identities_level
« Reply #7 on: October 12, 2016, 06:44:53 AM »
Also on other folders that was unable to write in the test config such as:

Quote
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/temp/
total 8
-rwxrwxrwx@ 1 root  admin  164 28 Sep 20:30 .htaccess
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/logs/
total 8
-rwxrwxrwx@ 1 root  admin  164 28 Sep 20:30 .htaccess

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Question about identities_level
« Reply #8 on: October 12, 2016, 07:12:38 AM »
My web server is running as root, the new folders created by it, comes with a ownership of root.

Sorry for the spam, but i have no clue on how can i solve this =X

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Question about identities_level
« Reply #9 on: October 12, 2016, 09:16:09 AM »
I notice that config.inc.php was missing in the copy paste that i have made before, but after a while i fix the config.inc.php by changing the owner name of the roundcubemail folder and subfolders from user name to root, and then i add the config.inc.php, but i continue in the same situation in those two folder temp and logs and dont know why. I will be posting updates here, for people who may pass between those problems.

Now i have all the same privileges and user ownership on temp and logs, like i have on config, and still doesnt detect =/

Quote
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/
total 440
-rwxrwxrwx@  1 root  admin    1940 28 Sep 20:30 .htaccess
-rwxrwxrwx@  1 root  admin  136602 28 Sep 20:30 CHANGELOG
-rwxrwxrwx@  1 root  admin    9954 28 Sep 20:30 INSTALL
-rwxrwxrwx@  1 root  admin   35147 28 Sep 20:30 LICENSE
-rwxrwxrwx@  1 root  admin    3736 28 Sep 20:30 README.md
drwxr-xr-x@ 12 root  admin     408 28 Sep 20:30 SQL
-rwxrwxrwx@  1 root  admin    3403 28 Sep 20:30 UPGRADING
drwxr-xr-x@ 19 root  admin     646 28 Sep 20:30 bin
-rwxrwxrwx@  1 root  admin    1353 28 Sep 20:30 composer.json-dist
drwxr-xr-x@  7 root  admin     238 12 Oct 14:07 config
-rwxrwxrwx@  1 root  admin   12412 28 Sep 20:30 index.php
drwxr-xr-x@  9 root  admin     306 28 Sep 20:30 installer
drwxr-xr-x@  3 root  admin     102 28 Sep 20:30 logs
drwxr-xr-x@ 35 root  admin    1190 28 Sep 20:30 plugins
drwxr-xr-x@  8 root  admin     272 28 Sep 20:30 program
drwxr-xr-x@  8 root  admin     272 28 Sep 20:30 public_html
-rwxrwxrwx@  1 root  admin      26 28 Sep 20:30 robots.txt
drwxr-xr-x@  4 root  admin     136 28 Sep 20:30 skins
drwxr-xr-x@  3 root  admin     102 28 Sep 20:30 temp
drwxr-xr-x@  9 root  admin     306 28 Sep 20:32 vendor
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/temp
total 8
-rw-r--r--@ 1 root  admin  164 28 Sep 20:30 .htaccess
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/logs
total 8
-rw-r--r--@ 1 root  admin  164 28 Sep 20:30 .htaccess
X-Mac-Pro:~ root# ls -l /Library/Server/Web/Data/Sites/Default/roundcubemail/config
total 136
-rw-r--r--@ 1 root           admin    164 28 Sep 20:30 .htaccess
-rw-r--r--@ 1 user_name  staff   3774 12 Oct 14:06 config.inc.php
-rw-r--r--@ 1 root           admin   3983 28 Sep 20:30 config.inc.php.sample
-rw-r--r--@ 1 root           admin  51625 28 Sep 20:30 defaults.inc.php
-rw-r--r--@ 1 root           admin   2815 28 Sep 20:30 mimetypes.php

P.S. i have also changed the title of this thread.

UPDATE1:

It seems that both /logs and /temp, and all the stuff inside, must be at 777. Privileges from those folders must be different from /config.

Now i am unable to use the database that i have created before, and my mysql server is working, and the database is created =/:

Quote
Check DB config

DSN (write):  NOT OK(SQLSTATE[HY000] [2002] No such file or directory)
Make sure that the configured database exists and that the user has write privileges

I have already created another database and i had the same problem, so i dont know if i am having syntax problem (for example the username that i have added who is admin@localhost, and i dont know if i should use the @localhost from what i have seen in the config file, it converts the @ to %40), or if i am having a problem with my database, for example some kind of privileges. I have used the follow commands to create my database (was copy pasted from the tutorial that i am following here):

CREATE DATABASE name_of_database;
CREATE USER name_of_user@IP.address.of.server.hosting.database IDENTIFIED BY 'account_password';
GRANT ALL PRIVILEGES ON name_of_database.* TO name_of_user@IP.address.of.server.hosting.database WITH GRANT OPTION;

UPDATE2:

I discover how i should put syntax through defaults.inc.php but still the same result:

Check DB config

Quote
DSN (write):  NOT OK(SQLSTATE[HY000] [2002] No such file or directory)
Make sure that the configured database exists and that the user has write privileges
DSN: mysql://roundcubemail:XXX@localhost/roundcubemail
« Last Edit: October 12, 2016, 11:16:19 AM by SipriusPT »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Problems with permissions during installation
« Reply #10 on: October 12, 2016, 12:52:56 PM »
The SQL error your getting means that it can't connect the database socket, if your using localhost as the mysql server name you could try 127.0.0.1 some servers are picky about how you can connect.

Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Problems with permissions during installation
« Reply #11 on: October 13, 2016, 05:09:35 AM »
The SQL error your getting means that it can't connect the database socket, if your using localhost as the mysql server name you could try 127.0.0.1 some servers are picky about how you can connect.

Thanks one more time SKaero, so what i have found was that i (indeed) had a problem as you said with mysql socket, it was active, but my php settings in php.ini was not appointed to the socket location, so i add the location like in the lines bellow:

pdo_mysql.default_socket = /private/tmp/mysql.sock
mysql.default_socket = /private/tmp/mysql.sock

Restart both mysql and websites server and finally it connects but then i get an error, but i notice that there was a button to inicialize the database so i made it and now i have my config all OK =D:

Quote
Check config file

defaults.inc.php:  OK
config.inc.php:  OK
Check if directories are writable

Roundcube may need to write/save files into these directories

/Library/Server/Web/Data/Sites/Default/roundcubemail/temp/:  OK
/Library/Server/Web/Data/Sites/Default/roundcubemail/logs/:  OK
Check DB config

DSN (write):  OK
DB Schema:  OK
DB Write:  OK
DB Time:  OK
Test filetype detection

Fileinfo/mime_content_type configuration:  OK
Mimetype to file extension mapping:  OK



Offline SipriusPT

  • Jr. Member
  • **
  • Posts: 36
Re: Problems with permissions and database during installation
« Reply #12 on: October 13, 2016, 07:30:15 AM »
Well now after the installation it seems that there is a problem with my SMTP client authentication -_-"

I have created another tread for this issue:

http://www.roundcubeforum.net/index.php/topic,23740.0.html