RedOS (LAMP)
LAMP — это классический стек технологий для веб-разработки, который включает операционную систему Linux, веб-сервер Apache, систему управления базами данных MySQL и серверный язык программирования PHP. Этот набор позволяет развернуть полноценную среду для создания и управления веб-сайтами и приложениями.
Обновляемся РедОС
dnf update -y
Применяем все обновления
reboot
Открываем наш host
mcedit /etc/hosts
прописываем наш хост
установки репозиторий
dnf install php83-release -y
очищаем кэш
dnf clean all
загрузить кэш
dnf makecache
устанавливаем компоненты которые нам по набиться (Apache HTTP,OpenSSL,PHP,MariaDB,Webmin,Cockpit)
dnf install httpd mod_ssl php php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-curl php-mcrypt php-pear php-fpm php-ldap php-mysqlnd setroubleshoot-server bzip2 mariadb mariadb-server mod_auth_kerb webmin cockpit -y
Запускай и добавляем в автозапуск, MariaDB
systemctl start mariadb && systemctl enable mariadb && systemctl status mariadb
Запускай и добавляем в автозапуск Apache HTTP
systemctl start httpd.service && systemctl enable httpd.service && systemctl status httpd.service
Добавляем в автозапуск Socket
systemctl enable --now cockpit.socket
Закрываем страницу приветствия Apache HTTP
mcedit /etc/httpd/conf.d/welcome.conf
# This configuration file enables the default "Welcome" page if there
# is no default index page present for the root URL. To disable the
# Welcome page, comment out all the lines below.
#
# NOTE: if this file is removed, it will be restored on upgrades.
#
#
# Options -Indexes
# ErrorDocument 403 /.noindex.html
#
#
# AllowOverride None
# Require all granted
#
#Alias /.noindex.html /usr/share/httpd/noindex/index.html
#Alias /noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
#Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
#Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
#Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
#********************************************************************************
запускаем настройку MariaDB
mysql_secure_installation
Set root password? [Y/n] Y
New password: ваш пароль (StrongPassword)
Re-enter new password: ваш пароль(StrongPassword)
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
Скачиваем и распаковываем IonCube для некоторых CRM он нужен обязательно как примеру (Moguta.CMS)
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxf ioncube_loaders_lin_x86-64.tar.gz
mv ioncube /usr/local
Подключаем IonCube к PHP
mcedit /etc/php.ini
zend_extension = /usr/local/ioncube/ioncube_loader_lin_8.3.so
zend_extension_ts = /usr/local/ioncube/ioncube_loader_lin_8.3_ts.so
Настраиваем PHP
sed -i 's/\(^upload_max_filesize = \).*/\1512M/' /etc/php.ini
sed -i 's/\(^post_max_size = \).*/\1512M/' /etc/php.ini
sed -i 's/\(^memory_limit = \).*/\128M/' /etc/php.ini
sed -i "s|;date.timezone =.*|date.timezone = Asia/Yekaterinburg|" /etc/php.ini
Создаем базу для вашего сайта
mysql -u root -p
create user (имя вашей пользователя)@localhost identified by '(Ваш пароль от базы)';
grant all privileges on (имя вашей пользователя).* to (имя вашей пользователя)@localhost;
set global log_bin_trust_function_creators = 1;
quit;
Настраиваем Selinux
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_graceful_shutdown 1
setsebool -P httpd_can_network_connect_db 1
setsebool -P daemons_dump_core 1
Открываем портов в файрволе (брандмауэре) если ипользуете
firewall-cmd --add-service=https --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload
Добавляем отдельную папку для хранения файлов нашего сайта
mkdir -p /var/www/test-host.ru
mkdir -p /var/www/test-host.ru/www
Предоставляем доступ к хранению данных
chmod -R 777 /var/www/test-host.ru/www
Создаем конфигурационный файл нашего сайта
touch /etc/httpd/conf.d/it-admin196.conf
редактируем конфигурационный файл нашего сайта
<VirtualHost 192.168.ХХХ.Х:80>
ServerName test-host.ru
ServerAlias test-host.ru
ServerAdmin tets@test-host.ru
DocumentRoot /var/www/test-host.ru/www
<directory /var/www/test-host.ru/www>
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
SetEnv HOME /var/www/test-host.ru/www
SetEnv HTTP_HOME /var/www/test-host.ru/www
</directory>
</VirtualHost>
Назначьте владельца хранения файлов нашего сайта
chown -R apache:apache /var/www/test-host.ru/www && chcon -R -t httpd_sys_rw_content_t /var/www/test-host.ru/www
Установка phpMyAdmin
dnf -y install phpmyadmin
Делаем копию конфигурационного файла phpMyAdmin
cp /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.orig
Открываем конфигурационного файла phpMyAdmin
И приводим в соответствия конфигурационного файла
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from Alldnf
Allow from None
</Directory>
На этом этапе практически все сделано если вам не обходимо загрузить ваш сайт.
Устанавливаем Let’s Encrypt (certbot)
dnf install certbot python3-certbot-apache
Запускаем Let’s Encrypt (certbot)
certbot --apache
Принудительно создать сертификат на ваш сайт
certbot --apache -d test-host.ru
Обновить SSL сертификат
certbot renew
- admin от

