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

相关文章

Mac电脑如何通过 IntelliJ IDEA 远程连接 MySQL

《Mac电脑如何通过IntelliJIDEA远程连接MySQL》本文详解Mac通过IntelliJIDEA远程连接MySQL的步骤,本文通过图文并茂的形式给大家介绍的非常详细,感兴趣的朋友跟... 目录MAC电脑通过 IntelliJ IDEA 远程连接 mysql 的详细教程一、前缀条件确认二、打开 ID

Nginx中配置使用非默认80端口进行服务的完整指南

《Nginx中配置使用非默认80端口进行服务的完整指南》在实际生产环境中,我们经常需要将Nginx配置在其他端口上运行,本文将详细介绍如何在Nginx中配置使用非默认端口进行服务,希望对大家有所帮助... 目录一、为什么需要使用非默认端口二、配置Nginx使用非默认端口的基本方法2.1 修改listen指令

MySQL的配置文件详解及实例代码

《MySQL的配置文件详解及实例代码》MySQL的配置文件是服务器运行的重要组成部分,用于设置服务器操作的各种参数,下面:本文主要介绍MySQL配置文件的相关资料,文中通过代码介绍的非常详细,需要... 目录前言一、配置文件结构1.[mysqld]2.[client]3.[mysql]4.[mysqldum

MySQL中查询和展示LONGBLOB类型数据的技巧总结

《MySQL中查询和展示LONGBLOB类型数据的技巧总结》在MySQL中LONGBLOB是一种二进制大对象(BLOB)数据类型,用于存储大量的二进制数据,:本文主要介绍MySQL中查询和展示LO... 目录前言1. 查询 LONGBLOB 数据的大小2. 查询并展示 LONGBLOB 数据2.1 转换为十

Go语言连接MySQL数据库执行基本的增删改查

《Go语言连接MySQL数据库执行基本的增删改查》在后端开发中,MySQL是最常用的关系型数据库之一,本文主要为大家详细介绍了如何使用Go连接MySQL数据库并执行基本的增删改查吧... 目录Go语言连接mysql数据库准备工作安装 MySQL 驱动代码实现运行结果注意事项Go语言执行基本的增删改查准备工作

MySQL按时间维度对亿级数据表进行平滑分表

《MySQL按时间维度对亿级数据表进行平滑分表》本文将以一个真实的4亿数据表分表案例为基础,详细介绍如何在不影响线上业务的情况下,完成按时间维度分表的完整过程,感兴趣的小伙伴可以了解一下... 目录引言一、为什么我们需要分表1.1 单表数据量过大的问题1.2 分表方案选型二、分表前的准备工作2.1 数据评估

SQL Server 查询数据库及数据文件大小的方法

《SQLServer查询数据库及数据文件大小的方法》文章介绍了查询数据库大小的SQL方法及存储过程实现,涵盖当前数据库、所有数据库的总大小及文件明细,本文结合实例代码给大家介绍的非常详细,感兴趣的... 目录1. 直接使用SQL1.1 查询当前数据库大小1.2 查询所有数据库的大小1.3 查询每个数据库的详

MySQL中REPLACE函数与语句举例详解

《MySQL中REPLACE函数与语句举例详解》在MySQL中REPLACE函数是一个用于处理字符串的强大工具,它的主要功能是替换字符串中的某些子字符串,:本文主要介绍MySQL中REPLACE函... 目录一、REPLACE()函数语法:参数说明:功能说明:示例:二、REPLACE INTO语句语法:参数

MySQL设置密码复杂度策略的完整步骤(附代码示例)

《MySQL设置密码复杂度策略的完整步骤(附代码示例)》MySQL密码策略还可能包括密码复杂度的检查,如是否要求密码包含大写字母、小写字母、数字和特殊字符等,:本文主要介绍MySQL设置密码复杂度... 目录前言1. 使用 validate_password 插件1.1 启用 validate_passwo

mysql5.7.15winx64配置全过程

《mysql5.7.15winx64配置全过程》文章详细介绍了MySQL5.7.15免安装版的配置步骤,包括解压安装包、设置环境变量、修改配置文件、初始化数据目录、安装服务、启动数据库、登录及密码修改... 目录前言一、首先下载安装包二、安android装步骤1.第一步解压文件2.配置环境变量3.复制my-