CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3

首先,安装依赖包并下载Nginx、MySQL和PHP源码。然后分别编译安装它们,最后配置环境变量。

安装编译环境

1、更新系统软件包

yum update y

2、安装依赖库和工具

CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3
yum install gcc gccc++ make zlibdevel pcredevel openssldevel y

3、下载并解压Nginx、MySQL和PHP源码包

wget http://nginx.org/download/nginx1.6.2.tar.gz
wget https://dev.mysql.com/get/Downloads/MySQL5.6/mysql5.6.21.tar.gz
wget http://www.php.net/distributions/php5.6.3.tar.gz

4、创建编译目录并进入

mkdir nginx mysql php
cd nginx

编译安装Nginx

1、解压源码包

tar zxvf nginx1.6.2.tar.gz

2、配置并编译

cd nginx1.6.2
./configure prefix=/usr/local/nginx withhttp_stub_status_module withhttp_ssl_module withpcre=/usr/local/src/pcre8.37 withopenssl=/usr/local/src/openssl1.0.1e
make && make install

3、启动Nginx并设置开机自启动

/usr/local/nginx/sbin/nginx
chkconfig nginx on

编译安装MySQL

1、解压源码包

cd ../mysql
tar zxvf mysql5.6.21.tar.gz

2、安装依赖库和工具

CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3
cd mysql5.6.21
yum install ncursesdevel y

3、配置并编译

cd mysql5.6.21
cmake . DCMAKE_INSTALL_PREFIX=/usr/local/mysql DWITH_INNOBASE_STORAGE_ENGINE=1 DWITH_ARCHIVE_STORAGE_ENGINE=1 DWITH_BLACKHOLE_STORAGE_ENGINE=1 DWITH_READLINE=1 DWITH_SSL=system DWITH_ZLIB=system DWITH_LIBWRAP=0 DMYSQL_DATADIR=/usr/local/mysql/data DSYSCONFDIR=/etc DWITH_TCP_PORT=3306 DDEFAULT_CHARSET=utf8mb4 DDEFAULT_COLLATION=utf8mb4_general_ci DWITH_EXTRA_CHARSETS=all DWITH_DEBUG=0 DWITH_EMBEDDED_SERVER=OFF DENABLED_LOCAL_INFILE=1 DENABLED_PROFILER=0 DENABLED_DEBUG_SYNC=0 DENABLED_DEBUG_SYNC_MODE=OFF DENABLED_PSALM=0 DENABLED_PSALM_TESTS=0 DENABLED_STATISTICS=0 DENABLED_PROFILING=0 DENABLED_TRACE=0 DENABLED_STMT_COUNT=0 DENABLED_DEBUG_LOG=0 DENABLED_GEOMETRY=OFF DENABLED_AUTOCOMMIT=OFF DENABLED_LOAD=OFF DENABLED_TIMESTAMPS=OFF DENABLED_OCI8=OFF DENABLED_SPATIAL=OFF DENABLED_REPLICATION=OFF DENABLED_SSL=system DWITH_SSLDIR=/usr/local/ssl DFEATURE_PLUGIN_AUTHENTICATION=OFF DFEATURE_PLUGIN_AUTHENTICATION_METHOD=SHA256_PASSWORD DFEATURE_FEDERATEDX509=ON DFEATURE_GSSAPI=OFF DFEATURE_GROUPCONCAT=OFF DFEATURE_NDBCLUSTER=OFF DFEATURE_REGEXP=ON DFEATURE_STACKDRIVER=OFF DFEATURE_EVENTS=OFF DFEATURE_XMLPARSER=ON DFEATURE_MAXEXECUTIONTIME=OFF DFEATURE_HELP=OFF DFEATURE_REOPENTABLES=OFF DFEATURE_PROCESSLISTACCESSIBILITY=OFF DFEATURE_UNBUFFEREDQUERIES=OFF DFEATURE_UPDATESTATISTICS=OFF DFEATURE_CHECKSUMAGGREGATION=OFF DFEATURE_MERGECONSTANTS=OFF DFEATURE_ALLOWUSERSWITCHING=OFF DFEATURE_MULTIRESULTSETS=OFF DFEATURE_SEQUENCETABLESTATUSBYTES=OFF DFEATURE_FOREIGNKEYCHECKS=ON DFEATUREBACKSLASHNOTNULL=ON DFEATURECANNOTIMPLEMENTLOCKINGBYTECODE=ON DFEATUREDISABLECONNECTBYLOCATOR=ON DFEATUREDONTUSETEMPTABLESFORCONNECT=ON DFEATUREHAVEGEOMETRYINDEX=OFF DFEATUREISNOTNULLAUTOINCREMENTALLWAYSINSERT = ON DFEATURELONGVARBINARYLITERALS = ON DFEATUREREPLICATIONROLLBACK = ON DFEATURESECURITYFUNCTIONS = ON DFEATURESELECTIVEINDEXSCAN = ON DFEATURESIMPLIFYINGLOOKUP = ON DFEATURESNAPSHOT = ON DFEATURESTMTPREPARATIONAREASIZE = ON DFEATURETWODATETIMEDIFFERENTPARAMTYPES = ON DFEATUREUTCDATETIME = ON DFEATUREVALIDATEUTF8MB4STRING = ON
DEFINES+=DHAVE__STRICT_ANSI__="" CXXFLAGS="g" CFLAGS="g" LDFLAGS="" OBJS="sql/sql_class.o sql/sql_const.o sql/sql_dictionary.o sql/sql_error.o sql/sql_field.o sql/sql_index.o sql/sql_item.o sql/sql_list.o sql/sql_metadata.o sql/sql_optimizer.o sql/sql_parse.o sql/sql_partitioning.o sql/sql_prepared.o sql/sql_queue.o sql/sql_records.o sql/sql_select.o sql/sql_servers.o sql/sql_statistics.o sql/sql_string.o sql/sql_tables.o sql/sql_transactions.o sql/sql_triggers.o sql/sqlddl.o storage/ha?dodah\?daemon\?storage\?engine?impl\?myisam?base\?imp\?ossp\?ha\?dodah\?daemon\?storage\?engine\?impl?myisam\?base?imp\?minimal\?myisam\?storage\?engine\?impl\?heap?imp\?bdb\?storage\?engine\?impl?innobase\?storage?engine\?impl\?myisam\?storage\?engine\?impl\?ndbcluster\?storage\?engine\?impl datatypes/datetime\?datatype\?impl handlers/blob\?handler datatypes/year?datatype\?impl handlers/json\?handler storage/adaptive\?hash\?index datatypes/json\?datatype\?impl storage/ndbinfo storage/ndbclient datatypes/event\?datatype\?impl storage/examples storage/examples\?plugin system tables sys schema files include scripts cmakefiles Makefile" make && make install

4、初始化数据库

cd /usr/local/mysql
scripts/mysql_install_db user=mysql basedir="$(pwd)" datadir="$(pwd)/data" pidfile="$(pwd)/data/mysqld.pid" socket="/tmp/mysqld.sock" port=3306 skiptestdb force defaultauthenticationplugin=sha256 password "yourpassword" initializeinsecure user='mysql' basedir='$(pwd)
CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3

原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/518577.html

Like (0)
Donate 微信扫一扫 微信扫一扫
K-seo的头像K-seoSEO优化员
Previous 2024-06-01 06:55
Next 2024-06-01 06:57

相关推荐

  • AS是否提供Linux版本?

    Red Hat Linux的Linux版本一、Red Hat Enterprise Linux (RHEL)1、概述:Red Hat Enterprise Linux(RHEL)是Red Hat公司针对企业级市场推出的Linux发行版,以其稳定性和安全性著称,2、版本划分:AS(Advanced Server……

    2024-11-16
    06
  • sql server数据库存储过程怎么写

    在SQL Server数据库中,存储过程是一种预编译的、可重用的SQL语句集合,它可以执行一系列操作,如插入、更新、删除等,存储过程可以提高代码的重用性和模块化,减少网络流量,提高性能,本文将详细介绍存储过程的概念、创建、使用和管理等方面的知识。存储过程的概念存储过程是一组预先编写好的SQL语句,它们被封装在一个独立的单元中,可以被多……

    2024-03-17
    0157
  • 如何在CentOS上安装和配置NFS服务器

    使用yum安装nfs-utils和rpcbind,编辑/etc/exports文件配置共享目录,启动rpcbind和nfs服务。

    2024-05-14
    0111
  • centos 安装gdb

    技术介绍在CentOS系统中,我们可以通过安装PHP扩展的方式来使用GD库,GD库是一个图形处理库,它提供了丰富的图像处理功能,如图像缩放、裁剪、旋转等,通过安装PHP的GD库扩展,我们可以在PHP脚本中直接使用这些功能,而无需在服务器端进行繁琐的图像处理操作,本文将详细介绍如何在CentOS系统中安装PHP GD库扩展。安装前的准备……

    2024-01-04
    0211
  • SQL数据库实例名称找不到或远程连接失败并显示错误error40的原因及解决办法

    SQL数据库连接失败,显示error40,可能因实例名称错误或远程连接问题。需检查实例名,配置远程连接设置,确保网络安全组策略允许连接。

    2024-02-18
    0317
  • VPS上给CentOS添加硬盘而不用重启服务器的方法是怎样的

    VPS上给CentOS添加硬盘而不用重启服务器的方法是怎样的?在VPS上给CentOS添加硬盘而不用重启服务器,可以使用以下方法:1、使用fdisk命令分区2、使用pvcreate命令创建物理卷3、使用vgextend命令扩展卷组4、使用lvextend命令扩展逻辑卷5、使用resize2fs命令调整文件系统大小6、使用mount命令……

    2024-01-12
    0117

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

免备案 高防CDN 无视CC/DDOS攻击 限时秒杀,10元即可体验  (专业解决各类攻击)>>点击进入