Using SaltStack to Install High Performance LAMP on Fedora 25
-
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.
-
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.
-
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.
-
Needs supports for Virtual Hosts, and WordPress
-
@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?
-
I tested Virtual Hosts. They worked.
-
Are you using minimal or fedora Server edition has your base environment?
-
@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.
-
@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
-
@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.
-
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/
-
@scottalanmiller How are you liking Salt Stack?