1. 程式人生 > >九周第五次課(2月27日)

九周第五次課(2月27日)

linux

九周第五次課(2月27日)
11.6 MariaDB安裝

技術分享圖片


cd /usr/local/src

wget 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/maridb

cd /usr/local/mariadb

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

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

vi /usr/local/mariadb/my.cnf 定義basedir和datadir
basedir=/usr/local/mariadb
datadir=/data/mariadb

cp support-files/mysql.server /etc/init.d/mariadb 拷貝啟動腳本

vim /etc/init.d/mariadb 定義basedir,datadir,conf以及啟動參數
basedir=/usr/local/mariadb

datadir=/data/mariadb
conf=$basedir/my.cnf
在啟動命令語句中添加--defaults-file="$conf"

技術分享圖片




11.7/11.8/11.9 Apache安裝

技術分享圖片

下載解壓
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-1.6.3.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
tar zxvf httpd-2.4.29.tar.gz


tar zxvf apr-1.6.3.tar.gz
tar zxvf apr-util-1.5.4.tar.gz

安裝

cd /usr/local/src/apr-1.6.3

./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

/usr/local/apache2.4/bin/httpd -M 查看加載的模塊

/usr/local/apache2.4/bin/apachectl start 啟動httpd服務

ps aux|grep httpd 查看httpd進程

netstat -lntp 查看httpd監聽的端口



擴展
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


九周第五次課(2月27日)