ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Using SaltStack to Install High Performance LAMP on Fedora 25

    IT Discussion
    linux salt saltstack lamp apache httpd php php 7 mariadb
    4
    12
    3.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by scottalanmiller

      This is an ultra-modern LAMP stack build for Fedora 25. PHP 7.1, lots of caching components and everything, built automatically. No applications or sites installed, but everything is ready for an immediate install once set up. This build includes components like Varnish and Memcached for caching, uses MariaDB for the database. By default your websites will go to /var/www/html/. This can be changed, of course. This is a vanilla install to just get you up and running quickly. Web ports are opened automatically.

      This is a work in progress, but already builds the server.

      I use the folder /srv/salt/lamp to organize this build and this is my init.sls state file:

      install_network_packages:
        pkg.installed:
          - pkgs:
            - wget
            - unzip
            - firewalld
            - net-tools
            - php
            - mariadb
            - mariadb-server
            - mod_ssl
            - php-pecl-apcu
            - httpd
            - fail2ban
            - certbot
            - varnish
            - memcached
            - php-pecl-memcache
            - php-pecl-memcached
            - php-mysqlnd
            - php-pdo
            - php-gd
            - php-mbstring
            - php-imap
            - ImageMagick
            - nginx
            - htop
            - glances
            - ZipArchive
            - php-pecl-zip
            - php-theseer-fDOMDocument
            - sysstat
            - dnf-automatic
      
      /var/www/html/:
        file.directory:
          - user: apache
          - group: apache
          - recurse:
            - user
            - group
      
      FedoraServer:
        firewalld.present:
          - name: FedoraServer
          - block_icmp:
            - echo-reply
            - echo-request
          - default: False
          - masquerade: False
          - ports:
            - 22/tcp
            - 80/tcp
            - 443/tcp
            - 9090/tcp
      
      httpd:
        pkg.installed: []
        service.running:
          - enable: True
          - require:
            - pkg: httpd
      
      mariadb:
        pkg.installed: []
        service.running:
          - enable: True
          - require:
            - pkg: mariadb
      

      If you create /srv/salt/lamp/files/ you have a perfect place to store your Apache / HTTPD configuration files to be deployed for each website or application that you install.

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        Notes:

        • Because this is Fedora, Port 9090 is being opened for Cockpit. Remove that line if you don't intend to use it.
        • Post 22 is open for SSH. If you are not going to keep it accessible remove this for added protection.
        • If you remove SSH, also remove Fail2Ban from the package list, no need to be running that with no SSH enabled.
        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          Obviously, LAMP is one of the simpler installations that you can do. All of the real complications come from installing applications on top of our LAMP build.

          1 Reply Last reply Reply Quote 0
          • A
            Alex Sage
            last edited by

            Needs supports for Virtual Hosts, and WordPress 😉

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @Alex Sage
              last edited by

              @aaronstuder said in Using SaltStack to Install High Performance LAMP on Fedora 25:

              Needs supports for Virtual Hosts, and WordPress 😉

              What support is missing for virtual hosts?

              1 Reply Last reply Reply Quote 1
              • scottalanmillerS
                scottalanmiller
                last edited by

                I tested Virtual Hosts. They worked.

                1 Reply Last reply Reply Quote 0
                • black3dynamiteB
                  black3dynamite
                  last edited by

                  Are you using minimal or fedora Server edition has your base environment?

                  scottalanmillerS 1 Reply Last reply Reply Quote 0
                  • scottalanmillerS
                    scottalanmiller @black3dynamite
                    last edited by

                    @black3dynamite said in Using SaltStack to Install High Performance LAMP on Fedora 25:

                    Are you using minimal or fedora Server edition has your base environment?

                    Fedora Server, is there a Fedora Minimal? I've not seen that mentioned in years.

                    black3dynamiteB 1 Reply Last reply Reply Quote 0
                    • black3dynamiteB
                      black3dynamite @scottalanmiller
                      last edited by

                      @scottalanmiller
                      "The Fedora Server NetInstall image is a universal, and can be used to install any Fedora flavor or own set of favorite packages."

                      https://docs.fedoraproject.org/en-US/Fedora/25/html/Installation_Guide/chap-downloading-fedora.html

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @black3dynamite
                        last edited by

                        @black3dynamite said in Using SaltStack to Install High Performance LAMP on Fedora 25:

                        @scottalanmiller
                        "The Fedora Server NetInstall image is a universal, and can be used to install any Fedora flavor or own set of favorite packages."

                        https://docs.fedoraproject.org/en-US/Fedora/25/html/Installation_Guide/chap-downloading-fedora.html

                        I'm just taking the vanilla from the net install.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller
                          last edited by

                          I've added an article on using NGinx to accelerate SSL in front of LAMP: https://mangolassi.it/topic/13177/deploying-an-nginx-reverse-proxy-with-ssl-on-a-lamp-server-with-saltstack/

                          1 Reply Last reply Reply Quote 3
                          • C
                            Curtis
                            last edited by Curtis

                            @scottalanmiller How are you liking Salt Stack?

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post