Fresh install of CentOS?

Have a fresh install of CentOS 8 you want to install a LAMP stack on but don’t want to spend 3 hours reading all sorts of crap? You’re in luck…run this code below to get everything you need installed on a fresh install of CentOS…you can trust me. By the way, these are all the prerequisites for WordPress.

# update software packages
dnf upgrade -y
dnf update -y
dnf install vim wget tar rsync httpd httpd-tools mariadb-server mariadb php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring php-json -y
systemctl start httpd
systemctl enable httpd
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
systemctl reload firewalld
chown apache:apache /var/www/html -R
systemctl start mariadb
systemctl enable mariadb
systemctl enable php-fpm
setsebool -P httpd_execmem 1
systemctl restart httpd php-fpm

Then you can configure MariaDB

mysql_secure_installation

Now you can go ahead and configure whatever you want. If you plan on installing WordPress, check out this other article that picks up where this leaves off from.

Let’s install WordPress on this bad boy.