dev/1.lamp.md
2023-07-24 09:43:37 +03:00

1.3 KiB

LAMP

HTTPD

Install

# Install
dnf install epel-release
dnf install httpd httpd-tools

# Enable
systemctl start httpd
systemctl enable httpd

# Test
curl localhost

PHP

# Install
dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf module enable php:remi-7.4
dnf install php php-opcache php-gd php-curl php-mysqlnd php-mbstring php-devel 
dnf install php-xml php-pear php-fpm php-mysql php-pdo php-json php-zip
dnf install php-common php-cli php-xmlrpc php-xml php-tidy php-soap php-bcmath 

# Enable
systemctl start php-fpm
systemctl enable php-fpm

# Test
echo "<?php phpinfo( ) ?>" > /var/www/html/info.php
php -v
curl localhost/info.php

Composer

# Install
wget https://getcomposer.org/installer -O composer-installer.php
php composer-installer.php --filename=composer --install-dir=/usr/local/bin

# Test
composer -v

MYSQL

# Install
dnf install mariadb-server mariadb
mysql_secure_installation

# Enable
systemctl start mariadb
systemctl enable mariadb

# Test
mysql -uroot -p1234 -e "show databases"

Troubleshooting HTTPD

ReWrite module

`httpd -M | grep rewrite
<Directory /var/www/html>
 AllowOverride All
</Directory>

Persmissions

  • check the file dir
  • check the .htaccess owner and perms
ls -la
ls -la sites/default