frjo/ansible-roles

apache2 not installed

malutanpetronel opened this issue · 15 comments

At first I did added in mailserver/tasks/postfixadmin.yml at line 127:

  • name: ensure /etc/apache2/sites-available directory exists
    file:
    path: /etc/apache2/sites-available
    state: directory
    tags:
    • postfixadmin

and the playbook went fine to the end.

As a remark I did need to add in passwords.yml as described on your blog:
...
ansible_domain: <domain.com>
...

... but at the end I realised apache2 service is not installed at all:

root@mail:~# service apache2 restart
Failed to restart apache2.service: Unit apache2.service not found.

maybe something like

  • name: Install required binary packages
    apt: name={{item}} state=present
    with_items:
    • apache2
    • libapache2-mod-php5
      notify: restart apache ?

need it there ?

frjo commented

Yes, you need to fix the web server yourself since I have not added any public role for it.

I use Apache 2.4 with PHP-FPM 7 myself, highly recommend that combination.

Read more on my setup here : https://xdeb.org/post/2017/11/09/running-drupal-on-debian-9-with-apache-2-4-http2-event-mpm-and-php-fpm-via-socks-and-proxy/

I did installed

Server version: Apache/2.4.25 (Debian)
Server built: 2018-06-02T08:01:13

PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

I did enabled some modules you suggested and I assume I need to change the mail.conf too ?

frjo commented

If you want to install into other directories or do some other changes you can edit mail.conf.j2.

Sent with GitHawk

frjo commented

If you have not already you really should make use of the letsencrypt role as well.

Sent with GitHawk

Ok ;) So it looks some missing info in the blog here : https://xdeb.org/post/2018/02/07/run-your-own-mail-server-with-postfix-and-dovecot/

image

I did added letsencrypt at first, as common contains - include: misc.yml which verify the letsencrypt cert... but I fail with

...frjo/files/letsencrypt/account_aes256.key which is missing
I've thought letsencrypt should be used with certbot ? or should I generate the key locally ?

frjo commented

If you are unsure what the the letsencrypt role does after looking at it then I think the official certbot is an better option.

The "account_aes256.key” is a local file containing the encrypted account key for lets encrypt.

I use the letencrypt role since it avoids the need to do any manual setup on a server.

  1. so I should get somehow / somewhere a key for lets encrypt..
  2. and I should encrypt shomehow the account key for lets encrypt from point 1 :)
frjo commented

Just use certbot instead.

it still looks that the server load until it output timeout ! Any hints please ?

frjo commented

Need the log output to see what the issues are.

Sent with GitHawk

Do you have an email?

frjo commented

There is a contact form on my blog.

I noticed you did not shared the content of etc/postfixadmin/config.local.php.j2
Did you forgot ot push it content? or I am supposed to copy the default file to local, customise it iwth vars and reuse it later ?

I wrongly look in another folder