20180524

5月24日任务
11.6 MariaDB安装
11.7/11.8/11.9 Apache安装
扩展
apache dso https://yq.aliyun.com/articles/6298
apache apxs http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/programs/apxs.html
apache工作模式 http://www.cnblogs.com/fnng/archive/2012/11/20/2779977.html

1. MariaDB安装

cd /usr/local/src
wget -c https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc_214-x86_64/mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
cd $!
useradd mysql
mkdir /data/
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb/ --datadir=/data/mariadb
echo $?

拷贝配置文件
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf

定义basedir, datadir
vim /usr/local/mariadb/my.cnf
[mysqld]部分
datadir = /data/mariadb

拷贝启动脚本
cp support-files/mysql.server /etc/init.d/mariadb
定义basedir, datadir, conf和启动参数
vim /etc/init.d/mariadb

basedir=/usr/local/mariadb
datadir=/data/mariadb
conf=$basedir/my.cnf

此处为防止与试验的mysql冲突, 单独定义了conf文件路径

启动处第300行改成:
$bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &

启动
/etc/init.d/mariadb start

启动不了尝试重启下机器

2. Apache安装

apr和apr-util是一个通用的函数库,它让httpd可以不关心底层的操作系统平台,可以很方便地移植(从linux移植到windows)

wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.gz
tar zxvf httpd-2.4.27.tar.gz
tar zxvf apr-util-1.5.4.tar.gz
tar zxvf apr-1.5.2.tar.gz
cd /usr/local/src/apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install

cd /usr/local/src/apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

cd /usr/local/src/httpd-2.4.29
./configure \
--prefix=/usr/local/apache2.4 \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--enable-so \
--enable-mods-shared=most
make && make install

ls /usr/local/apache2.4/modules 模块

查看加载的模块
/usr/local/apache2.4/bin/httpd -M/usr/local/apache2.4/bin/apachectl -M
static 静态模块: 直接编译进了http文件. shared: 扩展模块

启动
/usr/local/apache2.4/bin/apachectl start

Apache配置文件
vim /usr/local/apache2.4/conf/httpd.conf

未经允许不得转载:外贸SOHO笔记 » 20180524

赞 (0) 打赏

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下作者~

支付宝扫一扫打赏

微信扫一扫打赏