首页 > 其他 > 详细

lamp

时间:2019-12-23 17:20:02      阅读:103      评论:0      收藏:0      [点我收藏+]

安装ansible 配置主机 这里就不写了

1.编写playbook

---
  - hosts: webservers
    vars:
       - ROOT: /opt/html
       - PORT: 80
    tasks:
        - name : ‘配置班级源‘
          script: repo.sh
        - name : ‘安装httpd和lamp的相关组件‘
          yum: name=httpd,php,php-gd,php-mysql state=latest
        - name: ‘分发配置文件支持php‘
          template: src=httpd.conf dest=/etc/httpd/conf/httpd.conf
        - name: ‘创建目录‘
          file: path={{ROOT}} state=directory owner=apache group=apache
        - name: ‘分发主界面‘
          template: src=info.php dest={{ROOT}}/info.php
        - name: ‘关闭防火墙‘
          service: name=iptables  state=stopped
        - name: ‘关闭selinux‘
          shell: setenforce 0
        - name: ‘启动httpd‘
          service: name=httpd state=restarted enabled=yes
~                                                             

2.编写一个主界面

<h1>{{ansible_hostname}}</h1>
<h1>{{ansible_all_ipv4_addresses}}</h1>
<?php
        phpinfo();
?>
                                                                                                                                            

3.编写hppd的配置文件 默认访问界面 改为index.php

AddType application/x-httpd-php .php

  

  

lamp

原文:https://www.cnblogs.com/gaiting/p/12084068.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!