標籤:blog http io ar os sp div on 2014
HHVM(HipHop Virtual Machine),Facebook的開源項目之一,用於代替php環境,這裡不多做介紹,本文介紹配置教程.
安裝所需的epel和hhvm yum源
rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
安裝hhvm所需依賴包
sudo yum install libmcrypt-devel glog-devel jemalloc-devel tbb-devel libdwarf-devel mysql-devel libxml2-devel libicu-devel pcre-devel gd-devel boost-devel sqlite-devel pam-devel bzip2-devel oniguruma-devel openldap-devel readline-devel libc-client-devel libcap-devel libevent-devel libcurl-devel libmemcached-devel
添加gleez yum源
sudo rpm -Uvh http://yum.gleez.com/6/x86_64/gleez-repo-6-0.el6.noarch.rpm
如果是國內主機,由於gleez.com被牆,這裡提供另外一個
sudo rpm -Uvh http://blog.linuxeye.com/wp-content/uploads/2014/05/gleez-repo-6-0.el6.noarch.rpm
安裝remi yum源
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/6/remi/x86_64/remi-release-6.5-1.el6.remi.noarch.rpm
從remi安裝hhvm依賴包 , mysql
yum --enablerepo=remi install libwebp mysql mysql-devel mysql-lib
安裝hhvm
yum --nogpgcheck install hhvm
將hhvm加入開機啟動
chkconfig hhvm on
配置hhvm
# vi /etc/hhvm/server.ini
;hhvm.server.port = 9001 (注釋或者刪除此行)hhvm.server.file_socket = /var/run/hhvm/sock (添加此行,hhvm運行模式由連接埠改為socket方式)
# vi /etc/hhvm/php.ini在php options下面追加為以下內容,以添加記憶體限制,關閉expose.
hhvm.mysql.socket =/tmp/mysql.sockmemory_limit = 512Mexpose_php = 0
配置nginx:
找到service欄位內的php部份,此處在每次添加完虛擬機器主機以後都要修改.
fastcgi_pass unix:/tmp/php-cgi.sock; (注釋此行)fastcgi_pass unix:/var/run/hhvm/sock; (添加此行)
如:
location ~ \.php{ root /usr/share/nginx/html; fastcgi_pass unix:/var/run/hhvm/sock; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; includefastcgi_params; }
重啟nginx,啟動hhvm.大功告成.
service nginx restartservice hhvm startservice mysqld start
- 相關文章推薦:
- 在centos6.5上安裝redmine 2.53
- CentOS6安裝tomcat6
- 在Centos6.3安裝Python Fabric運行環境
- 本文來自:愛好Linux技術網
- 本文連結:http://www.ahlinux.com/centos/9090.html
centos6 配置hhvm+php+Nginx+mysql