设为首页 收藏本站
查看: 1053|回复: 0

[经验分享] 11.6-11.9 MariaDB安装,Apache安装

[复制链接]
发表于 2018-11-17 13:21:46 | 显示全部楼层 |阅读模式
  11.6 Maria DB 安装
DSC0000.jpg

#cd /usr/local/src  下载mariadb 10.2.6 64位
#wget https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.14/bintar-linux-glibc_214-x86_64/mariadb-10.2.14-linux-glibc_214-x86_64.tar.gz  解压包
#tar zxvf mariadb-10.2.6-linux-glibc_214-x86_64.tar.gz  把解压了的目录移动并命名/usr/local/mariadb,因为要和mysql的目录区分。
mv mariadb-10.2.6-linux-glibc_214-x86_64 /usr/local/mariadb  检查以上输出结果
#echo $?  
0
  进入/usr/local/mariadb,并稍后进行初始化
  初始化命令,指定user(user都是mysql)以及datadir(datadir指定了的/data/mariadb会自动生成)
#cd /usr/local/mariadb  
# ./scripts/mysql_install_db --user=mysql  --datadir=/data/mariadb
  
[root@centos7-01 mariadb]# ls /data/mariadb/
  
aria_log.00000001  ib_buffer_pool  ib_logfile0  mysql               test
  
aria_log_control   ibdata1         ib_logfile1  performance_schema
  cp配置文件
cp support-files/my-small.cnf /usr/local/mariadb/my.cnf  修改和定义mysqld的basedir和datadir 这里一般保持默认即可
  #
vim /usr/local/mariadb/my.cnf
DSC0001.jpg

  cp启动脚本定义basedir和datadir
  #
cp support-files/mysql.server /etc/init.d/mariadb
DSC0002.jpg

vim /etc/init.d/mariadb #定义basedir、datadir、conf以及启动参数
DSC0003.jpg

  启动之前,先检查一下mysqld的进程有没有在开启,因为mysqld跟mariadb监听的端口是一样的,同时启动会发生冲突
[root@centos7-01 mariadb]# ps aux |grep mysqld  
root      4935  0.0  0.0 112676   984 pts/0    S+   17:26   0:00 grep --color=auto mysqld
  mysqld无启动,开启mariadb
/etc/init.d/mariadb start  
[root@centos7-01 mariadb]# /etc/init.d/mariadb start
  
Reloading systemd:                                         [  确定  ]
  
Starting mariadb (via systemctl):                              [  确定  ]
  
[root@centos7-01 mariadb]# echo $?
  
0
  检查进程及监听端口的状态,进程之所以显示mysqld是因为mariadb是mysqld的分支,所以很多名字进程有相关mysqld的字眼, 但最终看mariadb的关键信息。
DSC0004.jpg

  mysqld与mariadb的配置和用法大致都是一样的
  11.7-11.9 安装Apache
DSC0005.jpg

DSC0006.jpg

  Apache是一个基金会的名字,httpd才是我们要安装的软件包,早期它的名字就叫apache
  Apache官网www.apache.org
  分别下载 apr-1.6.3 apr-util 1.6.1 httpd-2.4.33
wget  http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz  
wget  http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2
  
wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.33.tar.gz
  apr和apr-util是一个通用的函数库,它让httpd可以不关心底层的操作系统平台,可很方便地移植(从linux移植到windows)
  它是靠函数来运行,无论系统平台是什么都不会影响。
  分别解压apr-1.6.3 apr-util 1.6.1 httpd-2.4.33
tar zxvf httpd-2.4.33.tar.gz  
tar jxvf apr-util-1.6.1.tar.bz2
  
ar zxvf apr-1.6.3.tar.gz
  首先安装apr
cd /usr/local/src/apr-1.6.3.tar.gz  
./configure --prefix=/usr/local/apr
  检查是否成功
echo $?  
0
make && make install  检查是否成功
echo $?  
0
  然后安装apr-util 1.6.1
cd /usr/local/src/apr-util-1.6.1  apr-util要依赖apr的路径
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr  
make && make install
  发现错误
DSC0007.jpg

  解决方法:
  缺少expat.h文件,yum安装:#yum install -y expat-devel;安装完成后,重新执行上面的命令!
  安装httpd-2.4
#cd /usr/local/src/httpd-2.4.33  安装参数
./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/lcal/apr-util --enable-so --enable-mods-shared=most  ./configure \   //这里的反斜杠是脱义字符,加上它我们可以把一行命令写成多行
  --prefix=/usr/local/apache2.4 \
  --with-apr=/usr/local/apr \
  --with-apr-util=/usr/local/apr-util \
  --enable-so \  支持动态扩展模块,apache php都支持以一个模块存在。
  --enable-mods-shared=most 支持大部分模块
  安装期间,出现报错信息,大致内容就是缺了某个包。
  利用#yum list 去追踪导致错误信息的包
yum list  
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
  再次编译,继续出错,继续排查安装包
./configure --prefix=/usr/local/apache2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/lcal/apr-util --enable-so --enable-mods-shared=most  
checking for chosen layout... Apache
  
checking for working mkdir -p... yes
  
checking for grep that handles long lines and -e... /usr/bin/grep
  
checking for egrep... /usr/bin/grep -E
  
checking build system type... x86_64-pc-linux-gnu
  
checking host system type... x86_64-pc-linux-gnu
  
checking target system type... x86_64-pc-linux-gnu
  
configure:
  
configure: Configuring Apache Portable Runtime library...
  
configure:
  
checking for APR... yes
  
  setting CC to "gcc"
  
  setting CPP to "gcc -E"
  
  setting CFLAGS to " -g -O2 -pthread"
  
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  
  setting LDFLAGS to " "
  
configure:
  
configure: Configuring Apache Portable Runtime Utility library...
  
configure:
  
checking for APR-util... configure: error: the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file.
  解决方法:
  # 安装libxml2-devel包  
  yum install -y libxml2-devel
  
  # 删除apr-util安装目录,并重新编译安装
  
  rm -rf /usr/local/apr-util
  
  cd /usr/local/src/apr-util-1.6.1
  
  # 这一步很重要,必须清除之前配置时的缓存
  
  make clean
  
  ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
  
  make && make install
  

  
  # 重新编译安装httpd
  
  cd /usr/local/src/httpd-2.4.29
  
  # 同样要清理之前的缓存十分重要
  
  make clean
  
  ./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
  利用一般devel就是库包,所以选择安装有关devel的包名安装。
  [root@Centos7-01 httpd-2.4.33]# yum list |grep -i pcre
  pcre-devel.x86_64                           8.32-17.el7                base
  再次./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  
ls /usr/local/apache2.4/modules
  /usr/local/apache2.4/bin/httpd -M //查看加载的模块
[root@DD-Server-9F ~]# /usr/local/apache2.4/bin/httpd -M  
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::2ad9:5a78:700c:eaee. 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)
  httpd简化版安装
  ####3 安装apache
  分别下载 apr-1.6.3 apr-util 1.6.1 httpd-2.4.33 到/usr/local/src/
  wget  http://mirrors.cnnic.cn/apache/apr/apr-1.6.3.tar.gz
  wget  http://mirrors.cnnic.cn/apache/apr/apr-util-1.6.1.tar.bz2
  wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.33.tar.gz
  首先安装apr
  cd /usr/local/src/apr-1.6.3
  ./configure --prefix=/usr/local/apr
  然后安装apr-util 1.6.1
  cd /usr/local/src/apr-util-1.6.1
  apr-util要依赖apr的路径
  ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
  make && make install
  安装httpd-2.4
  #cd /usr/local/src/httpd-2.4.33
  #./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



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-636268-1-1.html 上篇帖子: 三十八、MariaDB安装、Apache安装 下篇帖子: 5.Apache用户认证,域名跳转,访问日志
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表