Lets Encrypt - PHP-FPM - "FastCgiExternalServer: redefinition" Error

Discussion in 'Server Operation' started by tadeus, Jul 17, 2017.

  1. tadeus

    tadeus New Member

    I work with 2 domains on my server and want to enable certbot for 1 domain.

    I got this error from certbot:
    Error while running apache2ctl configtest.
    Action 'configtest' failed.
    The Apache error log may have more information.
    AH00526: Syntax error on line 44 of /etc/apache2/sites-enabled/2domain.conf:
    FastCgiExternalServer: redefinition of previously defined class "/usr/lib/cgi-bin/php7-ssl-fcgi"
    Rolling back to previous server configuration...
    I have 2 domains running on my machine.

    config 1.domain
    <VirtualHost *:80>



    DocumentRoot /var/www/html/magento-ds

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /usr/lib/cgi-bin>
    Require all granted
    </Directory>
    <IfModule mod_fastcgi.c>
    AddHandler php7-fcgi .php
    Action php7-fcgi /php7-fcgi virtual
    Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgii -socket /var/run/php/php7.0-fpm.sock -idle-timeout 1800 -pass-header Authorization
    </IfModule>
    </VirtualHost>​


    config 2.domain (for letsencrypt)
    <VirtualHost *:80>


    DocumentRoot /var/www/html/magento-spielzeug

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /usr/lib/cgi-bin>
    Require all granted
    </Directory>

    <IfModule mod_fastcgi.c>
    AddHandler php7-ssl-fcgi .php
    Action php7-ssl-fcgi /php7-fcgi virtual
    Alias /php7-ssl-fcgi /usr/lib/cgi-bin/php7-ssl-fcgi
    FastCgiExternalServer /usr/lib/cgi-bin/php7-ssl-fcgi -socket /var/run/php/php7.0o-fpm.sock -pass-header Authorization
    </IfModule>
    </VirtualHost>​

    With google I found a solution which says i have to rename my variables in my second config, but this is already done. On a other site I found the solution I have to tell letsencrypt not to redefine, but I dont know how to to this

    What is the problem in my config? How to solve it?

    Thank you in advance
     

Share This Page