Linux 安装 LAMP

10 篇文章 0 订阅

Linux 安装 LAMP

标签(空格分隔): linux-mysql


虽然mysql官网提供的很多种安装方式,但是我个人还是建议使用这种,这种性能更好,采用yum命令或者apt-get命令安装 不方便更好的管理mysql服务器。

1、下载mysql安装包 到 /usr/local/src

下载地址: http://dev.mysql.com/downloads/mysql/5.5.html#downloads
http://cdn.mysql.com//Downloads/MySQL-5.5/mysql-5.5.51-linux2.6-x86_64.tar.gz

2、解压安装包

tar -zxvf mysql-5.5.51-linux2.6-x86_64.tar.gz

3、移动并重命名

mv mysql-5.5.51-linux2.6-x86_64 /usr/local/mysql

4、创建不能登录的mysql账号

useradd -s /bin/nologin -M mysql

5、安装mysql

mkdir -pv /data/mysql
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql

6、拷贝my-large.cnf 到 /etc/my.cnf

cp support-files/my-large.cnf /etc/my.cnf

7、复制 mysql.server 到 /etc/init.d/mysqld 文件

 cp support-files/mysql.server /etc/init.d/mysqld

8、添加到系统进程,设置开机启动

chmod 755 /etc/init.d/mysqld
 chkconfig --add mysqld
 chkconfig mysqld on

9、修改mysqld文件

basedir=/usr/local/mysql
datadir=/data/mysql

10、启动mysql

service mysqld start

二、安装apache

说明

安装apache需要安装 apr和apr-util

下载安装 apr 和apr-util

下载地址: http://apr.apache.org/download.cgi
编译: apr
./configure –prefix=/usr/local/apr/
make & make install
编译 : apr-util
./configure –prefix=/usr/local/apr-util/ –with-apr=/usr/local/apr/
make & make install

下载编译apache

下载地址 http://mirrors.cnnic.cn/apache/httpd/
编译:
./configure –prefix=/usr/local/httpd –with-included-apr –enable-so –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared –with-pcre –with-apr=/usr/local/apr/ –with-apr-util=/usr/local/apr-util/

make & make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值