Centos6.5 下安装配置Apache+PHP+Mysql环境
1.准备工作
# yum -y update && yum -y install vim make cmake gcc gcc-c++ bison bison-devel ncurses ncurses-devel autoconf automake wget unzip lrzsz zlib zlib-devel libgcrypt* libtool*
2.安装apache2.2
# wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.31.tar.gz
# tar zxf httpd-2.2.31.tar.gz
# cd httpd-2.2.31
# ./configure --prefix=/usr/local/apache2.2 \
--enable-modules=all \
--enable-mods-shared=all \
--enable-so # make && make install
# vim /usr/local/apache2.2/bin/apachectl
在第二行添加 # chkconfig: 2345 64 36 # vim /usr/local/apache2.2/conf/httpd.conf
把 ServerName www.example.com:80 前面的#去掉 # cp /usr/local/apache2.2/bin/apachectl /etc/init.d/httpd
# service httpd start
# chkconfig httpd on
3.php依赖软件安装(省略了tar zxf , cd 命令)
3.1 安装 libxml2
# wget ftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gz
# ./configure --prefix=/usr/local/libxml2 && make && make install
3.2 安装 libjpeg
# wget http://www.ijg.org/files/jpegsrc.v8.tar.gz
# ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static && make && make install
3.3 安装 libpng
# wget http://ncu.dl.sourceforge.net/project/libpng/libpng14/older-releases/1.4.3/libpng-1.4.3.tar.gz
# ./configure&& make && make install
3.4 安装 freetype
# wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
# ./configure --prefix=/usr/local/freetype && make && make install
3.5 安装 libgd
# wget https://github.com/libgd/libgd/archive/GD_2_0_33.tar.gz
# ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg --with-png=/usr/local --with-zlib --with-freetype=/usr/local/freetype && make && make install
4.安装php
# wget http://cn2.php.net/distributions/php-5.3.28.tar.gz
# ./configure --prefix=/usr/local/php5328 \
--with-config-file-path=/usr/local/php5328/lib/php.ini \
--with-apxs2=/usr/local/apache2.2/bin/apxs \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-freetype-dir=/usr/local/freetype \
--with-gd=/usr/local/gd \
--with-zlib --with-libxml-dir=/usr/local/libxml2 \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir \
--enable-mbstring=all \
--enable-mbregex \
--enable-shared # make && make install
# cp php.ini-development /usr/local/php5328/lib/php.ini
# vim /usr/local/apache2.2/conf/httpd.conf
1.在最后一个LoadModule下添加 AddType application/x-httpd-php .php .phtml 2.找到
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
在index.html 后面添加 index.php # service httpd restart
5.通过编译源码的方式安装mysql
# groupadd mysql
# useradd -r -g mysql mysql
# mkdir -p /usr/local/mysql /usr/local/mysql/data /usr/local/mysql/logs /usr/local/mysql/tmp
# rm -f /etc/my.cnf
# vim /etc/profile
添加2行
PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
export PATH # source /etc/profile
# wget http://downloads.mysql.com/archives/get/file/mysql-5.6.16.tar.gz
# tar zxf mysql-5.6.16.tar.gz
# cd mysql-5.6.16
# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1 \
-DSYSCONFDIR=/etc # make && make install
# chown -Rf mysql:mysql /usr/local/mysql
# cd /usr/local/mysql
# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
# rm -f my.cnf
编辑/etc/my.cnf
# vim /etc/my.cnf [client]
port = 3306
socket = /usr/local/mysql/mysql.sock [mysqld]
character-set-server = utf8
collation-server = utf8_general_ci
skip-external-locking
skip-name-resolve
user = mysql
port = 3306
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
tmpdir = /usr/local/mysql/tmp
socket = /usr/local/mysql/mysql.sock
log-error = /usr/local/mysql/logs/mysql_error.log
pid-file = /usr/local/mysql/mysql.pid
open_files_limit = 10240
back_log = 600
max_connections=500
max_connect_errors = 6000
wait_timeout=605800
#open_tables = 600
#table_cache = 650
#opened_tables = 630
max_allowed_packet = 32M
sort_buffer_size = 4M
join_buffer_size = 4M
thread_cache_size = 300
query_cache_type = 1
query_cache_size = 256M
query_cache_limit = 2M
query_cache_min_res_unit = 16k
tmp_table_size = 256M
max_heap_table_size = 256M
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
lower_case_table_names=1
default-storage-engine = INNODB
innodb_buffer_pool_size = 2G
innodb_log_buffer_size = 32M
innodb_log_file_size = 128M
innodb_flush_method = O_DIRECT
#####################
thread_concurrency = 32
long_query_time= 2
slow-query-log = on
slow-query-log-file = /usr/local/mysql/logs/mysql-slow.log
[mysqldump]
quick
max_allowed_packet = 32M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
配置mysql
# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
# service mysql start
# chkconfig mysql on
# /usr/local/mysql/bin/mysql_secure_installation
将root用户密码修改为root # mysql -uroot -proot
>use mysql;
>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
>flush privileges;
>exit; # ln -s /usr/local/mysql/mysql.sock /tmp/mysql.sock
Centos6.5 下安装配置Apache+PHP+Mysql环境的更多相关文章
- Windows下安装配置Apache+PHP+Mysql环境
1.下载相关安装包 Apache下载: http://archive.apache.org/dist/httpd/binaries/win32/ ,选择httpd-2.2.25-win32-x86-n ...
- CentOS6.5下安装配置MySQL
CentOS6.5下安装配置MySQL,配置方法如下: 安装mysql数据库:# yum install -y mysql-server mysql mysql-deve 查看mysql-server ...
- Centos7安装配置Apache+PHP+Mysql+phpmyadmin
转载自: Centos7安装配置Apache+PHP+Mysql+phpmyadmin 一.安装Apache yum install httpd 安装成功后,Apache操作命令: systemctl ...
- 【转载】CentOS6.5_X64下安装配置MongoDB数据库
[转载]CentOS6.5_X64下安装配置MongoDB数据库 2014-05-16 10:07:09| 分类: 默认分类|举报|字号 订阅 下载LOFTER客户端 本文转载自zhm&l ...
- Linux下安装配置与使用MySQL数据库
Linux下安装配置与使用MySQL数据库 在Linux下安装做开发时往往少不了要使用到MySQL数据库,下面就Linux系统为例讲解一下,如何安装MySQL数据库,如何启用/停.止MySQL服务,如 ...
- Ubuntu 15.04 安装配置Apache和mysql的方法
前 言 上篇海面特效的博文结尾提到了SideFX开发的HQueue分布式集群,配置HQueue首先需要安装mysql,所以今天先分享一下如何在Ubuntu系统中安装mysql和Apache: Ubun ...
- centos6.7下安装配置vnc
vnc是一款使用广泛的服务器管理软件,可以实现图形化管理,下面简单介绍一下如何在centos6.7下安装vnc. 1.安装vncserver yum install tigervnc tigervnc ...
- CentOS6.5下安装配置MySQL数据库
一.MySQL简介 说到数据库,我们大多想到的是关系型数据库,比如MySQL.Oracle.SQLServer等等,这些数据库软件在Windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...
- CentOS6.2下安装配置MySql
转自:Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置 如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.ecli ...
随机推荐
- spring效验
相关依赖 如果开发普通 Java 程序的的话,你需要可能需要像下面这样依赖: <dependency> <groupId>org.hibernate.validator< ...
- Python基础总结之初步认识---class类(中)。第十四天开始(新手可相互督促)
昨天简单的认识类怎么定义,什么是类,类如何调用.今天的笔记会大概补充一些内容,明天的笔记会细致讲解,加深个印象即可 今天我们在了解下:类的属性,类属性属于类也属于实例化对象.也就是说类的实例化对象可以 ...
- SQLite进阶-17.视图
目录 视图(View) 操作视图 更新视图 删除视图 查看所有的视图 视图(View) 视图是一个预定义的SQLite查询的形式存在的表的组合. 可以包含一个表的所有行或从一个或多个表选定行.可以从一 ...
- MS SQL 2012表分区
最近开发一个手机用户统计平台,因为涉及到数据庞大,不得不以一周为单位对统计报表进行分区,所以记录一下,方便以后查看 第一步创建文件分组 对于文件分组共创建了14个,从 xy_group_2014102 ...
- hdu 3549 初试最大流问题
Flow Problem Time Limit: 5000/5000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Tota ...
- mysql replace substring 字符串截取处理
SELECT a1,a2,replace(a2, "豫ICP备16006180号-", "") a22,a3,a4,a5 FROM `aaab` order b ...
- RabbitMq 开始<一>
power shell 执行: dotnet new console --name Send mv Send/Program.cs Send/Send.cs dotnet new console -- ...
- jQuery Validation ,调用valid方法时,不验证remote
1.问题描述 model代码如下: remote对应的action如下: view代码如下: 单击按钮时,执行如下动作 当点击按钮时,我们发现,虽然后台action验证失败,但 还是执行返回true, ...
- redis 命令行操作报错
向redis集群写数据抛异常:(error) MOVED 15342 2001:fecc:0:616::34:6383 原因是启动redis-cli时未以集群方式启动,即后面要加上 -c redis- ...
- 安卓开发之获取SD卡空间数据
package com.lidaochen.getsdcardspace; import android.os.Environment; import android.support.v7.app.A ...