Unable to get WebMail working

Discussion in 'ISPConfig 3 Priority Support' started by peterpetr, Oct 8, 2020.

  1. peterpetr

    peterpetr Member HowtoForge Supporter

    @till It seems that using "sudo -s" then following instructions in step:
    16. Install ISPConfig 3.1
    of the Perfect Server tutorial still results in the errors I described in my previous post.

    After successfully executing "sudo -s" and executing:
    php -q install.php

    Below is the first error I encounter (in bold font):
    ...
    MySQL database to create [dbispconfig]:
    MySQL charset [utf8]:
    [INFO] service Postgrey not detected
    Configuring Postfix
    Can't load /home/ruut/.rnd into RNG
    140445839040960:error:2406F079:random number generator:RAND_load_file:Cannot open file:
    ../crypto/rand/randfile.c:88:Filename=/home/ruut/.rnd
    Generating a RSA private key
    .............................++++
    ..........................++++
    writing new private key to 'smtpd.key'
    ...

    I stopped here, but expect the same errors as I posted in my earlier post above in this thread.
    What do you suggest I do to diagnose or fix these issues?

    Again, thank you for your patience, expertise and guidance.
     
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Did you create a 'ruut' user with uid 0? Things generally head south fast without a 'root' user, but if another user with same uid (0) is in the passwd file first, that might be determined to be who you are. What all do you have for uid 0 accounts in /etc/passwd, as well as any 'root' or 'ruut' ?
     
  3. peterpetr

    peterpetr Member HowtoForge Supporter

    I created this Ubuntu 18.04 server from CD-ROM, same as I've always done, but this time I created the user called: 'ruut'. After logging in to my SSH terminal, I issue the "sudo -s" command to enable me to install/update/configure the system. So far, the only change from other systems where I've installed ISPconfig is the user name 'ruut'. I don't think that's a reserved word so I don't understand why my ISPconfig installation fails (as shown above).

    When I look at the file that opens when I do: "nano /etc/passwd"
    I have a 'root' and a 'ruut' user:
    root:x:0:0:root:/root:/bin/bash
    ...
    ruut:x:1000:1004:admin:/home/ruut:/bin/ba
    sh

    There are no other lines in the passwd file with 0
    I'm stuck at this time with resolving this and doing an install of ISPconfig.
    Do you have any other diagnostic or remedial things for me to attempt?
    Thank you.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The name ruut is not a reserved name. If you used sudo -s, the you should be the root user, and openssl should not look into the directory /home/ruut/ at all.

    The error that you got before:

    [INFO] service Postgrey not detected

    can be solved by running:

    apt-get install postgrey

    I though it gets installed by the guide, if it's missing, I'll add now. Besides that, openssl might work nonetheless with that error, so you should restart the installation after having installed postgrey.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    just checked the guide, postgrey is installed in the first command in chapter 7, so it should already be there. But if the script is run as 'ruut' instead of 'root' and postgrey is installed, then it's possible that the 'ruut' user is not able to see that application, which would be an indication that the ispconfig installer was not run as root.
     
  6. peterpetr

    peterpetr Member HowtoForge Supporter

    I tried to install postgrey per your instructions:
    apt-get install postgrey
    It looks like I missed that step, as postgrey did install now.

    I may have had too many late nights and missed that first command in Chapter 7. The installation of postgrey is embedded in a list of many other things to install. Now, I'm questioning if I missed anything else. I copied your Perfect Server tutorial into a Word document and documented my progress -- still, I did miss that first command in Chapter 7, and maybe more things were done incorrectly.

    Just to be certain, I'm going to restart the whole build of this new server from the beginning, the installation of Ubuntu from CD-ROM, then your tutorial... I'm feeling humbled and have learned from this -- not to continue with such long setup recipes when it's late and I'm tired. In any case, I'd like to thank you for your patience and help along the way.

    I hope that I can complete the Perfect Server setup using your tutorial, in daylight hours, without having to ask you any further questions.

    The only improvement to your tutorial that I can recommend is the quota step with:
    nano /etc/fstab
    as I did need your explicit help with that. I'm not familiar with such setup files. Providing an explanation or link to resources to help the user learn about how to complete this step would be helpful.

    I will verify here, my progress after I complete the setup of ISPconfig. Thanks again.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no need to rebuild the server, just copy/paste all commands and run them again. If the software is already installed, then apt will tell you that nothing gets installed, if you missed that command, then apt will install it. You probably missed the whole first command btw. as the other install attempt showed missing things like amavis, which are part of that command too.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The fstab file differs on each system, the one shown in the guide is the result of the default setup, but even minimal differences in your base setup or another hardware might result in a different file. That's why the guide highlights the relevant part that needs to be added.
     
  9. peterpetr

    peterpetr Member HowtoForge Supporter

    Re doing many of the commands in the tutorial (except for the commands with "echo", as I don't want to repeat those), has been proceeding well... Until I got to the first command in
    7. Install Amavisd-new, SpamAssassin, And ClamAV
    The following errors were displayed:

    Setting up amavisd-new (1:2.11.0-1ubuntu1.1) ...
    Creating/updating amavis user account...
    Job for amavis.service failed because the control process exited with error code.
    See "systemctl status amavis.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript amavis, action "start" failed.
    ● amavis.service - LSB: Starts amavisd-new mailfilter
    Loaded: loaded (/etc/init.d/amavis; generated)
    Active: failed (Result: exit-code) since Tue 2020-10-13 21:15:43 UTC; 11ms ago
    Docs: man:systemd-sysv-generator(8)
    Process: 10803 ExecStart=/etc/init.d/amavis start (code=exited, status=1/FAILURE)

    Oct 13 21:15:42 u18m-domain1-com systemd[1]: Starting LSB: Starts amavisd-new mailfilter...
    Oct 13 21:15:43 u18m-domain1-com amavis[10803]: Starting amavisd:
    The value of variable $myhostname is "u18m-domain1-com", but should have been a fully qualified domain name; perhaps uname(3) did not provide such.
    You must explicitly assign a FQDN of this host to variable $myhostname in /etc/amavis/conf.d/05-node_id, or fix what uname(3) provides as a host's network name!
    Oct 13 21:15:43 u18m-domain1-com amavis[10803]: (failed).
    Oct 13 21:15:43 u18m-domain1-com systemd[1]: amavis.service: Control process exited, code=exited status=1
    Oct 13 21:15:43 u18m-domain1-com systemd[1]: amavis.service: Failed with result 'exit-code'.
    Oct 13 21:15:43 u18m-domain1-com systemd[1]: Failed to start LSB: Starts amavisd-new mailfilter.
    dpkg: error processing package amavisd-new (--configure):
    installed amavisd-new package post-installation script subprocess returned error exit status 1
    Setting up liblwp-protocol-https-perl (6.07-2) ...

    Therefore, I edited: /etc/amavis/conf.d/05-node_id to uncomment the next line and put in my hostname:
    $myhostname = "u18m.domain1.com";
    Next I re-exectuted the first command in 7. Install Amavisd-new, SpamAssassin, And ClamAV
    which resulted in no errors!

    But I wonder if I used the correct value for $myhostname = "u18m.domain1.com";

    My Ubuntu server name is: u18m-domain1-com but the FQDN is: u18m.domain1.com
    AND, the mail server will be found via DNS with:

    The example domain: newdomain2.com.
    My DNS records are as follows:
    Type: A Host: mail Value: 152.11.11.11 TTL: 1 min.
    Type: A Host: @ Value: 152.11.11.11 TTL: 1 min.
    Type: A Host: www Value: 152.11.11.11 TTL: 1 min.
    Type: MX Host: newdomain2.com Value: mail.newdomain2.com Priority: 10 TTL: 1 min.

    In ISPconfig, I'll setup the MAIL services via newdomain2.com

    Question:
    Was my change to /etc/amavis/conf.d/05-node_id correct?
    to uncomment the next line and put in my hostname:
    $myhostname = "u18m.domain1.com";
    Or, should I have:
    $myhostname = "newdomain2.com";
    Or, should I have:
    $myhostname = "mail.newdomain2.com";

    *** UPDATE @ 05:29 pm (GMT -8) ***
    In addition to the above Question, after starting to install ISPconfig, I still get the earlier errors (in bold font below):

    MySQL database to create [dbispconfig]:
    MySQL charset [utf8]:
    Configuring Postgrey
    Configuring Postfix
    Can't load /home/ruut/.rnd into RNG
    139768800747968:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/home/ruut/.rnd
    Generating a RSA private key

    ISPConfig Port [8080]:
    Admin password [ada72779]: <myPassword>
    Re-enter admin password []: <myPassword>
    Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: y
    Generating RSA private key, 4096 bit long modulus (2 primes)
    ............................++++
    e is 65537 (0x010001)
    Can't load /home/ruut/.rnd into RNG
    140005400830400:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/home/ruut/.rnd
    You are about to be asked to enter information that will be incorporated
    into your certificate request.
    What you are about to enter is what is called a Distinguished Name or a DN.

    Please enter the following 'extra' attributes
    to be sent with your certificate request
    A challenge password []:
    An optional company name []:
    Can't load /home/ruut/.rnd into RNG
    140371414942144:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/home/ruut/.rnd
    writing RSA key
    Configuring DBServer
    Installing ISPConfig crontab

    *** UPDATE @ 05:45 pm (GMT -8) ***
    In addition to the 1st above Question,

    this 2nd issue (Can't load /home/ruut/.rnd into RNG)
    might have a solution. I'm checking the following two posts:

    https://github.com/wazuh/wazuh/issues/3395 and:
    https://stackoverflow.com/questions/63893662/cant-load-root-rnd-into-rng

    Please respond to the 1st issue above at your earliest convenience.
    Thank you.




     
    Last edited: Oct 14, 2020
  10. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Are you still running the commands as user ruut and not root?
    Did you somewhere in your post say what is the 1st issue?
    If it is
    that is the correct value, if indeed that is the FQDN your e-mail server uses. I do not know what it is and what you want to use as FQDN.
    Why do you set up such non-standard strange complicated monstrosity? If you would follow the Perfect Server quide, and maybe the tutorials linked to in my signature, things would work.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    I won't change /etc/amavis/conf.d/05-node_id file as the reason for the error is a faulty hostname in the base setup of your server. This affects other functions as well, you'll have to fix the wrong hostname and not edit the amavis file, which is just a symptom of the wrong hostname configuration.

    Correct configuration:

    The /etc/hostname contains:

    u18m

    The file /etc/postfix/main.cf contains in line '$myhostname':

    myhostname = u18m.domain1.com

    The file /etc/hosts contains the following line for the hostname:

    192.168.1.100 u18m.domain1.com u18m

    where 192.168.1.100 is the IP address of the server, not the localhost IP or 127.0.1.1. Here a complete example hosts file from my system:

    Code:
    127.0.0.1       localhost
    192.168.1.100   server1.example.com     server1
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    Then restart the server and test the hostname afterwards. The command:

    hostname

    will return 'u18m', the command:

    hostname -f

    will return the so called fully qualified domain name, which is 'u18m.domain1.com'.
     
  12. peterpetr

    peterpetr Member HowtoForge Supporter

    @till and @Taleman Thank you for your explicit guidance.
    It's after midnight here in Canada, so I'll continue with your instructions in the morning.

    The following four paragraphs are for clarification, with some corrections to the domain names, and I have a question at the end.

    The Ubuntu 18.04 server is: u18m-domain1-com
    as the Ubuntu 18.04 install from CD-ROM didn't allow a FQDN with periods.

    When I login to a SSH session into u18m.domain1.com the username is: ruut
    and the command line prompt is: [email protected]:~$
    Then I issue the "sudo -s" command and enter the password.
    The prompt at the command line then changes to: roo[email protected]:~#
    and I follow the instructions for the Perfect Server tutorial:
    https://www.howtoforge.com/tutorial/perfect-server-ubuntu-18-04-nginx-bind-dovecot-and-ispconfig-3/

    In the Perfect Server tutorial, at:
    6. Install Postfix, Dovecot, MariaDB, phpMyAdmin, rkhunter, Binutils
    I set the FQDN for the System mail name: domain1.com
    The ISPconfig login is: https://u18m.domain1.com:8080 and is now functioning.
    Next, with ISPconfig I'll install Clients, Sites, FTP, Mail and WebMail services.

    The ISPconfig system will manage multiple Clients and multiple Sites.
    One of the sites is: domain1.com
    and the MAIL server is: mail.domain1.com
    The DNS records are setup at the domain registrar for domain1.com
    Type: A Host: @ Value: 152.11.11.11 TTL: 1 min.
    Type: A Host: u18m Value: 152.11.11.11 TTL: 1 min.
    Type: A Host: mail Value: 152.11.11.11 TTL: 1 min.
    Type: MX Host: domain1.com Value: mail.domain1.com Priority: 10 TTL: 1 min.

    Question: Are that last three paragraphs above compatible with @till 's instructions just posted to this thread a few minutes ago?

    Many thanks for your ongoing patience and guidance.
     
    Last edited: Oct 14, 2020
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Why do you insist on not using the FQDN despite multiple times you have been told?
    Put mail.domain1.com as the FQDN. domain1.com is domain name, not FQDN which refers to the host, i.e. mail.domain1.com. If you intend to use this server as e-mail server, it is easier to setup if hostname -f is the name you intend to use as your e-mail server.
    I think I will after this no longer answer to this thread.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    See minimal server setup, which is done from the cd iso image, so same as using cdrom. Setting the hostname is no problem at all using that procedure from network setup chapter. Plus I explained it in post #31 what exactly needs to be done on your server to set the hostname correctly.

    https://www.howtoforge.com/tutorial/ubuntu-18.04-bionic-beaver-minimal-server/

    That's wrong, email will not work then for domain1.com at all then. The server hostname must be a subdomain! Please do exactly as @Taleman and I described it if you like to get a working email setup.
     
  15. peterpetr

    peterpetr Member HowtoForge Supporter

    @till and @Taleman My apologies for testing your patience. I was confused about the difference between FQDN, hostname and subdomain for ISPconfig setup.

    I will read your instructions carefully as i proceed.
     
  16. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Try `sudo -i`.

    [edit] nevermind, looks like you got past that issue.
     

Share This Page