HHVM (HipHop) with ISPConfig Problem

Discussion in 'Installation/Configuration' started by tokar86a, Feb 2, 2015.

  1. tokar86a

    tokar86a Member

    Hi

    I have install HHVM whit help off the guide from this topic https://www.howtoforge.com/community/threads/hhvm-hiphop-with-ispconfig.65273/ that croydon have posted but when i switch to HHVM in the control panel and add this cod in a php file: echo defined('HHVM_VERSION')?'Using HHVM':'Not using HHVM'; then it give me the information that i am not using HHVM.

    Have anyone else get it to work?
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Hi tokar,
    could you please post the (anonymized) vhost config of the website you enabled hhvm for?
     
  3. tokar86a

    tokar86a Member

    Here you have the code. What is wrong?

    PHP:
    <Directory /var/www/klotrullarna.se>
            
    AllowOverride None
                    
    Require all denied
            
    </Directory>

    <
    VirtualHost *:80>
                                        
    DocumentRoot /var/www/clients/client0/web2/web
                           
            ServerName klotrullarna
    .se
            ServerAlias 
    *.klotrullarna.se
            ServerAdmin webmaster
    @klotrullarna.se

            ErrorLog 
    /var/log/ispconfig/httpd/klotrullarna.se/error.log

            Alias 
    /error"/var/www/klotrullarna.se/web/error/"
            
    ErrorDocument 400 /error/400.html
            ErrorDocument 401 
    /error/401.html
            ErrorDocument 403 
    /error/403.html
            ErrorDocument 404 
    /error/404.html
            ErrorDocument 405 
    /error/405.html
            ErrorDocument 500 
    /error/500.html
            ErrorDocument 502 
    /error/502.html
            ErrorDocument 503 
    /error/503.html

            
    <IfModule mod_ssl.c>
            </
    IfModule>

            <
    Directory /var/www/klotrullarna.se/web>
                    
    # Clear PHP settings of this website
                    
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            
    SetHandler None
                    
    </FilesMatch>
                    
    Options +FollowSymLinks
                    AllowOverride All
                                    
    Require all granted
                            
    </Directory>
            <
    Directory /var/www/clients/client0/web2/web>
                    
    # Clear PHP settings of this website
                    
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            
    SetHandler None
                    
    </FilesMatch>
                    
    Options +FollowSymLinks
                    AllowOverride All
                                    
    Require all granted
                            
    </Directory>





            <
    IfModule mod_fastcgi.c>
                    <
    Directory /var/www/clients/client0/web2/cgi-bin>
                                            Require 
    all granted
                                        
    </Directory>
                    <
    FilesMatch "\.php[345]?$">
                        
    SetHandler php5-fcgi
                    
    </FilesMatch>
                    
    Action php5-fcgi /php5-fcgi
                    Alias 
    /php5-fcgi /var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-klotrullarna.se
                    FastCgiExternalServer 
    /var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-klotrullarna.se -idle-timeout 300 -socket /var/run/hhvm/hhvm.web2.sock -pass-header Authorization
            
    </IfModule>


            
    # add support for apache mpm_itk
            
    <IfModule mpm_itk_module>
                
    AssignUserId web2 client0
            
    </IfModule>

            <
    IfModule mod_dav_fs.c>
            
    # Do not execute PHP files in webdav directory
                
    <Directory /var/www/clients/client0/web2/webdav>
                    <
    ifModule mod_security2.c>
                        
    SecRuleRemoveById 960015
                        SecRuleRemoveById 960032
                    
    </ifModule>
                    <
    FilesMatch "\.ph(p3?|tml)$">
                        
    SetHandler None
                    
    </FilesMatch>
                </
    Directory>
                
    DavLockDB /var/www/clients/client0/web2/tmp/DavLock
                
    # DO NOT REMOVE THE COMMENTS!
                # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                # WEBDAV END
            
    </IfModule>

    Alias /awstatsclasses "/usr/share/awstats/lib/"
    Alias /awstats-icon "/usr/share/awstats/icon/"
    Alias /awstatscss "/usr/share/doc/awstats/examples/css"

    php_flag xcache.cacher Off
    php_flag xcache
    .cacher 0
    php_flag xcache
    .stat Off
    php_flag xcache
    .optimizer Off
    </VirtualHost>
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Are you using debian?
    If yes, is libapache2-mod-fastcgi installed and enabled with a2enmod fastcgi?
     
  5. tokar86a

    tokar86a Member

    No i use ubuntu 14.04 LTS. so what should i do then?
     
  6. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Should be the same. Check if the module package is installed and enabled.
     
  7. tokar86a

    tokar86a Member

    yes it is installed:

    root@server:/home/tokar86a# apt-get install libapache2-mod-fastcgi
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libapache2-mod-fastcgi is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    root@server:/home/tokar86a# a2enmod fastcgi
    Module fastcgi already enabled

    Whats next?

    Its look like the process for hhvm is running: /usr/bin/hhvm --mode daemon -vServer.Type=fastcgi --user web2 -vServer.FileSocket=/var/run/hhvm/hhvm.web2.sock -vLog.Level=Warning -vLog.UseLogFile=false -vRepo.Central.Path=/var/run/hhvm/hhvm.web2.hhbc -vPidFile=/var/run/hhvm/hhvm_web2.pid
     
    Last edited: Feb 3, 2015
  8. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Okay, after a second look at the vhost I think that the hhvm patch is not compatible with the latest ISPConfig 3.0.5 patch version.
    You would have to change something in the vhost file (or the vhost master template) to make it work again.
    Code:
    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
    </FilesMatch>
    this must be changed to
    Code:
    <Directory /var/www/klotrullarna.se/web>
    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
    </FilesMatch>
    </Directory>
     <Directory /var/www/clients/client0/web2/web>
    <FilesMatch "\.php[345]?$">
                        SetHandler php5-fcgi
    </FilesMatch>
    </Directory>
    Why that? In one of the latest patch releases of ISPConfig a fix was implemented that prevented some misbehaviour in apache/php. The SetHandle none some lines above is more specific (inside a directory tag) so it overrides the less specific SetHandler for hhvm that is not inside a directory tag.
     
  9. tokar86a

    tokar86a Member

    I dont think i understand to 100% what you wont me to change?
    Is this right?
    PHP:
    <Directory /var/www/klotrullarna.se>
            
    AllowOverride None
                    
    Require all denied
            
    </Directory>

    <
    VirtualHost *:80>
                                        
    DocumentRoot /var/www/clients/client0/web2/web
                           
            ServerName klotrullarna
    .se
            ServerAlias 
    *.klotrullarna.se
            ServerAdmin webmaster
    @klotrullarna.se

            ErrorLog 
    /var/log/ispconfig/httpd/klotrullarna.se/error.log

            Alias 
    /error"/var/www/klotrullarna.se/web/error/"
            
    ErrorDocument 400 /error/400.html
            ErrorDocument 401 
    /error/401.html
            ErrorDocument 403 
    /error/403.html
            ErrorDocument 404 
    /error/404.html
            ErrorDocument 405 
    /error/405.html
            ErrorDocument 500 
    /error/500.html
            ErrorDocument 502 
    /error/502.html
            ErrorDocument 503 
    /error/503.html

            
    <IfModule mod_ssl.c>
            </
    IfModule>

            <
    Directory /var/www/klotrullarna.se/web>
                    
    # Clear PHP settings of this website
                    
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            
    SetHandler None
                    
    </FilesMatch>
                    
    Options +FollowSymLinks
                    AllowOverride All
                                    
    Require all granted
                            
    </Directory>
            <
    Directory /var/www/clients/client0/web2/web>
                    
    # Clear PHP settings of this website
                    
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            
    SetHandler None
                    
    </FilesMatch>
                    
    Options +FollowSymLinks
                    AllowOverride All
                                    
    Require all granted
                            
    </Directory>





            <
    IfModule mod_fastcgi.c>
                    <
    Directory /var/www/clients/client0/web2/cgi-bin>
                                            Require 
    all granted
                                        
    </Directory>
                   

    <
    Directory /var/www/klotrullarna.se/web>
    <
    FilesMatch "\.php[345]?$">
                        
    SetHandler php5-fcgi
    </FilesMatch>
    </
    Directory>
    <
    Directory /var/www/clients/client0/web2/web>
    <
    FilesMatch "\.php[345]?$">
                        
    SetHandler php5-fcgi
    </FilesMatch>
    </
    Directory>                Action php5-fcgi /php5-fcgi
                    Alias 
    /php5-fcgi /var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-klotrullarna.se
                    FastCgiExternalServer 
    /var/www/clients/client0/web2/cgi-bin/php5-fcgi-*-80-klotrullarna.se -idle-timeout 300 -socket /var/run/hhvm/hhvm.web2.sock -pass-header Authorization
            
    </IfModule>


            
    # add support for apache mpm_itk
            
    <IfModule mpm_itk_module>
                
    AssignUserId web2 client0
            
    </IfModule>

            <
    IfModule mod_dav_fs.c>
            
    # Do not execute PHP files in webdav directory
                
    <Directory /var/www/clients/client0/web2/webdav>
                    <
    ifModule mod_security2.c>
                        
    SecRuleRemoveById 960015
                        SecRuleRemoveById 960032
                    
    </ifModule>
                    <
    FilesMatch "\.ph(p3?|tml)$">
                        
    SetHandler None
                    
    </FilesMatch>
                </
    Directory>
                
    DavLockDB /var/www/clients/client0/web2/tmp/DavLock
                
    # DO NOT REMOVE THE COMMENTS!
                # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                # WEBDAV END
            
    </IfModule>

    Alias /awstatsclasses "/usr/share/awstats/lib/"
    Alias /awstats-icon "/usr/share/awstats/icon/"
    Alias /awstatscss "/usr/share/doc/awstats/examples/css"

    php_flag xcache.cacher Off
    php_flag xcache
    .cacher 0
    php_flag xcache
    .stat Off
    php_flag xcache
    .optimizer Off
    </VirtualHost>
    Is this something that you are going to fix so it working in the main release 3.1?
     
  10. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Yes, the changed vhost file should be okay, I think.
    In master branch the hhvm support is working (at least for me), but I cannot tell you if it makes it into 3.1 stable because of some problems that hhvm itself has in fastcgi mode (e. g. https://github.com/facebook/hhvm/issues/2570).
     
  11. tokar86a

    tokar86a Member

    But when i check the phpinfo file it dont seems like it is using hhvm.
     
  12. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Vhost file looks okay for me. Have you restarted the hhvm service and apache?
     
  13. tokar86a

    tokar86a Member

    Now its wont me to download the phpfile i end up whit a download box when i visit that pages now.
     
  14. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Check the error logs.
     
  15. tokar86a

    tokar86a Member

    It dont give me any information.
     
  16. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    Is the hhvm process even running?
     
  17. tokar86a

    tokar86a Member

    You mean this one?

    /usr/bin/hhvm --mode daemon -vServer.Type=fastcgi --user web2 -vServer.FileSocket=/var/run/hhvm/hhvm.web2.sock -vLog.Level=Warning -vLog.UseLogFile=false -vRepo.Central.Path=/var/run/hhvm/hhvm.web2.hhbc -vPidFile=/var/run/hhvm/hhvm_web2.pid

    Yes that one is running.
     
  18. tokar86a

    tokar86a Member

    Still waiting for a responds here.
     
  19. Stefan Warnat

    Stefan Warnat New Member

    Hy,
    In my case the problem with the file, which will be downloaded was happen, because the orginal hhvm process was running too.
    After I stop this process and restart hhvm_web* the page was shown.

    But: You also need to apply this, to get hhvm running perfectly:
    http://git.ispconfig.org/ispconfig/ispconfig3/commit/92bc7d781d2941027ec2cdfc4942a8265f4aa910
    (After this you should recreate the vhost template by set the php mode to Mod-PHP and back to HHVM)

    @marius: Thanks for the tip to add the <directory Tags to the vhost.master. I didn't recognize the inherit effect.

    Stefan
     

Share This Page