Configure hhvm and apache for archlinux

First I installed apache24 from AUR and hhvm from AUR (HipHop VM 2.4.0 (rel)). Apache24 includes mod_proxy_fcgi . Running a php file from a terminal using hhvm seems to work fine, but I can't configure it to work with apache.
in httpd.conf I have:

ProxyPass / fcgi://127.0.0.1:9000/srv/http/

then I started the hhvm server from doc_root with:

sudo hhvm --mode server -vServer.Type=fastcgi -vServer.Port=9000

but when accessing the http link from the browser, I get:

"HipHop Notice: File could not be loaded: proxy:fcgi://127.0.0.1:9000/srv/http/index.php"

any suggestions?

+4
source share
1 answer

It can be done. Here is my example Ubuntu web server:

HHVM - Apache. FastCGI, . , HHVM script, . ...

sudo /usr/share/hhvm/install_fastcgi.sh 

, HHVM , ... ()

sudo update-rc.d hhvm defaults 

HHVM Apache

script HHVM, Apache. , 404 . hhvmproxyfcgi.conf ProxyPassMatch, .

sudo emacs /etc/apache2/mods-available/hhvm_proxy_fcgi.conf  

# ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/v

PHP/Hack FastCGI, , - HHVM. - -, , , .

HHVM , . ProxyPassMatch -, HHVM. ( , , ).

sudo nano /etc/apache2/sites-available/hhvm.example.com.conf 

# HHVM - hhvm.example.com

<VirtualHost *:80>
    ServerName hhvm.example.com
    DirectoryIndex index.php
    DocumentRoot /var/www/sites/hhvm.example
    ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/sites/hhvm.example/$1
</VirtualHost>  
<VirtualHost *:443>
    ServerName hhvm.example.com
    DirectoryIndex index.php
    DocumentRoot /var/www/sites/hhvm.example
    SSLEngine On
    SSLCertificateFile   /etc/ssl/certs/hhvm.crt
    SSLCertificateKeyFile    /etc/ssl/private/hhvm.key
    SSLCACertificateFile  /etc/ssl/certs/hhvm.ca.crt
    ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/sites/hhvm.example/$1
</VirtualHost>

, HHVM, A/B . /etc/apache2/ports.conf

Listen 8080 

ProxyPassMatch , HHVM.

<VirtualHost *:80>

    ... 

</VirtualHost>  
<VirtualHost *:8080>

    ... 

    ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/$1

</VirtualHost> 

Apache HHVM

Apache HHVM . ...

sudo service apache2 restart  
sudo service hhvm restart 
+1

Source: https://habr.com/ru/post/1526627/


All Articles