HHvm建站环境搭建方法:Nginx、lnmp/lamp等安装部署
5、然后编辑:vi /etc/hhvm/config.hdf ,加入如下内容: ResourceLimit { CoreFileSize = 0 # in bytes MaxSocket = 10000 # must be not 0, otherwise HHVM will not start SocketDefaultTimeout = 5 # in seconds MaxRSS = 0 MaxRSSPollingCycle = 0 # in seconds, how often to check max memory DropCacheCycle = 0 # in seconds, how often to drop disk cache } Log { Level = Info AlwaysLogUnhandledExceptions = true RuntimeErrorReportingLevel = 8191 UseLogFile = true UseSyslog = false File = /var/log/hhvm/error.log Access { * { File = /var/log/hhvm/access.log Format = %h %l %u % t "%r" %>s %b } } } MySQL { ReadOnly = false ConnectTimeout = 1000 # in ms ReadTimeout = 1000 # in ms SlowQueryThreshold = 1000 # in ms, log slow queries as errors KillOnTimeout = false } Mail { SendmailPath = /usr/sbin/sendmail -t -i ForceExtraParameters = } 6、新建站点配置: vi /etc/nginx/conf.d/xxxxx.conf ,加入如下配置: server { listen 80; server_name xxxxx; index index.html index.htm index.php; root /home/wwwroot/xxxxx; #include wordpress.conf; include hhvm.conf; location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*.(js|css)?$ { expires 12h; } access_log /home/wwwlogs/xxxxx.log; } 7、然后记得给自己生成个日志文件和相关的目录: mkdir /home/wwwroot mkdir /home/wwwlogs touch /home/wwwlogs/xxxxx.log 8、请把如上内容中的 “xxxxx” 改为你的域名,然后把网站文件放在 /home/wwwroot/xxxxx 下即可搭建网站(lnmp 用习惯了,目录习惯改不掉了) 9、注意:如果你的站点是 wordpress,就把上面配置代码中的 include wordpress.conf 前的“#”号去掉,然后编辑:vi /etc/nginx/wordpress.conf ,加入如下内容: location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; 10、重启一下 nginx 看看可否启动: service nginx restart 。如果启动的时候说端口被占用了,就看看 netstat -anp | grep hhvm ,估计你得到的结果就 hhvm 占用了 80 端口。 执行命令: pkill hhvm 11、然后再重新启动 nginx 就会显示 OK 了。最后晒个探针图(点击放大): 12、 这样配置的阿里云,使用 hhvm 用探针做性能测试的话,如下图(点击放大): 13、利用上文介绍的搭建hhvm 的方法,管理数据库之类的可以使用 phpmyadmin ,在线管理文件可以使用 kodexplorer ,如果是再次新建站点的时候就直接执行:
注:相关网站建设技巧阅读请移步到建站教程频道。 (编辑:PHP编程网 - 黄冈站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |