LAMP源码安装

1、安装准备

centos 6.5mini安装,挂载完整镜像为本地仓库

iptabes -F

挂载本地yum仓库

安装各种环境包

yum install  gcc* openssl-devel openssl* libX11* pcre*

yum install libxml2*  zlib* libpng*  freetype* autoconf* gd*  bison* ncurses*

libxml* libmcrypt* openssl*  libX11* cmake*


2、安装apace

./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite

 make

 make install   修改apache默认启动用户名


3、源码安装mysql5.6.14版本

groupadd mysql 

useradd -g mysql mysql创建mysqly用户


cmake \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DMYSQL_DATADIR=/usr/local/mysql/data \

-DSYSCONFDIR=/etc \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_MEMORY_STORAGE_ENGINE=1 \

-DWITH_READLINE=1 \

-DMYSQL_UNIX_ADDR=/tmp/mysql/mysql.sock \

-DMYSQL_TCP_PORT=3306 \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_PARTITION_STORAGE_ENGINE=1 \

-DEXTRA_CHARSETS=all \

-DEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci


make &&make install


4、安装完成后操作

groupadd mysql

useradd -r -g mysql mysql

cd /usr/local/mysql

chown -R mysql:mysql .

cd /usr/local/mysql/support-files

cp my-default.cnf /etc/my.cnf

cp mysql.server  /etc/init.d/mysqld

cd ..

./scripts/mysql_install_db --user=mysql  --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql

chown -R root .

chown -R mysql data


初始化报错 ./scripts/mysql_install_db  --user=mysql

[ERROR] COLLATION 'utf8_general_ci' is not valid for CHARACTER SET 'latin1'

在配置文件指定character_set_server=utf8 

启动报错,Starting MySQL...... ERROR! The server quit without updating PID file

在配置文件指定编译时的datadir=/usr/local/mysql/data 路径 或者删除hostname-bin.index


5、源码安装PHP 5.5.7版本

./configure --prefix=/usr/local/php 

--with-config-file-path=/usr/local/php/etc 

--with-apxs2=/usr/local/apache2/bin/apxs 

--with-mysql=/usr/local/mysql/  

--with-mysqli=/usr/local/mysql/bin/mysql_config  

--enable-soap  --enable-mbstring=all


配置PHP

vim /usr/local/apache2/conf/http.conf

AddType application/x-httpd-php .php                       

AddType application/x-httpd-php-source .phps

DirectoryIndex  index.php 添加主页

去主目录下创建index.php测试页面

<?php

phpinfo() 这是php测试网页的函数

?>


你可能感兴趣的:(mysql,lamp,仓库,用户名)