1. 程式人生 > >2018-04-10 Linux學習

2018-04-10 Linux學習

Linux學習

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

    wget https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.13/bintar-linux-glibc_214-x86_64/mariadb-10.2.13-linux-glibc_214-x86_64.tar.gz

tar zxvf mariadb-10.2.13-linux-glibc_214-x86_64.tar.gz
mv mariadb-10.2.13-linux-glibc_214-x86_64 /usr/local/mariadb
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=/usr/local/mariadb/my.cnf
        (start部分添加  --defaults-file="$conf") 
            $bindir/mysql_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysql_pid_file_path" "$@" & 
/etc/init.d/mariadb start

11.7-8-9 Apache 安裝

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

官網: www.apache.org

wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.4.29.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.3.tar.gz
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz

備用下載地址
wget http://archive.apache.org/dist/apr/apr-1.5.0.tar.gz
wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz

apr 和 apr-util 是一個通用的函數庫,它讓httpd可以不關心底層的操作系統平臺,可以很方便的移植(從Linux到Windows)

tar zxvf httpd-2.4.29.tar.gz
tar zxvf apr-1.6.3.tar.gz
tar zxvf apr-util-1.6.1.tar.gz

cd /usr/local/src/apr-1.6.3
./configure --prefix=/usr/local/apr
make && make install

yum install expat-devel -y
yum install -y libxml2-devel

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

yum install -y pcre-devel

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

查看Apache加載了哪些模塊
/usr/local/apache2.4/bin/apachectl -M    //或者如下
/usr/local/apache2.4/bin/httpd -M

啟動
/usr/local/apache2.4/bin/apachectl start

    [root@aming-01 apache2.4]# /usr/local/apache2.4/bin/httpd -M
    AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using fe80::b869:44fc:d655:60b1. Set the ‘ServerName‘ directive globally to suppress this message
    Loaded Modules:
     core_module (static)
     so_module (static)
     http_module (static)
     mpm_event_module (static)
     authn_file_module (shared)
     authn_core_module (shared)
     authz_host_module (shared)
     authz_groupfile_module (shared)
     authz_user_module (shared)
     authz_core_module (shared)
     access_compat_module (shared)
     auth_basic_module (shared)
     reqtimeout_module (shared)
     filter_module (shared)
     mime_module (shared)
     log_config_module (shared)
     env_module (shared)
     headers_module (shared)
     setenvif_module (shared)
     version_module (shared)
     unixd_module (shared)
     status_module (shared)
     autoindex_module (shared)
     dir_module (shared)
     alias_module (shared)
     php5_module (shared)

2018-04-10 Linux學習