1. 程式人生 > >安裝MariaDB和Apache

安裝MariaDB和Apache

安裝mariadb和apache

一、MariaDB安裝

cd /us./lacal/.src

wettps://downloads-maridb.com/MariaB/mariadb-10.2.6/bi narlinuxg ibc_2 14-x86_64/mariadb-10.2.6-linux-g ibc_214-x86_64.tar.gz

tar zxf mariadb-10.2.6-linux-glibc_214-x86_64.tar.

mv mariadb-10.2.6-i n uX-g ibc_214-x86_64/usr/lacal/mariad

cd /us/local/mariadb

./scripts/mysqLinstald -user=mysq! -basedir=/usr/lcal/mariadb/-datadir=/data/mariadb

cp support-files/my-small.cnf/uslcalmariadbmy

vi /usr/local/mariadb/my.cnf//定義basedirdatadir

cp support-files/mysqlseve /etc/init.d/mariadb

vim/etc/init.dmariadb//定義basedirdatadirconf以及啟動參數

/etc/init.d/mariadb start

二、Apache安裝

1.Apache是一個基金會的名字,httpd才是我們要安裝的軟件包,早期它的名字就叫apache

Apache官網www.apache.org

wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.25.tar.g

wget http://mirrors.hust.edu.cn/apache/a pr/a pr-1.5.2.tar.gz

wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.4.tar.gz

aprapr-utl是一個通用的函數庫,它讓httpd可以不關心底層的操作系統平臺,可以很方便地移植(inux移植到windows)

ta r ZXVf httpd-2.4.25.ta r.gz

tar zxvf apr-util-1.5.4.tar.gz

tar zxovf apr-1.5.2.tar.gz

cd /usr/local/src/apr-1.5.2

./configure -prefixz/usr/lacalapr

make && make install

2. cd /usr/local/src/apr-util-1.5.4

./configure "-prefix=/usr/local/apr:uti --with-apr=/us/local/apr

make && make install

cd /usr/local/src/httpd-2.4.25

./configure\ //這裏的反斜杠是脫義字符,加上它我們可以把一行命令寫成多行

--prefix=/usr/loca/apache2.4\

--with-apr=/usr/local/apr \

--with-apr:util=/usrAlocal/apr:uti \

--enable-so \

--enable-mods-shared=most

make && make install

ls /usr/loca/apache2.4/modul es

/usr/local/apache2.4/bn/htpd-M/查看加載的模塊


安裝MariaDB和Apache