MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL受权许可 MariaDB的目的是彻底兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。在存储引擎方面,使用XtraDB(英语:XtraDB)来代替MySQL的InnoDB。 MariaDB由MySQL的创始人Michael Widenius(英语:Michael Widenius)主导开发,他早前曾以10亿美圆的价格,将本身建立的公司MySQL AB卖给了SUN,此后,随着SUN被甲骨文收购,MySQL的全部权也落入Oracle的手中。MariaDB名称来自Michael Widenius的女儿Maria的名字。mysql
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mariadb/ --datadir=/data/mariadb
执行该命令初始化,初始化完成后执行echo $? 来验证初始化是否成功。cp support-files/my-small.cnf /usr/local/mariadb/my.cnf
有好几个配置文件,small huge large 等,根据实际内存大小选择配置文件。 须要指定datadir不然它在启动的时候回自动去找/data/mysql[mysqld] datadir=/data/mariadb
cp support-files/mysql.server /etc/init.d/mariadb
而后编辑/etc/init.d/mariadb ,由于咱们的配置文件并非/etc/my.cnf因此在启动脚本中须要修改几个地方basedir=/usr/local/mariadb datadir=/data/mariadb conf=$dasedir/my.cnf
$bindir/mysqld_safe --defaults-file=$conf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" & --defaults-file=$conf是咱们添加的内容
[root@llll ~]# /etc/init.d/mariadb start Starting mariadb (via systemctl): [ 肯定 ] [root@llll ~]# ps aux |grep mariadb root 2467 0.0 0.0 115436 1768 ? S 12:03 0:00 /bin/sh /usr/local/mariadb/bin/mysqld_safe --defaults-file=/usr/local/mariadb/my.cnf --datadir=/data/mariadb --pid-file=/data/mariadb/llll.pid mysql 2586 0.1 1.7 1649864 66572 ? Sl 12:03 0:03 /usr/local/mariadb/bin/mysqld --defaults-file=/usr/local/mariadb/my.cnf --basedir=/usr/local/mariadb --datadir=/data/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --user=mysql --log-error=/data/mariadb/llll.err --pid-file=/data/mariadb/llll.pid --socket=/tmp/mysql.sock --port=3306 root 2671 0.0 0.0 112724 972 pts/0 S+ 12:39 0:00 grep --color=auto mariadb
[root@llll ~]# chkconfig --add mariadb [root@llll ~]# chkconfig 注意:该输出结果只显示 SysV 服务,并不包含原生 systemd 服务。SysV 配置数据可能被原生 systemd 配置覆盖。 若是您想列出 systemd 服务,请执行 'systemctl list-unit-files'。 欲查看对特定 target 启用的服务请执行 'systemctl list-dependencies [target]'。 iprdump 0:关 1:关 2:开 3:开 4:开 5:开 6:关 iprinit 0:关 1:关 2:开 3:开 4:开 5:开 6:关 iprupdate 0:关 1:关 2:开 3:开 4:开 5:开 6:关 mariadb 0:关 1:关 2:开 3:开 4:开 5:开 6:关 netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关 network 0:关 1:关 2:开 3:关 4:关 5:开 6:关
到这里mariadb就安装并启动了。linux
Apache HTTP Server(简称Apache)是Apache软件基金会的一个开放源码的网页服务器,能够在大多数计算机操做系统中运行,因为其多平台和安全性被普遍使用,是最流行的Web服务器端软件之一。它快速、可靠而且可经过简单的API扩展,将Perl/Python等解释器编译到服务器中。 apr和apr-util是一个通用的函数库,它让httpd能够不关心底层的操做系统平台,能够很方便的移植(从Linux移植到Windows)sql
wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.34.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.2.tar.gz
wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
tar zxvf httpd-2.4.34.tar.gz
make && make install
命令直接安装,安装完以后一样可使用echo $? 验证 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
编译apr-util时须要指定apr的安装路径 --with-apr= 编译完成后验证echo $?。xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录 #include <expat.h> ^ 编译中断。 make[1]: *** [xml/apr_xml.lo] 错误 1 make[1]: 离开目录“/usr/local/src/apr-util-1.6.1” make: *** [all-recursive] 错误 1
而后在make && make install 就能够了。数据库
cd httpd-2.4.34
./configure\ --prefix=/usr/local/apache2.4 \ --with-apr=/usr/local/apr\ --with-apr-util=/usr/local/apr-util/ \ --enable-so --enable-mods-shared=most
其中with-apr 和with-apr-util是Apache依赖这两个包,须要指定 --enable-so是让Apache能支持动态扩展模块 --enable-mods-shared=most 是让它能支持绝大多数的动态模块make[2]: *** [htpasswd] 错误 1
解决这个问题可使用以下办法:express
# cd /usr/local/src/ # cp -r apr-1.6.3 /usr/local/src/httpd-2.4.33/srclib/apr # cp -r apr-util-1.6.1 /usr/local/src/httpd-2.4.33/srclib/apr-util
./configure --prefix=/usr/local/apache2.4 --with-included-apr --with-included-apr-util --enable-so --enable-mods-shared=most
[root@llll httpd-2.4.34]# ls /usr/local/apache2.4/modules/ httpd.exp mod_authn_dbm.so mod_buffer.so mod_expires.so mod_log_config.so mod_proxy_fdpass.so mod_request.so mod_speling.so mod_access_compat.so mod_authn_file.so mod_cache_disk.so mod_ext_filter.so mod_log_debug.so mod_proxy_ftp.so mod_rewrite.so mod_status.so mod_actions.so mod_authn_socache.so mod_cache.so mod_file_cache.so mod_logio.so mod_proxy_hcheck.so mod_sed.so mod_substitute.so mod_alias.so mod_authz_core.so mod_cache_socache.so mod_filter.so mod_macro.so mod_proxy_http.so mod_session_cookie.so mod_unique_id.so mod_allowmethods.so mod_authz_dbd.so mod_cgid.so mod_headers.so mod_mime.so mod_proxy_scgi.so mod_session_dbd.so mod_unixd.so mod_auth_basic.so mod_authz_dbm.so mod_dav_fs.so mod_include.so mod_negotiation.so mod_proxy.so mod_session.so mod_userdir.so mod_auth_digest.so mod_authz_groupfile.so mod_dav.so mod_info.so mod_proxy_ajp.so mod_proxy_uwsgi.so mod_setenvif.so mod_version.so mod_auth_form.so mod_authz_host.so mod_dbd.so mod_lbmethod_bybusyness.so mod_proxy_balancer.so mod_proxy_wstunnel.so mod_slotmem_shm.so mod_vhost_alias.so mod_authn_anon.so mod_authz_owner.so mod_dir.so mod_lbmethod_byrequests.so mod_proxy_connect.so mod_ratelimit.so mod_socache_dbm.so mod_watchdog.so mod_authn_core.so mod_authz_user.so mod_dumpio.so mod_lbmethod_bytraffic.so mod_proxy_express.so mod_remoteip.so mod_socache_memcache.so mod_authn_dbd.so mod_autoindex.so mod_env.so mod_lbmethod_heartbeat.so mod_proxy_fcgi.so mod_reqtimeout.so mod_socache_shmcb.so
[root@llll httpd-2.4.34]# /usr/local/apache2.4/bin/httpd -M AH00557: httpd: apr_sockaddr_info_get() failed for llll 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) static这种是绑定在/usr/local/apache2.4/bin/httpd当中的 so_module (static) http_module (static) mpm_event_module (static) authn_file_module (shared) shared是扩展模块,就是上面.so结尾的文件 authn_core_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_core_module (shared) access_compat_module (shared)
[root@llll ~]# /usr/local/apache2.4/bin/apachectl start AH00557: httpd: apr_sockaddr_info_get() failed for llll 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
[root@llll ~]# ps aux |grep httpd root 48904 0.1 0.0 75716 2292 ? Ss 14:27 0:00 /usr/local/apache2.4/bin/httpd -k start daemon 48905 0.0 0.1 364680 4284 ? Sl 14:27 0:00 /usr/local/apache2.4/bin/httpd -k start daemon 48906 0.0 0.1 364680 4288 ? Sl 14:27 0:00 /usr/local/apache2.4/bin/httpd -k start daemon 48907 0.0 0.1 364680 4284 ? Sl 14:27 0:00 /usr/local/apache2.4/bin/httpd -k start root 48991 0.0 0.0 112720 968 pts/0 S+ 14:29 0:00 grep --color=auto httpd
[root@llll ~]# netstat -lntp 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 1576/master tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 995/sshd tcp6 0 0 ::1:25 :::* LISTEN 1576/master tcp6 0 0 :::3306 :::* LISTEN 2586/mysqld tcp6 0 0 :::80 :::* LISTEN 48904/httpd tcp6 0 0 :::22 :::* LISTEN 995/sshd