CentOS 安装 Apache PHP MYSQL Memcached Memcache 环境配置

本文主要是介绍CentOS 安装 Apache PHP MYSQL Memcached Memcache 环境配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

一、安装Apache

# tar xzvf httpd-2.2.15.tar.gz

# cd httpd-2.2.15

# ./configure --prefix=/home/user/webserver/apache2 --enable-so --enable-rewrite=share --enable-proxy=share --enable-proxy-ajp=share --enable-dav=share --enable-dav-fs

# make

#make install


安装MySQL

# tar xzvf mysql-5.0.22.tar.gz

# cd mysql-5.0.22

# mkdir /home/user/webserver/mysql

# ./configure --prefix=/home/user/webserver/mysql --with-named-curses-libs=/usr/lib64/libncurses.so.5

#make

#make install

目录权限
编译安装完成后执行后续操作:
# useradd mysql //添加 mysql 用户
# cd /home/user/webserver/mysql
# bin/mysql_install_db --user=mysql
# chown -R root:mysql . //设置权限,注意后面有一个 "."
# chown -R mysql /var/lib/mysql //设置 mysql 目录权限
# chgrp -R mysql . //注意后面有一个 "."
# cp share/mysql/my-huge.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld //开机自动启动 mysql。
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig --add mysqld
# /etc/rc.d/init.d/mysqld start //启动 MySQL
# bin/mysqladmin -u root password "password_for_root"
# service mysqld stop //关闭 MySQL

安装说明

安装PHP
# tar zxvf php-5.2.13.tar.gz

# cd php-5.2.13

# CFLAGS="-O3 -fPIC" ./configure --prefix=/home/user/webserver/php --with-apxs2=/home/user/webserver/apache2/bin/apxs --with-zlib-dir=/usr/local/lib --with-config-file-path=/home/user/webserver/php/lib --with-mysql=/home/user/webserver/mysql

#编辑 httpd.conf
line 55 LoadModule php5_module /home/user/webserver/apache2/modules/libphp5.so
line 170 <IfModule dir_module>  DirectoryIndex index.php index.html index.htm  </IfModule>
line 316 AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps
line 424 PHPIniDir "/etc/"
增加 php.ini


 安装 Memcached
# tar zxvf memcached-1.2.6.tar.gz
# cd memcached-1.2.6
# ./configure --prefix=/home/user/webserver/memcached
# make
# make install

Memcache扩展安装:
# tar zxvf memcache-2.2.4.tgz
# cd memcache-2.2.4
# /home/user/webserver/php/bin/phpize
# ./configure --enable-memcache --with-php-config=/home/user/webserver/php/bin/php-config --with-zlib-dir
# make
# make install

配置
####### /home/user/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/memcache.so #######
# ls -l /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/memcache.so
# vim /usr/local/php/lib/php.ini
新增配置内容: extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" extension = memcache.so 检查安装结果 # /usr/local/php/bin/php -m
# /usr/local/apache2/bin/apachectl restart


二、安装附件

{安装Linux cent os5.3时出现configure failed for srclib/apr

linux 2009-10-22 15:21:15 阅读99 评论0   字号:大中小 订阅
  在linux cent OS5.3安装apache 运用命令httpd-2.2.11]# ./configure --sysconfdir=/etc --enable-ssl --enable-modules 时出现了

........................

checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/httpd-2.2.11/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure failed for srclib/apr

   查看了一下原来是错误开始于srclib/apr文件,检查gcc编译器时提示没发现并且在系统环境变量$PATH中没有合适的c编译器,以是使用yum -y install gcc来安装gcc编译器,就可继续安装了.}
CentOS安装TortoiseSVN
yum install -y subversion

安装gcc的也要yum install gcc

 yum install ncurses

{mysql Segmentation fault
已有 76 次阅读  2011-02-28 11:17   标签:  color  style
刚安装好的mysql去了解居然出现Segmentation fault然后直接退出

# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.47-log Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Segmentation fault

是少了ncurses-devel的RPM包,yum install ncurses-devel
然后重新编译mysql}


解决 安装 MYSQL exec: g++: not found 报错
解决办法:
 
yum install -y gcc-c++

{bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/home/user/webserver/mysql/bin/mysqladmin -u root password 'new-password'
/home/user/webserver/mysql/bin/mysqladmin -u root -h CentOS5.LT password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /home/user/webserver/mysql ; /home/user/webserver/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /home/user/webserver/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
}

libxml2

yum install autoconf

# cd /usr/src
# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
# tar -zvxf m4-1.4.9.tar.gz # cd m4-1.4.9/
# ./configure && make && make install
# cd ../
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install

{Mysql安装:/bin/rm: cannot remove `libtoolt': No such file or directory2011年04月28日 星期四 14:41编译MySQL的过程中提示:
/bin/rm: cannot remove `libtoolt': No such file or directory
解决:
1、确认libtool是否已经安装,如果没有安装的话,则先安装libtool
# yum -y install libtool
2、分别执行以下三条命令:
# autoreconf --force --install
# libtoolize --automake --force
# automake --force --add-missing
再重新编译安装,问题解决!}


zlib
CFLAGS="-O3 -fPIC" ./configure  

{安装 libevent
# tar zxvf libevent-1.4.9-stable.tar.gz
# cd libevent-1.4.9-stable
# ./configure --prefix=/usr
# make
# make install}

三、安装问题
./mysql_install_db
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/home/user/webserver/mysql/bin/mysqladmin -u root password 'new-password'
/home/user/webserver/mysql/bin/mysqladmin -u root -h CentOS5.LT password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /home/user/webserver/mysql/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd /home/user/webserver/mysql ; /home/user/webserver/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /home/user/webserver/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com


./mysql_install_db --user=mysql --basedir=/home/user/webserver/mysql --datadir=/home/user/webserver/mysql/var
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/home/user/webserver/mysql/bin/mysqladmin -u root password 'new-password'
/home/user/webserver/mysql/bin/mysqladmin -u root -h CentOS5.LT password 'new-password'
See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the /home/user/webserver/mysql/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd /home/user/webserver/mysql ; /home/user/webserver/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /home/user/webserver/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com

{bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/home/user/webserver/mysql/bin/mysqladmin -u root password 'new-password'
/home/user/webserver/mysql/bin/mysqladmin -u root -h CentOS5.LT password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /home/user/webserver/mysql ; /home/user/webserver/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /home/user/webserver/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
}

{ bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 5.0.22-log

Segmentation fault
}

这篇关于CentOS 安装 Apache PHP MYSQL Memcached Memcache 环境配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/883425

相关文章

MySQL 主从复制部署及验证(示例详解)

《MySQL主从复制部署及验证(示例详解)》本文介绍MySQL主从复制部署步骤及学校管理数据库创建脚本,包含表结构设计、示例数据插入和查询语句,用于验证主从同步功能,感兴趣的朋友一起看看吧... 目录mysql 主从复制部署指南部署步骤1.环境准备2. 主服务器配置3. 创建复制用户4. 获取主服务器状态5

SpringBoot中六种批量更新Mysql的方式效率对比分析

《SpringBoot中六种批量更新Mysql的方式效率对比分析》文章比较了MySQL大数据量批量更新的多种方法,指出REPLACEINTO和ONDUPLICATEKEY效率最高但存在数据风险,MyB... 目录效率比较测试结构数据库初始化测试数据批量修改方案第一种 for第二种 case when第三种

Windows环境下解决Matplotlib中文字体显示问题的详细教程

《Windows环境下解决Matplotlib中文字体显示问题的详细教程》本文详细介绍了在Windows下解决Matplotlib中文显示问题的方法,包括安装字体、更新缓存、配置文件设置及编码調整,并... 目录引言问题分析解决方案详解1. 检查系统已安装字体2. 手动添加中文字体(以SimHei为例)步骤

MySql基本查询之表的增删查改+聚合函数案例详解

《MySql基本查询之表的增删查改+聚合函数案例详解》本文详解SQL的CURD操作INSERT用于数据插入(单行/多行及冲突处理),SELECT实现数据检索(列选择、条件过滤、排序分页),UPDATE... 目录一、Create1.1 单行数据 + 全列插入1.2 多行数据 + 指定列插入1.3 插入否则更

MySQL深分页进行性能优化的常见方法

《MySQL深分页进行性能优化的常见方法》在Web应用中,分页查询是数据库操作中的常见需求,然而,在面对大型数据集时,深分页(deeppagination)却成为了性能优化的一个挑战,在本文中,我们将... 目录引言:深分页,真的只是“翻页慢”那么简单吗?一、背景介绍二、深分页的性能问题三、业务场景分析四、

MySQL 迁移至 Doris 最佳实践方案(最新整理)

《MySQL迁移至Doris最佳实践方案(最新整理)》本文将深入剖析三种经过实践验证的MySQL迁移至Doris的最佳方案,涵盖全量迁移、增量同步、混合迁移以及基于CDC(ChangeData... 目录一、China编程JDBC Catalog 联邦查询方案(适合跨库实时查询)1. 方案概述2. 环境要求3.

JAVA中安装多个JDK的方法

《JAVA中安装多个JDK的方法》文章介绍了在Windows系统上安装多个JDK版本的方法,包括下载、安装路径修改、环境变量配置(JAVA_HOME和Path),并说明如何通过调整JAVA_HOME在... 首先去oracle官网下载好两个版本不同的jdk(需要登录Oracle账号,没有可以免费注册)下载完

nginx 负载均衡配置及如何解决重复登录问题

《nginx负载均衡配置及如何解决重复登录问题》文章详解Nginx源码安装与Docker部署,介绍四层/七层代理区别及负载均衡策略,通过ip_hash解决重复登录问题,对nginx负载均衡配置及如何... 目录一:源码安装:1.配置编译参数2.编译3.编译安装 二,四层代理和七层代理区别1.二者混合使用举例

Java JDK1.8 安装和环境配置教程详解

《JavaJDK1.8安装和环境配置教程详解》文章简要介绍了JDK1.8的安装流程,包括官网下载对应系统版本、安装时选择非系统盘路径、配置JAVA_HOME、CLASSPATH和Path环境变量,... 目录1.下载JDK2.安装JDK3.配置环境变量4.检验JDK官网下载地址:Java Downloads

SQL server数据库如何下载和安装

《SQLserver数据库如何下载和安装》本文指导如何下载安装SQLServer2022评估版及SSMS工具,涵盖安装配置、连接字符串设置、C#连接数据库方法和安全注意事项,如混合验证、参数化查... 目录第一步:打开官网下载对应文件第二步:程序安装配置第三部:安装工具SQL Server Manageme