2018-04-10 Linux学习

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2018-04-10 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" "[email protected]" & 
/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

    [[email protected] 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学习的主要内容,如果未能解决你的问题,请参考以下文章

2018-04-10 《鸟哥的Linux私房菜 基础学习篇(第四版)》 下载方式

2018-04-10 自定义Linux快捷键

linux学习:Nginx--常见功能配置片段与优化-06

小米 2018.04.10 春招AK 代码

向Linus学习,让代码具有good taste

[linux][c/c++]代码片段01