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

相关推荐

  • centos启动网卡eth0

    在Linux系统中,网卡的名称通常是由系统自动分配的,例如eth0、eth1等,有时候我们可能需要修改网卡的名称,以满足特定的需求,某些网络服务可能会依赖于特定的网卡名称,或者我们可能希望避免与默认的网卡名称冲突,在CentOS系统中,我们可以使用一些简单的命令来修改网卡的名称。我们需要了解网卡名称是如何在系统中被识别的,在Linux……

    2023-12-26
    0126
  • centos怎么删除服务

    在CentOS 7上删除服务器是一个涉及到多个步骤的过程,需要谨慎操作,以避免数据丢失或者系统崩溃,以下是详细的步骤:1、备份数据 在删除服务器之前,首先需要备份所有重要的数据,这可以通过将数据复制到另一个存储设备,或者上传到云存储服务来实现,确保所有的数据都已经备份,然后再进行下一步。2、停止所有服务 使用systemctl命令停止……

    2024-03-29
    0126
  • centos 发行版

    CentOS系统详解:稳定可靠的企业级Linux发行版CentOS,全称为Community Enterprise Operating System,是一款基于Red Hat Enterprise Linux(RHEL)源代码构建的免费开源企业级Linux发行版,自2004年发布以来,CentOS一直以其稳定性、可靠性和安全性而受到广……

    2023-12-14
    0136
  • centos安装 docker

    在CentOS上安装Docker,首先更新系统,然后添加Docker仓库,最后使用yum命令安装Docker。

    2024-05-23
    0141
  • centos重启服务器导致Oracle数据库损坏

    在CentOS系统中,重启服务器是一项常见的操作,无论是为了更新系统、安装新的软件包,还是解决系统问题,我们都需要知道如何正确地重启服务器,本文将详细介绍如何在CentOS中重启服务器。使用命令行重启服务器在CentOS中,我们可以使用reboot命令来重启服务器,这个命令的语法非常简单,只需要在终端中输入reboot,然后按回车键即……

    2024-01-21
    0150
  • 在CentOS上如何完全安装和使用代理软件HAProxy

    在CentOS上如何完全安装和使用代理软件HAProxyHAProxy简介HAProxy是一个高性能的HTTP和TCP负载均衡器,它可以用于缓存静态内容,减少后端服务器的负载,提高网站性能,HAProxy支持TCP、HTTP、SSL等多种协议,具有高可用性、高扩展性等特点,本文将介绍如何在CentOS上安装和配置HAProxy。安装H……

    2024-01-14
    0173

发表回复

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

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