HHVM + Apache2 for VestaCP
Posted: Thu Jul 27, 2017 10:58 am
I have Debian 8.8, fresh install. VestaCP 0.9.8-17. I managed to install HHVM. I also have a template that works. However I have problems with user permissions. It is the same problem as I have with php-fpm (next topic).
So HHVM works well when it comes to read files operations. The problem is that HHVM is run by www-data user and my default user of VestaCP is admin. So when I upload files via FTP they belong to admin. I upload WordPress. During install process wp-config.php file cant be created. When I create it myself it works fine but I can't upload any files in media library.
If I start HHVM process as user admin manually executing the command below it works fine. I can upload files.
So I wrote simple script hhvm.sh that runs when I enable HHVM template in apache2 configuration. It contains the command above. But there are 2 problems:
1. How to execute this command after system reboot?
2. When I execute this command from SSH as root the service starts as admin user and everything works well. When I change template into HHVM and hhvm.sh executes then the service starts as admin user but HHVM doesn't work fine. For example phpinfo.php (phpinfo();) file works well, but WordPress doesn't. Home page is empty (whole white). Admin doesn't work as well.
How to make it work? How to make HHVM run only as a user after reboot and not run as www-data?
PS. If anyone needs tutorial how to install HHVM or how to create HHVM templates - let me know. I will provide everything (how to and files).
So HHVM works well when it comes to read files operations. The problem is that HHVM is run by www-data user and my default user of VestaCP is admin. So when I upload files via FTP they belong to admin. I upload WordPress. During install process wp-config.php file cant be created. When I create it myself it works fine but I can't upload any files in media library.
Code: Select all
# ps aux | grep hhvm
www-data 935 0.0 1.0 751324 43700 ? Ssl 09:45 0:00 /usr/bin/hhvm --config /etc/hhvm/php.ini --config /etc/hhvm/server.ini --user www-data --mode daemon -vPidFile=/var/run/hhvm/pid
root 12336 0.0 0.0 12940 1052 pts/0 S+ 12:35 0:00 grep hhvm
Code: Select all
/usr/bin/hhvm --mode daemon --user admin --config /etc/hhvm/php.ini --config /etc/hhvm/server.ini -vServer.Type=fastcgi -vPidFile=/var/run/hhvm/pid -vLog.UseLogFile=false -vEval.PerfPidMap=false -vLog.Level=Warning -vServer.FixPathInfo=true
1. How to execute this command after system reboot?
2. When I execute this command from SSH as root the service starts as admin user and everything works well. When I change template into HHVM and hhvm.sh executes then the service starts as admin user but HHVM doesn't work fine. For example phpinfo.php (phpinfo();) file works well, but WordPress doesn't. Home page is empty (whole white). Admin doesn't work as well.
Code: Select all
# ps aux | grep hhvm
admin 14417 0.0 1.1 764652 47044 ? Ssl 12:50 0:00 /usr/bin/hhvm --mode daemon --user admin --config /etc/hhvm/php.ini --config /etc/hhvm/server.ini -vServer.Type=fastcgi -vPidFile=/var/run/hhvm/pid -vLog.UseLogFile=false -vEval.PerfPidMap=false -vLog.Level=Warning -vServer.FixPathInfo=true
root 14708 0.0 0.0 12936 1040 pts/0 S+ 12:57 0:00 grep hhvm
PS. If anyone needs tutorial how to install HHVM or how to create HHVM templates - let me know. I will provide everything (how to and files).