08. compile and install httpd

(Note: The first to be found in local and remote

Here's what the playbook. It is a process flow:

1. First download apr, apr-util, httpd total of three .tar.gz file locally.

2. Extract these three files.

3. Install pcre pcre-devel and the dependencies.

4. Compile installation apr.

The compiler installation apr-util.

6. compile and install httpd.

---
- hosts: test-openstack2
tasks:
- name: download apr,apr-util,httpd
get_url: url={{item}} dest=/root/pkg
with_items:
- http://mirrors.ustc.edu.cn/apache/apr/apr-1.6.5.tar.gz
- http://mirrors.ustc.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
- http://mirrors.ustc.edu.cn/apache/httpd/httpd-2.4.39.tar.gz
delegate_to: localhost
run_once: True
 
- unarchive: src=/root/pkg/{{item}} dest=/root/
with_items:
- apr-1.6.5.tar.gz
- apr-util-1.6.1.tar.gz
- httpd-2.4.39.tar.gz
tags: unarchive
 
- name: install pcre and pcre-devel
yum: name="{{item}}" state=installed
with_items:
- pcre
- pcre-devel
 
- name: complie apr
shell: |
cd /root/apr-1.6.5
./configure --prefix=/usr/local/apr
make && make install
 
- name: complie apr-util
shell: |
cd /root/apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install
- name: complie httpd
shell: |
cd /root/httpd-2.4.39
./configure --prefix=/usr/local/apache --sysconfdir=/etc/apache \
--enable-mpms-shared=all \
--with-z --with-pcre \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-mpm=event
make && make install

 

Guess you like

Origin www.cnblogs.com/hackerlin/p/12553199.html