debian 7+nginx+hhvm+mysql

平台debian 7 x86_64
1,安装mysql源
wget http://dev.mysql.com/get/mysql-apt-config_0.6.0-1_all.deb
dpkg -i mysql-apt-config_0.6.0-1_all.deb
按需求选mysql6或7,apply
2,添加nginx源
echo "deb http://nginx.org/packages/debian/ wheezy nginx
deb-src http://nginx.org/packages/debian/ wheezy nginx" >> /etc/apt/sources.list
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
rm nginx_signing.key
3,更新系统并安装基本库
apt-get update
apt-get upgrade -y
apt-get install -y vim vim-runtime build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev openssl libssl-dev
4,安装nginx
apt-get install -y nginx
5,安装mysql
apt-get install -y mysql-server (输入root密码)
授权root账号有远程访问权限
mysql -u root -p
grant all privileges on *.* to root@'%' identified by "hello";
flush privileges;
exit
6,安装HHVM
debian 8源
echo "deb http://dl.hhvm.com/debian jessie-lts-3.12 main" >> /etc/apt/sources.list
debian7源(数字lts-*可以是3.3/3.6/3.9,现在最新的3.12版本)
echo "deb http://dl.hhvm.com/debian wheezy-lts-3.12 main" >> /etc/apt/sources.list
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
apt-get update
apt-get install -y hhvm
hhvm默认是以9000端口tcp的方式提供fastcgi服务,当然你可以在/etc/hhvm/server.ini里
将hhvm.server.port =9000注释掉,然后添加 
hhvm.server.file_socket = /var/run/hhvm/hhvm.sock.
然后在/etc/nginx/conf.d/default.conf里将fastcgi_pass   127.0.0.1:9000;注释掉,
加一行fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
service hhvm restart
service nginx restart
7,建立网站目录并授权
mkdir -p /var/www/html
chown -R nginx:nginx /var/www/html
vi /etc/nginx/conf.d/default.conf
server {
    listen       80;
    server_name  localhost;
    root /var/www/html;
    location / {
        root /var/www/html;
        index  index.html index.php index.htm;
    }
    location ~ \.php$ {
    #    root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}
8,测试
echo "<?php phpinfo(); ?>" > /var/www/html/index.php
service nginx restart
http://yourserverip/可看到hhvm的信息页基本就行了
 

转载于:https://my.oschina.net/u/2404183/blog/740592

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值