500 Error after clean install on Ubuntu 14.04/Ispconfig3

Discussion in 'Installation/Configuration' started by schuettla, Sep 23, 2014.

  1. schuettla

    schuettla New Member

    Hi everyone,

    I just made a clean install following this tutorial step by step: http://www.howtoforge.com/perfect-s...2-php-mysql-pureftpd-bind-dovecot-ispconfig-3

    But my ispconfig is just giving me a HTTP 500. see here: https://92.51.132.136:8080/

    my apache error.log shows:
    Code:
    Tue Sep 23 12:21:18 2014 (30945): Fatal Error Unable to allocate shared memory segment of 67108864 bytes: mmap: Cannot allocate memory (12)
    [Tue Sep 23 12:21:18.424304 2014] [fcgid:warn] [pid 29892] (104)Connection reset by peer: [client 81.217.14.40:51471] mod_fcgid: error reading data from FastCGI server
    [Tue Sep 23 12:21:18.424344 2014] [core:error] [pid 29892] [client 81.217.14.40:51471] End of script output before headers: index.php
    
    If searched the forums here and it seems that also some other people run into that problem but weren't able to solve it as well. Any ideas?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Your server has not enough RAM.
     
  3. schuettla

    schuettla New Member

    Code:
    root@lvps92-51-132-136:/etc/php5/cgi# free
                 total       used       free     shared    buffers     cached
    Mem:       4194304    1563328    2630976     205144          0     949312
    -/+ buffers/cache:     614016    3580288
    Swap:      3145728          0    3145728
    
    Can't be. Is there any other setting to tune (eg in the mod_fcgid)? I also raised the memory_limit in the php.ini which showed no impact at all.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The error message is clear:

    and thats not a fcgi error.

    Is this a virtual server?
     
  5. schuettla

    schuettla New Member

    I solved this issue temporally with switching to mod_php instead of mod_fcgid. For anyone out there with the same problem, here is how to do that: Change in the /etc/apache2/sites-available/ispconfig.vhost

    Code:
    #  <IfModule mod_fcgid.c>
    #    DocumentRoot /var/www/ispconfig/
    #    SuexecUserGroup ispconfig ispconfig
    #    FcgidIOTimeout    700
    #    FcgidBusyTimeout 3600
    #    <Directory /var/www/ispconfig/>
    #      Options -Indexes +FollowSymLinks +MultiViews +ExecCGI
    #      AllowOverride AuthConfig Indexes Limit Options FileInfo
    #         <FilesMatch "\.php$">
    #                 SetHandler fcgid-script
    #         </FilesMatch>
    #      FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php
    #         Require all granted
    #             </Directory>
    #    IPCCommTimeout  7200
    #       MaxRequestLen 15728640
    #  </IfModule>
    
      <IfModule mod_php5.c>
        DocumentRoot /var/www/ispconfig/
        AddType application/x-httpd-php .php
        <Directory /var/www/ispconfig/>
          # php_admin_value open_basedir "/usr/local/ispconfig/interface:/usr/share$
          Options FollowSymLinks
          AllowOverride None
          Order allow,deny
          Allow from all
             php_value magic_quotes_gpc        0
        </Directory>
      </IfModule>
    
    
    Then there will be another issue that the config file which won't be found. You just need to set the permissions to
    Code:
    chmod 660 /usr/local/ispconfig/interface/lib/config.inc.php
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I hope your server is not connected to the internet and does not host any client sites ayou change allows everyone with access to a site to take over your whole server.
     
  7. schuettla

    schuettla New Member

    Yeah, i know it's an insecure solution. I will just do my configuration in the backend and immediately put it down again.
    And yes, it is a virtual server.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the output of:

    cat /proc/user_beancounters

    This wont help you. The problem is not in the ispconfig backend. The problem is that when the apache user can read the config.inc.php from ispconfig, then other websites on your server can read it as well and use the details to access the ispconfig mysql database.
     
    Last edited: Sep 23, 2014
  9. schuettla

    schuettla New Member

    here's the output:
    Code:
    root@lvps92-51-132-136:/usr/local/ispconfig/interface/lib# cat /proc/user_beancounters
    Version: 2.5
           uid  resource                     held              maxheld              barrier                limit              failcnt
       109003:  kmemsize                 26932600             28737536            134217728            144217728                    0
                lockedpages                     0                    0                 2059                 2059                    0
                privvmpages                391254               394235               943718              1048576                    0
                shmpages                    50265                50265                65536                65536                  229
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numproc                       106                  159                  500                  500                    0
                physpages                  291469               298542               943718              1048576                    0
                vmguarpages                     0                    0               524288  9223372036854775807                    0
                oomguarpages               126824               126824               524288  9223372036854775807                    0
                numtcpsock                     29                   29                  550                  550                    0
                numflock                        7                    8                 1000                 1100                    0
                numpty                          3                    3                  102                  102                    0
                numsiginfo                      0                   39                 1024                 1024                    0
                tcpsndbuf                  516792               516792              5280000              7392000                    0
                tcprcvbuf                  475136               475136              5280000              7392000                    0
                othersockbuf               136408               136408              3840000              5376000                    0
                dgramrcvbuf                     0                 2312              3584000              3584000                    0
                numothersock                   86                   86                  550                  550                    0
                dcachesize               12059763             12257915             14495514             16106127                    0
                numfile                      1397                 1500                17600                17600                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                dummy                           0                    0  9223372036854775807  9223372036854775807                    0
                numiptent                      40                   40  9223372036854775807  9223372036854775807                    0
    
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look at the last column: failcnt. This is the counter how often you reached a limit in your vm and shmpages is one of the RAM memory limits. So even if free shows you free memory, there is indeed not enough RAM and therefor php failed. you can tune the parameters of a vm s that commands like free show up a lot of memory but you use one of the other parameters to set a lower limit so you can put more virtual machines on the server.
     
  11. schuettla

    schuettla New Member

    thx till, will check on that.
     
  12. Neuton23

    Neuton23 New Member

    So i hope its not too late to ask in this thread. So i have the same issue and my server should have enough ram to do ispconfig 2048 MB. I tried out some values at /etc/php5/mods-available/opcache.ini. I have set the opcache.memory_consumption to 64 (basic) 32 and last 16, with 16 all is working but. i get now the errors
    Code:
    Mon Aug 10 21:01:38 2015 (7238): Fatal Error Unable to allocate shared memory segment of 16777216 bytes: mmap: Cannot allocate memory (12)
    [Mon Aug 10 xx:xx:xx.xxxxx 2015] [fcgid:warn] [pid 4246] (104)Connection reset by peer: [client xx.xxx.xx.xxx:xxxx] mod_fcgid: error reading data from FastCGI server, referer: https://xxxxxx.de:8080/index.php
    [Mon Aug 10 21:01:38.724213 2015] [core:error] [pid 4246] [client 62.134.43.70:48928] End of script output before headers: nav.php, referer: https://xxxxx.de:8080/index.php
    so what should i do to get rid of this error?
     
    Last edited: Aug 11, 2015
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    2048 MB "real" memory are enough, but you seem to be on a virtual server where shared memory is restricted and that causes this error. You can either disable opcache or you talk with your provider and ask them to increase the shared memory limit of your vm.
     
  14. Neuton23

    Neuton23 New Member

    Perfect! Thank you very much its solved the problem. Hmm maybe i should switch to a dedicated machine :)
    for all others they are have the same issue. I have disabled opcache in /etc/php5/mods-available/opcache.ini with the line
    opcache.enable=0
     
  15. Neuton23

    Neuton23 New Member

    so now i have ordered a new faster machine (virtual server) and the same issue is present. It seems to be that fast-cgi is the probleme on virtual hosts with shared memory. Is it possible to use only php-fpm in config or something?
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    When you have a virtual server where your ISP has disabled shared memory, then you cant use opcaches. It does not matter which php mode you are using. Either your ISP enables shared memory or don't install a php opcaching module.
     

Share This Page