全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 6511|回复: 15

HHVM nginx mysql 环境安装教程

[复制链接]
发表于 2014-7-4 09:18:50 | 显示全部楼层 |阅读模式
睡不着,撸了一发教程。。。
懒得做一键包了,凑合看吧。。。



适用于debian7

在kvmla.com上测试通过

1.添加源
  1. nano /etc/apt/sources.list
复制代码

最后两行添加
  1. deb http://nginx.org/packages/debian/ wheezy nginx
  2. deb-src http://nginx.org/packages/debian/ wheezy nginx
复制代码


我用的linode的源,所以添加好后是这样
  1. deb http://mirrors.linode.com/debian/ wheezy main
  2. deb-src http://mirrors.linode.com/debian/ wheezy main

  3. deb http://mirrors.linode.com/debian-security/ wheezy/updates main
  4. deb-src http://mirrors.linode.com/debian-security/ wheezy/updates main

  5. deb http://mirrors.linode.com/debian/ wheezy-updates main
  6. deb-src http://mirrors.linode.com/debian/ wheezy-updates main

  7. deb http://nginx.org/packages/debian/ wheezy nginx
  8. deb-src http://nginx.org/packages/debian/ wheezy nginx
复制代码



然后Ctrl+X,按y,再回车

2.添加证书
  1. wget http://nginx.org/keys/nginx_signing.key
  2. apt-key add nginx_signing.key
复制代码


3. 更新
  1. apt-get update
复制代码


4. 安装nginx (1.6.0)和mysql (5.5)
  1. apt-get install -y nginx mysql-server mysql-client
复制代码


5. 安全优化mysql
  1. mysql_secure_installation
复制代码


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] <– 是否删除匿名用户,生产环境建议删除,所以直接回车
… Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止
… Success!
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] <– 是否删除test数据库,直接回车
- Dropping test database…
… Success!
- Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,直接回车
… Success!
Cleaning up…
All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!


6. 安装hhvm并加入开机启动
  1. wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
  2. echo deb http://dl.hhvm.com/debian wheezy main | sudo tee /etc/apt/sources.list.d/hhvm.list
  3. apt-get update
  4. apt-get install hhvm
  5. update-rc.d hhvm defaults
复制代码



7. 替换配置文件

  1. cd /etc/nginx
  2. rm nginx.conf
  3. wget https://dl.dropboxusercontent.com/u/65206771/nginx.conf
  4. wget https://dl.dropboxusercontent.com/u/65206771/gzip.conf
  5. cd /etc/nginx/conf.d
  6. rm *
  7. wget https://dl.dropboxusercontent.com/u/65206771/default.conf
复制代码


8. 自己改一下
  1. server_name localhost;
  2. root /usr/share/nginx/html;
复制代码


9. 重启nginx和hhvm
  1. /etc/init.d/hhvm restart
  2. /etc/init.d/nginx restart
复制代码


10.done

kvmla.com的vps 4分钟复制粘贴安装完所有步骤

发表于 2014-7-4 10:00:04 | 显示全部楼层
0.0

防水墙补丁
suzizi 该用户已被删除
发表于 2014-7-4 10:00:38 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2014-7-4 10:00:42 | 显示全部楼层
不错  +10010
 楼主| 发表于 2014-7-4 10:31:07 | 显示全部楼层
suzizi 发表于 2014-7-4 10:00
安装容易 就是该程序兼容难

discuz什么的不兼容

有啥难的?跑dz和wp都没问题的,我测试过了
suzizi 该用户已被删除
发表于 2014-7-4 10:33:52 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2014-7-4 10:54:24 | 显示全部楼层
你这样配置,HHVM进程会自杀吗?用几天就出现502
发表于 2014-7-4 12:03:03 | 显示全部楼层
顶一个, 我先去试试看。。。
发表于 2014-7-4 12:57:59 | 显示全部楼层
caaol 发表于 2014-7-4 10:54
你这样配置,HHVM进程会自杀吗?用几天就出现502

在我项目的生产环境下, 比php-fpm稳定得多
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-4 00:40 , Processed in 0.090515 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表