dev/lamp/lamp.md
2023-11-16 09:23:26 +02:00

136 lines
2.0 KiB
Markdown

# LAMP
#### Hostname
`/etc/hostname`
```
rocky.vm7
```
`/etc/hosts `
```
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.4.11 site0.vm7
172.16.4.11 site1.vm7
172.16.4.11 site2.vm7
172.16.4.11 site3.vm7
172.16.4.11 site4.vm7
172.16.4.11 site5.vm7
172.16.4.11 site6.vm7
172.16.4.11 site7.vm7
172.16.4.11 site8.vm7
172.16.4.11 site9.vm7
```
### HTTPD
Install
```bash
# Install
dnf install epel-release
dnf install httpd httpd-tools
# Enable
systemctl start httpd
systemctl enable httpd
# Test
curl localhost
```
### PHP
```bash
dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf module enable php:remi-8.2
dnf install -y php
dnf install -y php-gd php-curl php-mysqlnd
dnf install -y php-devel php-xml php-pear php-mysql
dnf install -y php-json php-zip php-common php-xmlrpc
dnf install -y php-tidy php-soap php-bcmath
# Enable
systemctl status php-fpm
systemctl start php-fpm
systemctl enable php-fpm
systemctl restart httpd
# Test
echo "<?php phpinfo( ) ?>" > /var/www/html/info.php
php -v
curl localhost/info.php
```
`/etc/php/ini`
```
upload_max_filesize = 48M
post_max_size = 48M
memory_limit = 512M
max_execution_time = 300
max_input_time = 3000
max_input_vars = 3000
```
### Composer
```bash
# 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
```bash
# Install
dnf install mariadb-server mariadb
systemctl start mariadb
mysql_secure_installation
# Enable
systemctl enable mariadb
systemctl status 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
```