天天看點

MariaDB安裝、Apache安裝

MariaDB安裝

1、[root@centos7 package]# tar xf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz 

2、

mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb

cd /usr/local/mariadb

useradd mysql && mkdir /data/mariadb

./scripts/mysql_install_db --user=mysql --datadir=/data/mariadb

echo $?

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

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

vi /etc/my.cnf

    #新增配置

    basedir=/usr/local/mariadb

    datadir=/data/mariadb

vi /etc/init.d/mariadb   

   #新增配置

    conf=/etc/my.cnf

$bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &

<a href="https://s2.51cto.com/oss/201711/08/21e9c368433428125cc8507074c083ac.png-wh_500x0-wm_3-wmp_4-s_839277177.png" target="_blank"></a>

/etc/init.d/mariadb start

[root@centos7 mariadb]# ps -ef | grep mysqld

root       3426      1  0 13:47 ?        00:00:00 /bin/sh /usr/local/mariadb/bin/mysqld_safe --defaults-file=/etc/my.cnf --datadir=/data/mariadb --pid-file=/data/mariadb/centos7.pid

mysql      3548   3426  0 13:47 ?        00:00:00 /usr/local/mariadb/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mariadb --datadir=/data/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --user=mysql --log-error=/data/mariadb/centos7.err --pid-file=/data/mariadb/centos7.pid --socket=/tmp/mysql.sock --port=3306

Apache安裝

    Apache是一個基金會的名字,httpd才是我們要安裝的軟體包,早期它的名字就叫apache。httpd使用一個通用函數庫Apr和apr-util,它讓httpd可以不關心底層的作業系統平台,可以很友善地移植(從linux移植到windows)。Apache官網 www.apache.org 

下載下傳:

1、wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.29.tar.gz

2、wget http://mirrors.hust.edu.cn/apache/apr/apr-1.6.3.tar.gz

3、wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.6.1.tar.gz

4、

[root@centos7 package]# tar xf httpd-2.4.29.tar.gz 

[root@centos7 package]# tar xf apr-1.6.3.tar.gz 

[root@centos7 package]# tar xf apr-util-1.6.1.tar.gz

5、安裝arp包

yum install -y gcc*

yum install gcc

cd apr-1.6.3

./configure --prefix=/usr/local/apr

yum -y install expat-devel

make &amp;&amp; make install

6、安裝arp-util

cd ../apr-util-1.6.1

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

7、安裝httpd

cd httpd-2.4.29

yum install -y pcre-devel

./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most

8、安裝成功

9、目錄結構

[root@centos7 apache2.4]# ls

bin  build  cgi-bin  conf  error  htdocs  icons  include  logs  man  manual  modules

bin:可執行檔案目錄

conf:配置檔案

htdocs:主目錄(存放網頁)

modules:模闆目錄

10、檢視模闆:

[root@centos7 apache2.4]# /usr/local/apache2.4/bin/httpd -M

11、啟動:

[root@centos7 bin]# /usr/local/apache2.4/bin/apachectl start

[root@centos7 apache2.4]# ps -ef | grep httpd

root      45047      1  0 20:16 ?        00:00:00 /usr/local/apache2.4/bin/httpd -k start

daemon    45048  45047  0 20:16 ?        00:00:00 /usr/local/apache2.4/bin/httpd -k start

daemon    45049  45047  0 20:16 ?        00:00:00 /usr/local/apache2.4/bin/httpd -k start

daemon    45050  45047  0 20:16 ?        00:00:00 /usr/local/apache2.4/bin/httpd -k start

daemon    45051  45047  0 20:16 ?        00:00:00 /usr/local/apache2.4/bin/httpd -k start

daemon    45052  45047  0 20:16 ?        00:00:00 /usr/local/apache2.4/bin/httpd -k start

root      45055  17686  1 20:16 pts/0    00:00:00 grep --color=auto httpd

本文轉自方向對了,就不怕路遠了!51CTO部落格,原文連結:http://blog.51cto.com/jacksoner/1979957 ,如需轉載請自行聯系原作者