Centos6.5 源码安装LAMP
2015-05-10 16:12
302 查看
z开始安装之前卸载预装的httpd、MySQL、php。
root账户下执行rpm -qa|grep http rpm -qa|grep mysql rpm -qa|grep php,检查是否有预装的httpd、mysql、php。
执行rpm -e --nodeps 命令,卸载预装的软件。
准备工作:
yum install wget gcc gcc-c++
make re2c curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel
libpng libpng-devel libmcrypt libmcrypt-devel zlib zlib-devel
openssl openssl-devel freetype freetype-devel gd gd-devel
perl perl-devel ncurses ncurses-devel bison bison-devel
libtool gettext gettext-devel cmake bzip2 bzip2-devel pcre pcre-devel
tar zxvf apr-1.5.2.tar.gz
tar
zxvf apr-util-1.5.4.tar.gz
tar zxvf httpd-2.4.12.tar.gz
移动Apr、Apr-util到httpd的srclib文件夹下mv apr-1.5.2 httpd-2.4.12/srclib/apr mv apr-util-1.5.4 httpd-2.4.12/srclib/apr-util
进入httpd的目录
cd httpd-2.4.7
./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd--with-z--with-included-apr--enable-so--enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--enable-static-support--enable-authn-dbm=shared--enable-cache--enable-file-cache--enable-mem-cache--enable-disk-cache--enable-mods-shared=all--enable-ssl--enable-cgi
make && make instal
5. 添加环境变量
PATH=/usr/local/apache/bin:$PATH
export PATH
source /etc/profile
6. 重启Apache
service httpd start
添加开机启动 chkconfig httpd on
7. 安装MySQL
解压mysql-5.6.16.tar.gz,并进入mysql-t.6.16目录
执行cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_DATADIR=/data/mysql_data-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock-DSYSCONFDIR=/etc
-DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1
-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
编译并安装 make && make install
添加mysql用户
useradd -s /sbin/nologin mysql
赋予权限
chown-R
mysql:mysql/usr/local/mysql
mysql的安装目录
chown-R
mysql:mysql/usr/local/mysql/data 数据库目录
3.进入安装目录
cd /usr/local/mysql/scripts/
数据库初始化:
./mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
4、放置已存在的my.cnf影响数据库的安装
mv /etc/my.cnf/etc/my.cnf.old
cp /usr/local/mysql/my.cnf/etc/
5、赋值启动脚本
cp /usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
6、环境变量
PATH=/usr/local/mysql/bin:$PATH
export PATH
7、mysql初始化
mysql_secure_installation
8、安装php
tar zxvf php-5.5.6.tar.gz
cd php-5.5.6
./configure --prefix=/opt/php --with-config-file-path=/etc --enable-opcache --enable-fpm --with-fpm-user=kcsoft --with-fpm-group=kcsoft --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl
--enable-mbstring=all --with-iconv --with-mhash --with-mcrypt --with-gd --with-openssl --enable-sockets --with-gettext --with-zlib --enable-zip --enable-soap --with-apxs2=/opt/apache/bin/apxs --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir
--enable-ftp --with-xmlrpc
make && make install
环境变量
PATH=/opt/php/bin:$PATH
export PATH
cp
php-5.5.6/php.ini-production
/etc/php.ini
vi etc/httpd/httpd.conf
找到
AddType application/x-gzip.gz.tgz
添加AddType application/x-httpd-php.php
在DirectoryIndex index.html后面添加index.php
写phpinfo页面,进行测试。
root账户下执行rpm -qa|grep http rpm -qa|grep mysql rpm -qa|grep php,检查是否有预装的httpd、mysql、php。
执行rpm -e --nodeps 命令,卸载预装的软件。
准备工作:
yum install wget gcc gcc-c++
make re2c curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel
libpng libpng-devel libmcrypt libmcrypt-devel zlib zlib-devel
openssl openssl-devel freetype freetype-devel gd gd-devel
perl perl-devel ncurses ncurses-devel bison bison-devel
libtool gettext gettext-devel cmake bzip2 bzip2-devel pcre pcre-devel
tar zxvf apr-1.5.2.tar.gz
tar
zxvf apr-util-1.5.4.tar.gz
tar zxvf httpd-2.4.12.tar.gz
移动Apr、Apr-util到httpd的srclib文件夹下mv apr-1.5.2 httpd-2.4.12/srclib/apr mv apr-util-1.5.4 httpd-2.4.12/srclib/apr-util
进入httpd的目录
cd httpd-2.4.7
./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd--with-z--with-included-apr--enable-so--enable-deflate=shared--enable-expires=shared--enable-rewrite=shared--enable-static-support--enable-authn-dbm=shared--enable-cache--enable-file-cache--enable-mem-cache--enable-disk-cache--enable-mods-shared=all--enable-ssl--enable-cgi
make && make instal
5. 添加环境变量
PATH=/usr/local/apache/bin:$PATH
export PATH
source /etc/profile
6. 重启Apache
service httpd start
添加开机启动 chkconfig httpd on
7. 安装MySQL
解压mysql-5.6.16.tar.gz,并进入mysql-t.6.16目录
执行cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_DATADIR=/data/mysql_data-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock-DSYSCONFDIR=/etc
-DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1
-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
编译并安装 make && make install
添加mysql用户
useradd -s /sbin/nologin mysql
赋予权限
chown-R
mysql:mysql/usr/local/mysql
mysql的安装目录
chown-R
mysql:mysql/usr/local/mysql/data 数据库目录
3.进入安装目录
cd /usr/local/mysql/scripts/
数据库初始化:
./mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
4、放置已存在的my.cnf影响数据库的安装
mv /etc/my.cnf/etc/my.cnf.old
cp /usr/local/mysql/my.cnf/etc/
5、赋值启动脚本
cp /usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
6、环境变量
PATH=/usr/local/mysql/bin:$PATH
export PATH
7、mysql初始化
mysql_secure_installation
8、安装php
tar zxvf php-5.5.6.tar.gz
cd php-5.5.6
./configure --prefix=/opt/php --with-config-file-path=/etc --enable-opcache --enable-fpm --with-fpm-user=kcsoft --with-fpm-group=kcsoft --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl
--enable-mbstring=all --with-iconv --with-mhash --with-mcrypt --with-gd --with-openssl --enable-sockets --with-gettext --with-zlib --enable-zip --enable-soap --with-apxs2=/opt/apache/bin/apxs --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir
--enable-ftp --with-xmlrpc
make && make install
环境变量
PATH=/opt/php/bin:$PATH
export PATH
cp
php-5.5.6/php.ini-production
/etc/php.ini
vi etc/httpd/httpd.conf
找到
AddType application/x-gzip.gz.tgz
添加AddType application/x-httpd-php.php
在DirectoryIndex index.html后面添加index.php
写phpinfo页面,进行测试。
相关文章推荐
- Centos6.5 LAMP环境源码包安装与配置,附安装包百度网盘地址
- lamp 源码安装之 centos6.5源码安装之php5.6.9
- Centos6.5 LAMP环境源码包安装与配置,附安装包百度网盘地址 (转做笔记)
- CentOS 6.5 系统 LAMP(Apache+MySQL+PHP)源码安装步骤
- Centos6.5 源码安装LAMP
- LAMP 源码安装基于centos6.6
- CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境
- CentOS 6.5 + Nginx 1.8.0 + PHP 5.6(with PHP-FPM) 负载均衡源码安装 之 (一)Nginx安装篇
- Centos 5.5 Lamp源码包安装编译
- CentOS6.5安装LAMP环境的前期准备
- 【centos6.5】安装LAMP
- CentOS6.3下源码编译安装lamp环境
- CentOS6.5安装配置LAMP
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- CentOS 6.5源码安装Erlang教程
- CentOS 6下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- centos 6.5 安装配置LAMP(linux,apache,mysql,php)环境
- centos6.5 MariaDB-5.5.42源码编译安装
- centos7.3实现基于源码编译安装LAMP的wordpress应用
- CentOS 6.5 源码安装 mysql 5.6