文档章节

Mariadb二进制包安装,Apache安装

野雪球
 野雪球
发布于 11/13 04:40
字数 1749
阅读 26
收藏 2

安装mariadb

  • 下载二进制包并解压
[root@test-a 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
[root@test-a src]# tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz
  • 移动目录到/usr/local/目录下并重命名为mariadb,进入该目录
[root@test-a src]# mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
[root@test-a src]# cd /usr/local/mariadb
  • 初始化数据库
[root@test-a mariadb]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mariadb
WARNING: The host 'test-a' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MariaDB version. The MariaDB daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MariaDB privileges !
Installing MariaDB/MySQL system tables in '/data/mariadb' ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'./bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h test-a password 'new-password'

Alternatively you can run:
'./bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/data/mariadb'

You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

  • 拷贝模板配置文件,启动脚本,进行相应的修改
[root@test-a mariadb]# cp support-files/my-small.cnf my.cnf # 上一篇安装MySQL使用的默认配置文件,这里正好可以试试非默认配置文件的安装
[root@test-a mariadb]# cp support-files/mysql.server /etc/init.d/mariadb
[root@test-a mariadb]# vim /etc/init.d/mariadb
# 找到位置'basedir=',然后更改如下
basedir=/usr/local/mariadb
datadir=/data/mariadb
conf=/usr/local/mariadb/my.cnf
# 再往下找到 $bindir/mysqld_safe,添加启动配置项--defaults-file="$conf"
 $bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &

  • 启动maraidb
[root@test-a mariadb]# /etc/init.d/mariadb start
Starting mariadb (via systemctl):  Warning: Unit file of mariadb.service changed on disk, 'systemctl daemon-reload' recommended.
                                                           [  OK  ]
[root@test-a mariadb]# echo $?
0
[root@test-a mariadb]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1947/master
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1110/sshd
tcp        0     64 192.168.77.134:22       192.168.77.1:11679      ESTABLISHED 2354/sshd: root@pts
tcp        0      0 192.168.77.134:22       192.168.77.1:11716      ESTABLISHED 2515/sshd: root@pts
tcp6       0      0 ::1:25                  :::*                    LISTEN      1947/master
tcp6       0      0 :::3306                 :::*                    LISTEN      4388/mysqld
tcp6       0      0 :::22                   :::*                    LISTEN      1110/sshd

安装Apache

Apache是一个基金会的名字,httpd才是要安装的软件包,早期它的名字就叫apache
Apache官网 www.apache.org
apr和apr-util是一个通用的函数库,它让httpd可以不关心底层的操作系统平台,可以很方便地移植(从Linux移植到Windows)

  • 下载相关的安装包并解压
[root@test-a src]# wget https://mirrors.aliyun.com/apache/httpd/httpd-2.4.37.tar.gz
[root@test-a src]# wget http://mirrors.cnnic.cn/apache/apr/apr-1.6.5.tar.gz
[root@test-a src]# wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.gz

[root@test-a src]# tar -zxvf apr-1.6.5.tar.gz
[root@test-a src]# tar zvxf apr-util-1.6.1.tar.gz
[root@test-a src]# tar zxvf httpd-2.4.37.tar.gz  

  • 编译安装
# 安装apr
[root@test-a src]# cd apr-1.6.5/
[root@test-a apr-1.6.5]# ./configure
[root@test-a apr-1.6.5]# make && make install

# 安装apr-util
[root@test-a apr-1.6.5]# cd ../apr-util-1.6.1/
[root@test-a apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@test-a apr-1.6.5]# make && make install
...
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
 #include <expat.h>
                   ^
compilation terminated.
make[1]: *** [xml/apr_xml.lo] Error 1
make[1]: Leaving directory `/usr/local/src/apr-util-1.6.1'
make: *** [all-recursive] Error 1
# 出现错误,yum install expat-devel 解决
[root@test-a apr-util-1.6.1]# yum install expat-devel
[root@test-a apr-1.6.5]# make && make install

# 安装apache
[root@test-a httpd-2.4.37]# cd ../httpd-2.4.37/
[root@test-a httpd-2.4.37]# ./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
...
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
# 报错,也是缺少库,搜索安装解决
[root@test-a httpd-2.4.37]# yum list | grep pcre
pcre.x86_64                              8.32-12.el7                   @anaconda
ghc-pcre-light.x86_64                    0.4-13.el7                    epel
ghc-pcre-light-devel.x86_64              0.4-13.el7                    epel
mingw32-pcre.noarch                      8.38-1.el7                    epel
mingw32-pcre-static.noarch               8.38-1.el7                    epel
mingw64-pcre.noarch                      8.38-1.el7                    epel
mingw64-pcre-static.noarch               8.38-1.el7                    epel
pcre.i686                                8.32-17.el7                   base
pcre.x86_64                              8.32-17.el7                   base
pcre-devel.i686                          8.32-17.el7                   base
pcre-devel.x86_64                        8.32-17.el7                   base
pcre-static.i686                         8.32-17.el7                   base
pcre-static.x86_64                       8.32-17.el7                   base
pcre-tools.x86_64                        8.32-17.el7                   base
pcre2.i686                               10.23-2.el7                   base
pcre2.x86_64                             10.23-2.el7                   base
pcre2-devel.i686                         10.23-2.el7                   base
pcre2-devel.x86_64                       10.23-2.el7                   base
pcre2-static.i686                        10.23-2.el7                   base
pcre2-static.x86_64                      10.23-2.el7                   base
pcre2-tools.x86_64                       10.23-2.el7                   base
pcre2-utf16.i686                         10.23-2.el7                   base
pcre2-utf16.x86_64                       10.23-2.el7                   base
pcre2-utf32.i686                         10.23-2.el7                   base
pcre2-utf32.x86_64                       10.23-2.el7                   base
[root@test-a httpd-2.4.37]# yum install -y pcre-devel
[root@test-a httpd-2.4.37]# ./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
...
/usr/local/apr/build-1/libtool --silent --mode=link gcc -std=gnu99  -g -O2 -pthread         -o htpasswd  htpasswd.lo passwd_common.lo       /usr/local/apr-util/lib/libaprutil-1.la /usr/local/apr/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl -lcrypt
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserCreate'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserFree'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetUserData'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_Parse'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ErrorString'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetElementHandler'
collect2: error: ld returned 1 exit status
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.37/support'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.37/support'
make: *** [all-recursive] Error 1
# 又报错。上网找资料“缺少了xml相关的库,需要安装libxml2-devel包。直接安装并不能解决问题,因为httpd调用的apr-util已经安装好了,但是apr-util并没有libxml2-devel包支持。” (来源: https://my.oschina.net/LuCastiel/blog/1590706)  

[root@test-a httpd-2.4.37]# cd ../apr-util-1.6.1/
[root@test-a apr-util-1.6.1]# make clean
[root@test-a apr-util-1.6.1]# yum install -y libxml2-devel
[root@test-a apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@test-a apr-util-1.6.1]# make && make install
[root@test-a apr-util-1.6.1]# cd ../httpd-2.4.37
[root@test-a httpd-2.4.37]# make clean
[root@test-a httpd-2.4.37]# ./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
[root@test-a httpd-2.4.37]# make
[root@test-a httpd-2.4.37]# make install
  • 查看apache已经加载的模块
[root@test-a httpd-2.4.37]# /usr/local/apache2.4/bin/httpd -M
AH00557: httpd: apr_sockaddr_info_get() failed for test-a
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. 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)
  • 启动
[root@test-a httpd-2.4.37]# /usr/local/apache2.4/bin/apachectl start
[root@test-a httpd-2.4.37]# ps -aux|grep httpd
root     48045  0.4  0.2  75792  2388 ?        Ss   12:36   0:00 /usr/local/apache2.4/bin/httpd -k start
daemon   48046  0.2  0.4 364756  4260 ?        Sl   12:36   0:00 /usr/local/apache2.4/bin/httpd -k start
daemon   48065  0.7  0.4 364756  4260 ?        Sl   12:36   0:00 /usr/local/apache2.4/bin/httpd -k start
daemon   48087  0.5  0.4 364756  4264 ?        Sl   12:36   0:00 /usr/local/apache2.4/bin/httpd -k start
root     48136  0.0  0.0 112704   972 pts/0    S+   12:37   0:00 grep --color=auto httpd
[root@test-a httpd-2.4.37]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1947/master
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1110/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1947/master
tcp6       0      0 :::3306                 :::*                    LISTEN      4627/mysqld
tcp6       0      0 :::80                   :::*                    LISTEN      48045/httpd
tcp6       0      0 :::22                   :::*                    LISTEN      1110/sshd

© 著作权归作者所有

共有 人打赏支持
野雪球
粉丝 7
博文 62
码字总数 69977
作品 0
贵阳
私信 提问
安装mariadb、安装Apache

安装mariadb 安装mariadb的步骤与安装mysql的一样 下载二进制源码包 再用tar 解压,创建/data/mariadb目录和用户 初始化 编译启动脚本 启动 安装Apache Apache是软件基金会的名字,软件的名字...

黄昏残影
07/31
0
0
MariaDB安装-Apache安装

安装mariadb:(二进制免编译方式) cd /usr/local/src wget https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc214-x8664/mariadb-10.2.6-linux-glibc214-x8664.ta......

ZHENG-JY
07/30
0
0
LAMP架构mariadb/apache的安装及基本使用

11月12日任务 11.6 MariaDB安装 11.7/11.8/11.9 Apache安装 MariaDB安装(类似于mysql安装) https://downloads.mariadb.com/MariaDB/mariadb-10.2.6/bintar-linux-glibc214-x8664/mariadb-10......

robertt15
11/12
0
0
(二)、MariaDB、Apache软件安装

概述 上一篇文章我们了解了一些关于LAMP的知识,其中还学到了关于MySQL的安装,本文将要讲的是与MySQL类似的MariaDB软件的安装。在构建lamp的时候选择其中一个安装就行了 数据库已经安装好了...

杉下
07/28
0
0
38.Maria安装 Apache安装

11.6 MariaDB安装 11.7/11.8/11.9 Apache安装 扩展 apache dso https://yq.aliyun.com/articles/6298 apache apxs http://man.chinaunix.net/newsoft/ApacheMenualCN2.2new/programs/apxs.h......

王鑫linux
07/31
0
0

没有更多内容

加载失败,请刷新页面

加载更多

OSChina 周三乱弹 —— 有一天考拉麻麻拉肚子了

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @瘟神灬念 :分享周汇洋的单曲《Man Srae(曼斯拉之舞)》:美滋滋。。。。 手机党少年们想听歌,请使劲儿戳(这里) 我听了一下 赶紧关了, ...

小小编辑
47分钟前
17
4
oh-my-zsh 自定义

GitHub 地址 基于 oh-my-zsh 的自定义配置,增加了一些个人常用插件与皮肤。 采用的是 git submodule 来维护,包括 oh-my-zsh,之所以这么搞,主要是手头有多台 linux 需要维护, 每台机器、...

郁也风
今天
6
0
Docker安装踩坑:E_FAIL 0x80004005的解决

参考 菜鸟教程--Windows Docker 安装 http://www.runoob.com/docker/windows-docker-install.html 官方文档-Install Docker Toolbox on Windows https://docs.docker.com/toolbox/toolbox_in......

karma123
今天
6
0
js垃圾回收机制和引起内存泄漏的操作

JS的垃圾回收机制了解吗? Js具有自动垃圾回收机制。垃圾收集器会按照固定的时间间隔周期性的执行。 JS中最常见的垃圾回收方式是标记清除。 工作原理:是当变量进入环境时,将这个变量标记为“...

Jack088
昨天
18
0
大数据教程(10.1)倒排索引建立

前面博主介绍了sql中join功能的大数据实现,本节将继续为小伙伴们分享倒排索引的建立。 一、需求 在很多项目中,我们需要对我们的文档建立索引(如:论坛帖子);我们需要记录某个词在各个文...

em_aaron
昨天
27
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部