【澳门新萄京app】容器化的Apache服务并监察和控制,CentOS7下源码安装Apache2

作者: 计算机操作系统  发布:2019-10-20

4:页面验证apache监察和控制

澳门新萄京app 1

澳门新萄京app 2

 

踏向QQ群:317765580,大家黄金时代块上学啊!

澳门新萄京app 3

CentOS7下源码安装Apache2.4.9

1.预备条件

centos7最小化安装

yum安装wget、vim、gcc、gcc-c++、cmake

2.安装apache2.4.10

官网:

下载源码包:

cd /usr/loca/src

wget

下载apache组件apr、apr-util:

wget

安装apr和apr-util:

tar zxvf httpd-2.4.10-deps.tar.gz

cd httpd-2.4.10/srclib/apr

./configure --prefix=/usr/local/apr

make && make install

cd ../apr-util

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

下载安装zlib1.2.8

wget

tar zxvf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure --prefix=/usr/local/zlib

make && make install

下载安装pcre8.35

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.35.tar.gz

tar zxvf pcre-8.35.tar.gz

cd pcre-8.35

./configure --prefix=/usr/local/pcre

make && make install

下载openssl,安装apache2.4.9时提示openssl版本过低,centos7自带版本openssl1.0.1e:

wget

不卸载系统自带openssl,直接源码编写翻译openssl1.0.1h

tar zxvf openssl-1.0.1h.tar.gz

cd openssl-1.0.1h

./configure --prefix=/usr/local/openssl

make && make install

mv /usr/bin/openssl /usr/bin/openssl.1.0.1e

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

安装httpd2.4.9:

cd /usr/local/src

tar zxvf httpd-2.4.9.tar.gz

cd httpd-2.4.9

./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-cgi --enable-ssl --enable-rewrite --with-ssl=/usr/local/openssl --with-pcre=/usr/local/pcre --with-z=/usr/local/zlib --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl=/usr/local/openssl --enable-modules=most --enable-mpms-shared=all --with-mpm=event

centos7施用systemctl取代chkconfig管理服务,防火墙也由iptables改变来了firewalld

第豆蔻年华用systemctl关闭防火墙:

systemctl stop firewalld.service

systemctl disable firewalld.service

开启apache服务器:

cd /usr/local/apache/bin

./apachectl start

顾客端浏览器上输入地点:

见到页面显示It works!表明服务器已成功运维

除此以外因为安装Apache服务器是采用设置了支撑openssl,顺便讨论了须臾间怎么在apache中配备openssl

率先在/etc/httpd/http.conf文件中期维修改:

ServerName为www.example.com:80

去掉LoadModule ssl_module modules/mod_ssl.so前的#号

去掉LoadModule socache_shmcb_module modules/mod_socache_shmcb.so前的#号

去掉Include /etc/httpd/extra/httpd-ssl.conf前的#号

转移服务器证书:

1.生成服务器用的私钥文件server.key

openssl genrsa -out server.key 1024

2.生成未签订协议的server.csr

openssl req -new -key server.key -out server.csr

程序提醒输入一整整齐齐参数,满含国别、省名、市名。。。,依据提醒输入就能够

3.签订契约服务器证书文件server.crt

openssl req -x509 -days 365 -key server.key -in server.csr -out server.crt

接下来将扭转的server.key、server.csr、server.crt拷贝到/etc/httpd目录下

/usr/local/apache/bin/apachectl restart

浏览器访谈: works!,注解ssl模块已平常职业。


1.希图条件 centos7最小化安装 yum安装wget、vim、gcc、gcc-c++、cmake 2.设置apache2.4.10 官方网址: 下载源码...

3.3:进入容器运行apache

docker exec -it da6a434c99e6 bash

cd /etc/apache2/server_root/bin

./apachectl start

3.4:容器后台运转

Ctrl+alt+q+p 

2.1:server-status简介

server-status是Apache查看状态的多个成效模块,在Apache 1.3.2及随后的版本提供

1.7:安装重视包openssl和openssl-devel

一向设置

apt-get install openssl openssl-devel

 

下载源码编写翻译安装

cd /etc/apache2/src

wget

tar zxf openssl-1.0.2h.tar.gz

cd openssl-1.0.2h

./config shared zlib

若是提醒 because of configuration changes, you MUST do the following before*** building:

则须要在build在此以前做make depend

make depend

make

make install

mv /usr/bin/openssl /usr/bin/openssl.bak

mv /usr/include/openssl /usr/include/openssl.bak

ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/ssl/include/openssl /usr/include/openssl

echo “/usr/local/ssl/lib” >> /etc/ld.so.conf

ldconfig –v

 

检查实验安装是还是不是中标

openssl version –a

1.4:创制安装目录

mkdir /etc/apache2

mkdir /etc/apache2/src

cd /etc/apache2/src

1.6:安装信任包zlib1g,zlib1g.dev

一直设置

sudo apt-get install libpcre3 libpcre3-dev  

编写翻译安装

在  下载

获取文件: pcre-8.32.tar.gz

解压:tar -zxvf pcre-8.32.tar.gz

编译:

cd /home/tnuser/hunter/installers/pcre-8.32    

/configure --prefix=/home/tnuser/pcre/  

 

2.2:打开server-status

vi /etc/apache2/server_root/conf/httpd.conf

去掉LoadModule status_module modules/mod_status.so的注释

澳门新萄京app 4

修改Include 路径 为 /etc/apache2/server_root/conf/extra/httpd-info.conf

澳门新萄京app 5

澳门新萄京app,修改配置如下

vi /etc/apache2/server_root/conf/extra/httpd-info.conf

<Location /server-status>

    SetHandler server-status

    Order deny,allow

Allow from all

Allow from 10.20.7.15

</Location>

澳门新萄京app 6

去掉ExtendedStatus On 注释

澳门新萄京app 7

vi /etc/apache2/src/httpd-2.4.33

./configure --enable-module=so --enable-info

澳门新萄京app 8

重启apache

cd /etc/apache2/server_root/bin

./apachectl restart

1.3:安装ubuntu依赖项

apt update

apt-get install vim

apt-get install net-tools

apt-get install iputils-ping

apt-get install openssh-server

apt-get install openssh-client

apt-get install lrzsz

apt-get install gcc

apt-get install libpcre3 libpcre3-dev

apt-get install make

apt-get install openssl libssl-dev

apt-get install libxml2 libxml2-dev

apt-get install zip unzip

apt-get install libexpat1-dev

apt-get install libnghttp2-dev

2:配置server-status 监控apache

本文由澳门新萄京app发布于计算机操作系统,转载请注明出处:【澳门新萄京app】容器化的Apache服务并监察和控制,CentOS7下源码安装Apache2

关键词:

上一篇:安装登录CentOS7
下一篇:没有了