在服务器搭建Tengine+HHVM环境运行WordPress
系统环境 阿里云1核+512M内存 Ubuntu 12.04 64位 Wordpress 3.9 修改系统软件源 参考http://mirrors.aliyun.com/help/ubuntu deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ pr
系统环境
阿里云1核+512M内存 Ubuntu 12.04 64位
Wordpress 3.9
修改系统软件源
参考http://mirrors.aliyun.com/help/ubuntu
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse
若使用阿里云服务器,将源的域名从mirrors.aliyun.com改为mirrors.aliyuncs.com,不占用公网流量,而且下载速度更快。
更新系统软件
sudo apt-get update && sudo apt-get upgrade
安装Tengine
1、安装依赖软件
apt-get --install-suggests install gcc g++ make
2、下载相关软件
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz wget http://zlib.net/zlib-1.2.8.tar.gz wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2 wget http://tengine.taobao.org/download/tengine-2.0.2.tar.gz
3、安装Pcre
tar zxvf pcre-8.35.tar.gz cd pcre-8.35 ./configure --prefix=/usr/local/pcre-8.35 make && make install
4、安装Zlib
cd .. tar zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8 ./configure --prefix=/usr/local/zlib-1.2.8 make && make install
5、安装OpenSSl
cd .. tar zxvf openssl-1.0.1g.tar.gz cd openssl-1.0.1g ./config --prefix=/usr/local/openssl-1.0.1g make && make install
6、解压jemalloc不需要安装
cd .. && tar jxvf jemalloc-3.6.0.tar.bz2
7、安装Tengine
./configure --prefix=/usr/local/nginx \ --user=www-data \ --group=www-data \ --with-pcre=/usr/local/src/pcre-8.35 \ --with-zlib=/usr/local/src/zlib-1.2.8 \ --with-openssl=/usr/local/src/openssl-1.0.1g \ --with-jemalloc=/usr/local/src/jemalloc-3.6.0 \ --with-http_gzip_static_module \ --with-http_realip_module \ --with-http_stub_status_module \ --with-http_concat_module make && make install
安装HHVM
其他系统参考https://github.com/facebook/hhvm/wiki
echo '140.211.166.134 dl.hhvm.com' >> /etc/hosts sudo apt-get install software-properties-common python-software-properties sudo add-apt-repository ppa:mapnik/boost wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add - echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list sudo apt-get update sudo apt-get install hhvm
server hhvm start # 启动HHVM
如果想使用UNIX socket的方式启动HHVM,需要修改/etc/hhvm/server.ini
; php options pid = /var/run/hhvm/pid ; hhvm specific ;hhvm.server.port = 9000 hhvm.server.type = fastcgi hhvm.server.file_socket = /var/run/hhvm/hhvm.sock hhvm.server.default_document = index.php hhvm.log.level = Error hhvm.log.always_log_unhandled_exceptions = true hhvm.log.runtime_error_reporting_level = 8191 hhvm.log.use_log_file = true hhvm.log.file = /var/log/hhvm/error.log hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc hhvm.mysql.typed_results = false
配置nginx.conf,
#user nobody; worker_processes auto; worker_rlimit_nofile 100000; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 65535; use epoll; multi_accept on; } # load modules compiled as Dynamic Shared Object (DSO) # #dso { # load ngx_http_fastcgi_module.so; # load ngx_http_rewrite_module.so; #} http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; access_log off; upstream hhvm { server unix:/var/run/hhvm/hhvm.sock; #server 127.0.0.1:9000; } server_tokens off; sendfile on; tcp_nopush on; keepalive_timeout 65; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 20m; open_file_cache max=10000 inactive=5m; open_file_cache_valid 2m; open_file_cache_min_uses 1; open_file_cache_errors on; #gzip on; include gzip.conf; #vhost include vhost_liuzhichao.com; }
vim /etc/nginx/conf/gzip.conf
gzip on; gzip_proxied any; gzip_types text/css; gzip_types text/csv; gzip_types text/plain; gzip_types text/javascript; gzip_types application/javascript; gzip_types application/json; gzip_types application/x-javascript; gzip_types application/ecmascript; gzip_types application/xml; gzip_types application/xml+rss; gzip_types application/rss+xml; gzip_types application/atom_xml; gzip_types application/xhtml+xml; gzip_types application/x-font-ttf; gzip_types application/x-font-opentype; gzip_types application/vnd.ms-fontobject; gzip_types image/svg+xml; gzip_types image/x-icon; gzip_types text/xml; gzip_comp_level 3; gzip_http_version 1.1; gzip_vary on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; gzip_buffers 16 8k; gzip_min_length 20;
vim vhost_liuzhichao.com
server{ listen 80; server_name liuzhichao.com www.liuzhichao.com; root /var/www/liuzhichao.com; index index.html index.htm index.php; charset utf-8; #access_log /var/log/nginx/liuzhichao.com-access.log main; access_log /dev/null; error_log /var/log/nginx/liuzhichao.com/error.log error; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ /wp-content/uploads/.*\.(php|php5)?$ { deny all; } location = /favicon.ico { log_not_found off; access_log off; expires max; } location = /robots.txt { allow all; log_not_found off; access_log off; } #Browser Cache Control Directives #Prevent (deny) Access to Hidden Files with Nginx location ~ /\. { access_log off; log_not_found off; } # Cache static files for as long as possible location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { expires max; log_not_found off; access_log off; } #The HHVM Magic Here location ~ \.(hh|php)$ { fastcgi_keep_conn on; try_files $uri = 404; fastcgi_index index.php; fastcgi_split_path_info ^(.+.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass hhvm; }
从目前的试用情况来看,查看阿里云监控,CPU占用率相对之前nginx+php-fpm架构低了不只是一点点,内存使用率也比较平稳.只是在上传文件或是更新插件时,经常会导致HHVM进程终止,然后网站出现502错误。不知道是不是因为上面的配置问题。
?
原文地址:在服务器搭建Tengine+HHVM环境运行WordPress, 感谢原作者分享。

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

我們在使用Word的時候,為了編輯內容更好美觀,我們常常會使用標尺。要知道,在Word中的標尺包括水平標尺和垂直標尺,用於顯示和調整文件的頁邊距、段落縮排、製表符等。那麼,Word中的標尺怎麼顯示出來的呢?下面,我就來教大家設定標尺的顯示方法。有需要的同學趕快收藏起來吧!步驟如下:1、首先,我們需要把word標尺調出來,預設的word文件是不顯示word標尺的,我們只需要點選word中的【檢視】的按鈕。 2、然後,我們找到【標尺】的選項,勾選就可以了。這樣一來,word標尺就被我們調出來了!是不是

Word文件由於功能的強大被大家廣泛使用,word裡不但可以插入各種格式,比如圖片和表格等等,現在為了文件的完整性真實性,好多文件都需要在文檔末尾加入手工簽名,聽起來這麼複雜的問題要怎麼解決呢,今天小編就教大家word文檔怎麼加手寫簽名。使用掃描器、相機或手機對手寫簽名進行掃描或拍攝,然後透過PS或其他圖片編輯軟體對圖片進行必要的裁切處理。 2.在要插入手寫簽名的Word文件中選擇“插入—圖片—來自文件”,選擇裁切好的手寫簽名。 3.滑鼠雙擊手寫簽名圖片(或右鍵圖片選擇「設定圖片格式」),彈出「設定圖

DHCP中繼的作用是將接收到的DHCP封包轉送到網路上的另一個DHCP伺服器,即使這兩台伺服器位於不同的子網路中。透過使用DHCP中繼,您可以實現在網路中心部署集中式的DHCP伺服器,並利用它為所有網路子網路/VLAN動態分配IP位址。 Dnsmasq是一種常用的DNS和DHCP協定伺服器,可設定為DHCP中繼伺服器,以協助管理網路中的動態主機設定。在本文中,我們將向您展示如何將dnsmasq配置為DHCP中繼伺服器。內容主題:網路拓樸在DHCP中繼上設定靜態IP位址集中式DHCP伺服器上的D

我們平常常使用word來辦公,但是你是否知道word中底紋設定在哪呢?今天就來跟大家分享具體的操作步驟,朋友們快來看看吧! 1.首先,開啟word文檔,選取一段需要新增底紋的文字段落訊息,然後點選工具列上的【開始】按鈕,找到段落區域,點選右側的下拉按鈕,(如下圖紅色圈出部分所示)。 2.點選下拉框按鈕之後,在彈出的選單選項中,點選【邊框和底紋】選項,(如下圖紅色圈出部分所示)。 3.在彈出的【邊框和底紋】對話框中,點選【底紋】的這個選項,(如下圖紅色圈出部分所示)。 4.在填滿的那一欄,選擇顏色

有時候,我們在Word表格中會經常遇到計數的問題;通常遇到這樣的問題,大部分同學都回把Word表格複製到Excel中來計算;還有一部分同學會默默地拿起計算器去算。那有沒有快速的方法來計算呢?當然有啊,其實在Word中也是可以計算求和的。那麼,你知道該怎麼操作嗎?今天,我們就來一起來看吧!廢話不多說,有需要的朋友趕緊收藏起來吧!步驟詳情:1、首先,我們開啟電腦上的Word軟體,開啟需要處理的文件。 (如圖)2、接著,我們將遊標定位在求和數值所在的儲存格上(如圖);然後,我們點選【選單列

Word作為我們非常常用的文字處理軟體,無時無刻不充斥在我們的生活學習和工作當中。當然,想要利用好Word來編輯文字,地基一定要打好。那今天小編就帶大家一起來學習Word怎麼加底線,可以跟小編一起操作,非常的簡單。 1,首先,我們打開我們需要編輯的文件,在這裡我們以下圖為例。 2,用滑鼠選取我們需要編輯的文字,在彈出的選項卡里我們選擇【U】圖標,操作如圖所示:3,我們來看一看效果如何:4,其實我們可以採用一個更加方便快捷的方法,就是利用鍵盤上的組合鍵【ctrl】+【U】,即可為你的文字加上下

Word軟體是我們必不可少且需要經常使用的,前面學習了Word軟體編輯表格,但是,如果不小心,將表格的橫豎方向編輯反了,又不想浪費時間重新製作,是否可以將表格的橫豎調換呢?答案當然是肯定,接下來,就由小編為大家詳細的介紹word怎麼把表格橫豎調換的操作方法,讓我們一起來學習吧。首先,我們需要將下面的Word表格進行行列互換。要做到這一點,我們需要先全部選取表格,然後右鍵點擊並選擇複製功能。第2步,選擇複製以後我們把word最小化,然後打開一個Excel表格,點擊右鍵,選擇貼上,把它貼到Exc

在word裡邊內容多的時候,會有很多章節,我們不可能一個章節一個的進行編寫,其實我們可以使用word序號自動排序,操作簡單方法還方便,不知道怎麼操作的小伙伴們快來學習一下吧! 1.首先,我們在電腦上開啟要處理的文檔,如下圖所示:2.開啟文檔後,選擇需要自動排序的文字,本範例選擇【第1章】和【第2章】按住Ctrl鍵實作選擇多個區域,選定後用滑鼠點選Word的【開始】選單,如下圖紅色圈出部分所示:3.點選【段落】工具列上面的編號右邊的小三角符號,在彈出式選單中點選需要選擇的序號類型,如下圖紅色箭頭指向所
