zoukankan      html  css  js  c++  java
  • 使用state模块部署lamp架构

    install_httpd:
      pkg.installed:
        - name: httpd
    httpd_running:
      service.running:
        - name: httpd
        - enable: True
        - require:
          - pkg: install_httpd
    - reload: True #配置改变就重启 - watch: - file: httpd_conf httpd_conf: file.managed: - name: /etc/httpd/conf/httpd.conf - source: salt://httpd.conf - user: root - group: root - mode: 600 install_php: pkg.installed: - name: php_all - pkgs: - php - php-mysql - php-common - php-devel - php-mbstring - php-mcrypt - php-xml - require: - pkg: install_httpd install_mysql: pkg.installed: - name: mariadb - pkgs: - mariadb - mariadb-server - mariadb-devel mysql-running: service.running: - name: mariadb - enable: True - require: - pkg: install_mysql mysqld_conf: file.managed: - name: /etc/my.cnf - source: salt://my.cnf - user: root - group: root - mode: 664 discuz_handle: file.managed: - name: /var/www/html/Discuz_X3.3_SC_UTF8.zip - source: salt://Discuz_X3.3_SC_UTF8.zip - user: root - group: root - mode: 644 create_backup_directory: file.directory: - name: /var/www/html/discuz - user: root - group: root - mode: 755 unzip_discuz: cmd.run: - name: cd /var/www/html && mv Discuz_X3.3_SC_UTF8.zip ./discuz && cd /var/www/html/discuz && unzip Discuz_X3.3_SC_UTF8.zip && rm -f Discuz_X3.3_SC_UTF8.zip && chmod -R 777 * && mv /var/www/html/discuz/upload/* /var/www/html/discuz httpd-restart: cmd.run: - name: systemctl restart httpd.service mysql_authorization: cmd.run: - name: mysql -uroot -p123456 -e "create database discuz;grant all privileges on discuz.* to discuz@'%' identified by '123456';"

    这个sls最后有点bug,最后访问discuz的网址显示php的代码,不显示页面,但访问php的测试页面又能访问。蛋疼。

  • 相关阅读:
    景瑞地产商业智能BI整体实施过程
    域名访问和IP访问问题
    sitemesh定义多个装饰器
    8.8.2 EXPLAIN Output Format 优化输出格式
    Python_List对象内置方法详解
    Python_List对象内置方法详解
    Python_序列对象内置方法详解_String
    Python_序列对象内置方法详解_String
    CentOS设置服务开机启动的两种方法
    perl 没有关键文件句柄引起的逻辑错误
  • 原文地址:https://www.cnblogs.com/uglyliu/p/6825443.html
Copyright © 2011-2022 走看看