Debian 8 Ispconfig 3.1 Apache 2.4

Discussion in 'Installation/Configuration' started by Serum, Jan 23, 2017.

  1. Serum

    Serum New Member

    Hello,

    I did a distribution upgrade from Debian 7 to Debian 8 with Ispconfig 3.1.
    Everything works fine, except Vhost of apache 2.4. What I did :

    Code:
    apt-get update
    apt-get upgrade
    So I have my Debian 7 up to date.

    Code:
    apt-get dist-upgrade
    apt-get update
    apt-get upgrade
    And after this I have my Debian 8 : no errors during this process.
    To avoid some errors inside logs, I update certbot (letsencrypt), add a new certificate to pure-ftpd and update ispconfig manually :

    Code:
    cd /opt
    ./certbot
    Code:
    echo 1 > /etc/pure-ftpd/conf/TLS
    openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
    chmod 600 /etc/ssl/private/pure-ftpd.pem
    service pure-ftpd-mysql restart
    Code:
    cd /tmp
    wget http://www.ispconfig…3-stable.tar.gz
    tar xvfz ISPConfig-3-stable.tar.gz
    cd ispconfig3_install/install
    php -q update.php
    But I get an error from Apache2 Vhost here :

    Code:
    Reconfigure Services? (yes,no,selected) [yes]:
    
    Configuring Pureftpd
    Configuring Apache
    Configuring vlogger
    Configuring Apps vhost
    Configuring Jailkit
    Configuring Database
    Updating ISPConfig
    ISPConfig Port [8080]:
    
    Create new ISPConfig SSL certificate (yes,no) [no]:
    Reconfigure Crontab? (yes,no) [yes]:
    
    Updating Crontab
    Restarting services ...
    
    Restarting Apache httpd web server: apache2 failed!
    The apache2 configtest failed. ... (warning).
    Output of config test was:
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:69
    AH00526: Syntax error on line 63 of /etc/apache2/sites-enabled/100-website.com.vhost:
    FastCgiExternalServer: redefinition of previously defined class "/var/www/clients/client2/web45/cgi-bin/php5-fcgi-*-80-website.com"
    Action 'configtest' failed.
    The Apache error log may have more information.
    
    Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -8 UTF-8 -H -D -J ALL:!aNULL:!SSLv3 -u 1000 -Y 1 -b -S *,2121 -O clf:/var/log/pure-ftpd/transfer.log -E -A -B
    Update finished.
    As you can see, Apache2 tells me to check log (Nothing is writted in logs) and the line talks about a duplicate value 'FastCgiExternalServer'.
    So I try this command line to find where is this value inside /etc/apache2 :

    Code:
    grep -RIs "FastCgiExternalServer" /etc/apache2
    And the return :

    Code:
    /etc/apache2/sites-available/website.com.vhost:  FastCgiExternalServer /var/www/clients/client2/web45/cgi-bin/php5-fcgi-*-80-website.com -idle-timeout 300 -socket /var/lib/php5-fpm/web45.sock -pass-header Authorization
    /etc/apache2/sites-available/website.com.vhost:  FastCgiExternalServer /var/www/clients/client2/web45/cgi-bin/php5-fcgi-*-443-website.com -idle-timeout 300 -socket /var/lib/php5-fpm/web45.sock -pass-header Authorization
    
    /etc/apache2/sites-enabled/100-website.com.vhost:  FastCgiExternalServer /var/www/clients/client2/web45/cgi-bin/php5-fcgi-*-80-website.com -idle-timeout 300 -socket /var/lib/php5-fpm/web45.sock -pass-header Authorization
    /etc/apache2/sites-enabled/100-website.com.vhost:  FastCgiExternalServer /var/www/clients/client2/web45/cgi-bin/php5-fcgi-*-443-website.com -idle-timeout 300 -socket /var/lib/php5-fpm/web45.sock -pass-header Authorization
    As you can see, I find only this occurence inside my vhosts files.
    And If I check, I have 2 FastCgiExternalServer used for this vhost (I think Ispconfig automatically add this in debian 7, one for the 80 port and another one for the 443 port). Do you know how to fix this issue ? Should I remove one ? Or keep both ?

    Thank you ;)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Disable the website by removing its symlink in the sites-enabled folder, then start apache, login to ispconfig, chose tools > resync and let ispconfig rewrite the vhost files in apache 2.4 syntax.
     
  3. Serum

    Serum New Member

    Hello Till,

    Thank you for your help, so here is my command lines :

    Code:
    rm /etc/apache2/site-enabled/100-website.com.vhost
    service apache2 restart
    But I have an another error from the Apps.vhost :

    Code:
    [....] Restarting Apache httpd web server: apache2AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:69
    (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8081
    no listening sockets available, shutting down
    AH00015: Unable to open logs
    Action 'start' failed.
    The Apache error log may have more information.
    failed!
    Apache2 doesn't want to start, the 8181 is used by apps.vhost. Here is the code of this vhost generated by the ispconfig installation :

    Code:
     Listen 8081
    # NameVirtualHost *:8081
    
    <VirtualHost _default_:8081>
      ServerAdmin webmaster@localhost
    
      <FilesMatch "\.ph(p3?|tml)$">
        SetHandler None
      </FilesMatch>
    
      <IfModule mod_headers.c>
            RequestHeader unset Proxy early
      </IfModule>
    
      <IfModule mod_php5.c>
        DocumentRoot /var/www/apps
        AddType application/x-httpd-php .php
        <Directory /var/www/apps>
                    Options FollowSymLinks
                    AllowOverride None
                                    Require all granted
                        </Directory>
      </IfModule>
    
      <IfModule mod_fcgid.c>
        DocumentRoot /var/www/apps
        SuexecUserGroup ispapps ispapps
        <Directory /var/www/apps>
                    Options +Indexes +FollowSymLinks +MultiViews +ExecCGI
                    AllowOverride AuthConfig Indexes Limit Options FileInfo
                <FilesMatch "\.php$">
                      SetHandler fcgid-script
                </FilesMatch>
                    FCGIWrapper /var/www/php-fcgi-scripts/apps/.php-fcgi-starter .php
                                    Require all granted
                        </Directory>
      </IfModule>
    
    </VirtualHost>
    So I search and I write this command line :

    Code:
     netstat -tap
    And this is the return :

    Code:
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 Server:urd                *:*                     LISTEN      2776/master    
    tcp        0      0 Server:smtp               *:*                     LISTEN      2776/master    
    tcp        0      0 Server:10024              *:*                     LISTEN      1068/amavisd-new (m
    tcp        0      0 Server:10025              *:*                     LISTEN      2776/master    
    tcp        0      0 *:frox                  *:*                     LISTEN      2232/pure-ftpd (SER
    tcp        0      0 *:mysql                 *:*                     LISTEN      1818/mysqld    
    tcp        0      0 Server:10026              *:*                     LISTEN      1068/amavisd-new (m
    tcp        0      0 Server:10027              *:*                     LISTEN      2776/master    
    tcp        0      0 *:555                   *:*                     LISTEN      1381/sshd      
    tcp        0      0 Server:11211              *:*                     LISTEN      1223/memcached 
    tcp        0      0 *:sunrpc                *:*                     LISTEN      811/rpcbind    
    tcp        0     36 Server.fr:555    23-94-218-6-host.:27101 ESTABLISHED 951/sshd: user
    tcp        0      0 Server:50282              Server:mysql              ESTABLISHED 29052/amavisd-new (
    tcp        0      0 Server:mysql              Server:50282              ESTABLISHED 1818/mysqld    
    tcp        0      0 Server:50284              Server:mysql              ESTABLISHED 29053/amavisd-new (
    tcp        0      0 Server:mysql              Server:50284              ESTABLISHED 1818/mysqld  
    Apparently, the 8181 port is not used. The port used by ispconfig.conf is 8080, it's by default during the installation of ispconfig. So I don't know what is apps.vhost. So I search more on this forum and they ask to disable and remove selinux on debian 8 Jessie :

    Code:
    sudo apt-get remove --auto-remove selinux-utils
    sudo apt-get purge --auto-remove selinux-utils
    But it was not installed. If I change the port 8181 to 4545, this is the same error.
    If I remove the apps.vhost from the site-enabled folder, apache2 start with the ispconfig.conf file who use 8080 port.
    But I can't access to the panel with my browser, I think apps.vhost is need by ispconfig.conf file.

    Do you have an idea ?

    Thank you ;)
     
  4. Serum

    Serum New Member

    Hello,

    I'm still looking for a solution. Have some of you encountered this problem?

    Thank you.
     
  5. Serum

    Serum New Member

    Hello,

    I just want to let you know that my solution was to use nginx instead Apache 2.4.

    See you ;)
     

Share This Page