• 使用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的测试页面又能访问。蛋疼。

  • 相关阅读:
    Spring Boot Common application properties(转载)
    SVN中trunk,branches,tags用法详解(转载)
    约定优于配置
    JavaScript封装一个MyAlert弹出框
    JavaScript封装一个实用的select控件
    JavaScript的8行代码搞定js文件引入问题
    JavaScript处理数据完成左侧二级菜单的搭建
    SpringMVC+Mybatis实现的Mysql分页数据查询
    十步完全理解 SQL(转载)
    sql语句练习50题
  • 原文地址:https://www.cnblogs.com/uglyliu/p/6825443.html
Copyright © 2020-2023  润新知