nginx+php+memcache安装笔记

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
云数据库 RDS MySQL Serverless,价值2615元额度,1个月
简介:

 安装mysql

./configure --prefix=/opt/test/mysql --localstatedir=/opt/test/var/mysql/var --with-unix-socket-path=/opt/test/mysql/mysql.sock --with-mysqld-user=mysql --with-plugins=archive,partition,myisam,innobase,heap,csv --with-extra-charsets=gbk,gb2312,utf8,ascii --with-charset=utf8 --with-collation=utf8_general_ci --with-big-tables --enable-assembler --enable-profiling --enable-local-infile --enable-thread-safe-client --with-fast-mutexes --with-pthread --with-zlib-dir=bundled --with-readline --without-geometry --without-embedded-server --without-debug --without-ndb-debug --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static
make && make install
 
安装nginx
./configure --prefix=/opt/test/nginx --user=www --group=www --with-poll_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre
 
安装php
./configure --prefix=/opt/test/php  --with-mysql=/opt/test/mysql --with-curl --with-freetype-dir --enable-gd-native-ttf --with-ttf --with-sybase --with-mssql --with-zlib --with-gd --with-jpeg-dir --enable-mbstring=all --enable-mbregex --enable-soap --with-mcrypt --enable-sockets --enable-ftp --enable-zip --with-iconv --with-xsl --with-xmlrpc --with-png-dir --with-openssl --with-db4=/opt/test/db4/
Make && make install
cp php.ini-production   /opt/test/php/lib/php.ini
修改extension_dir
extension_dir = "/opt/test/php/include/php/ext"
 
安装APC扩展
Cd  APC-*
/opt/test/php/bin/phpize
./configure --with-php-config=/opt/test/php/bin/php-config
Make
cp modules/apc.so   /opt/test/php/include/php/ext/
 
在php.ini中添加
extension=apc.so
 
memcache扩展
/opt/test/php/bin/phpize;./configure --with-php-config=/opt/test/php/bin/php-config
Make
cp modules/memcache.so   /opt/test/php/include/php/ext/
 
在php.ini中添加
extension=memcache.so
 
安装ImageMagick
./configure
Make
Make install
 
安装imagick扩展
/opt/test/php/bin/phpize;./configure --with-php-config=/opt/test/php/bin/php-config
Make
cp modules/imagick.so   /opt/test/php/include/php/ext/
 
修改php.ini
extension=imagick.so
 
安装MagickWandForPHP扩展
/opt/test/php/bin/phpize
./configure --with-php-config=/opt/test/php/bin/php-config
Make
cp modules/magickwand.so   /opt/test/php/include/php/ext/
 
修改php.ini
extension=magickwand.so
 
安装memcached扩展
 
安装memcached
./configure --prefix=/usr/local/memcached
make && sudo make install
 
安装libmemcached
./configure --with-memcached=/usr/local/memcached/bin/memcached
make && sudo make install
 
安装memcached扩展
/opt/test/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
Make
cp modules/memcached.so   /opt/test/php/include/php/ext/
 
编辑php.ini
extension=memcached.so
 
启动fast-cgi
spawn-fcgi -a 127.0.0.1 -p 10080 -C 250 -u www -f /opt/test/php/bin/php-cgi
 
启动nginx
/opt/test/nginx/sbin/nginx  -c /opt/test/nginx/conf/nginx.conf
 
Memcached高可用搭建
 
编译安装libevent
tar zxvf libevent-1.4.9-stable.tar.gz
cd libevent-1.4.9-stable/
./configure - -prefix=/usr
make && make install
 
编译安装Memcached
tar zxvf memcached-1.2.6.tar.gz
cd memcached-1.2.6/
./configure - -with-libevent=/usr
make && make install
 
编译安装magent
mkdir magent
cd magent/
wget http://memagent.googlecode.com/files/magent-0.5.tar.gz
tar zxvf magent-0.5.tar.gz
/sbin/ldconfig
sed -i “s#LIBS = -levent#LIBS = -levent -lm#g” Makefile
make
cp magent /usr/bin/magent
 
实例
memcached -m 1 -u root -d -l 127.0.0.1 -p 11211
memcached -m 1 -u root -d -l 127.0.0.1 -p 11212
memcached -m 1 -u root -d -l 127.0.0.1 -p 11213
magent -u root -n 51200 -l 127.0.0.1 -p 12000 -s 127.0.0.1:11211 -s 127.0.0.1:11212 -b 127.0.0.1:11213









本文转自 waydee 51CTO博客,原文链接:http://blog.51cto.com/waydee/821036,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
12天前
|
负载均衡 Java 应用服务中间件
nginx安装在linux上
nginx安装在linux上
41 2
|
17天前
|
应用服务中间件 nginx
树莓派安装Nginx服务结合内网穿透实现无公网IP远程访问
树莓派安装Nginx服务结合内网穿透实现无公网IP远程访问
|
28天前
|
缓存 负载均衡 应用服务中间件
Nginx安装与使用: Nginx之编译安装的nginx加入systemctl、Nginx命令
Nginx安装与使用: Nginx之编译安装的nginx加入systemctl、Nginx命令
56 0
|
1天前
|
Ubuntu 应用服务中间件 nginx
ubuntu编译安装nginx及安装nginx_upstream_check_module模块
以上是编译安装Nginx和安装 `nginx_upstream_check_module`模块的基本步骤。根据你的需求和环境,你可能需要进一步配置Nginx以满足特定的要求。
12 3
|
5天前
|
应用服务中间件 PHP nginx
php如何实现检测nginx配置的正确性
请确保在执行此操作时,PHP有足够的权限来执行Nginx命令和访问Nginx配置文件。另外,将上述代码嵌入到您的应用程序中时,要注意安全性,以防止潜在的命令注入攻击。
35 3
|
7天前
|
弹性计算 应用服务中间件 Shell
一键编译安装Nginx脚本
【4月更文挑战第30天】
11 1
|
7天前
|
关系型数据库 MySQL 应用服务中间件
centos7在线安装jdk1.8+tomcat+mysql8+nginx+docker
现在,你已经成功在CentOS 7上安装了JDK 1.8、Tomcat、MySQL 8、Nginx和Docker。你可以根据需要配置和使用这些服务。请注意,安装和配置这些服务的详细设置取决于你的具体需求。
26 2
|
12天前
|
负载均衡 前端开发 应用服务中间件
Nginx安装与使用
Nginx安装与使用
32 0
|
13天前
|
应用服务中间件 Linux 网络安全
【Linux】中如何安装nginx
【Linux】中如何安装nginx
30 0
|
18天前
|
应用服务中间件 Linux nginx
Nginx的安装(Linux版)
Nginx的安装(Linux版)
20 0
Nginx的安装(Linux版)