系统环境 阿里云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, 感谢原作者分享。

DHCP是“动态主机配置协议DynamicHostConfigurationProtocol”的首字母缩写词,它是一种网络协议,可自动为计算机网络中的客户端系统分配IP地址。它从DHCP池或在其配置中指定的IP地址范围分配客户端。虽然你可以手动为客户端系统分配静态IP,但DHCP服务器简化了这一过程,并为网络上的客户端系统动态分配IP地址。在本文中,我们将演示如何在RHEL9/RockyLinux9上安装和配置DHCP服务器。先决条件预装RHEL9或RockyLinux9具有sudo管理权限的普

一、安装nginx容器为了让nginx支持文件上传,需要下载并运行带有nginx-upload-module模块的容器:sudopodmanpulldocker.io/dimka2014/nginx-upload-with-progress-modules:latestsudopodman-d--namenginx-p83:80docker.io/dimka2014/nginx-upload-with-progress-modules该容器同时带有nginx-upload-module模块和ng

vue3项目打包发布到服务器后访问页面显示空白1、处理vue.config.js文件中的publicPath处理如下:const{defineConfig}=require('@vue/cli-service')module.exports=defineConfig({publicPath:process.env.NODE_ENV==='production'?'./':'/&

1,将java项目打成jar包这里我用到的是maven工具这里有两个项目,打包完成后一个为demo.jar,另一个为jst.jar2.准备工具1.服务器2.域名(注:经过备案)3.xshell用于连接服务器4.winscp(注:视图工具,用于传输jar)3.将jar包传入服务器直接拖动即可3.使用xshell运行jar包注:(服务器的java环境以及maven环境,各位请自行配置,这里不做描述。)cd到jar包路径下执行:nohupjava-jardemo.jar>temp.txt&

TCP客户端一个使用TCP协议实现可连续对话的客户端示例代码:importsocket#客户端配置HOST='localhost'PORT=12345#创建TCP套接字并连接服务器client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)client_socket.connect((HOST,PORT))whileTrue:#获取用户输入message=input("请输入要发送的消息:&

scp是securecopy的简写,是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。scp是加密的,rcp是不加密的,scp是rcp的加强版。因为scp传输是加密的,可能会稍微影响一下速度。另外,scp还非常不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。场景:假设我现在有两台服务器(这里的公网ip和内网ip相互传都可以,当然用内网ip相互传

psutil是一个跨平台的Python库,它允许你获取有关系统进程和系统资源使用情况的信息。它支持Windows、Linux、OSX、FreeBSD、OpenBSD和NetBSD等操作系统,并提供了一些非常有用的功能,如:获取系统CPU使用率、内存使用率、磁盘使用率等信息。获取进程列表、进程状态、进程CPU使用率、进程内存使用率、进程IO信息等。杀死进程、发送信号给进程、挂起进程、恢复进程等操作。使用psutil,可以很方便地监控系统的运行状况,诊断问题和优化性能。以下是一个简单的示例,演示如何

一、安装前的准备工作在进行MySQL多实例的安装前,需要进行以下准备工作:准备多个MySQL的安装包,可以从MySQL官网下载适合自己环境的版本进行下载:https://dev.mysql.com/downloads/准备多个MySQL数据目录,可以通过创建不同的目录来支持不同的MySQL实例,例如:/data/mysql1、/data/mysql2等。针对每个MySQL实例,配置一个独立的MySQL用户,该用户拥有对应的MySQL安装路径和数据目录的权限。二、基于二进制包安装多个MySQL实例


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

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

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

Dreamweaver Mac版
视觉化网页开发工具