From 96f7d7c8fb70dd21e137efa948fd6ac18fdfaeef Mon Sep 17 00:00:00 2001 From: artemdolgiy Date: Sat, 9 Oct 2021 16:45:46 +0300 Subject: [PATCH] mod --- rh199_(rapid)/labs.md | 15 +++++++++++++- rh199_(rapid)/labs_solutions.md | 35 ++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/rh199_(rapid)/labs.md b/rh199_(rapid)/labs.md index f40b677..0a538f4 100644 --- a/rh199_(rapid)/labs.md +++ b/rh199_(rapid)/labs.md @@ -7,7 +7,7 @@ 3. [Управление локальными пользователями и группами.](#chapter3) 4. [Управление доступом к файлам.](#chapter4) -5. [](#chapter5) +5. [Настройка SELinux.](#chapter5) 6. [](#chapter6) 7. [](#chapter7) 8. [](#chapter8) @@ -51,6 +51,19 @@ 7. Проверить, что члены группы `techdocs` (`tech1`, `tech2`) теперь могут создавать и редактировать файлы в директории `/home/techdocs`. 8. Изменить глобальный скрипт загрузки. Обычные пользователи должны иметь umask при которой другие пользователи не смогут просматривать и изменять новые файлы и каталоги. +[вверх](#top) + +*** + +###### Chapter5 +**Настройка SELinux.** + +1. На server1 запустить браузер и ввести адрес `http://server2/lab.html`. Отобразится сообщение `Forbidden You don't have permission to access this resource.` +2. Изучите и определите проблему SELinux, которая не позволяет Apache обслуживать веб-контент. + +3. Display the SELinux context of the new HTTP document root and the original HTTP document root. Resolve the SELinux issue preventing Apache from serving web content. +5. Verify that the SELinux issue has been resolved and Apache is able to serve web content. + # В ДОКУМЕНТЕ С ОТВЕТАМИ НЕОБХОДИМО ПРЕДУСМОТРЕТЬ КОМАНДЫ ПРОВЕРЯЮЩИЕ ПРАВИЛЬНОСТЬ ВЫПОЛНЕНИЯ ЗАДАНИЙ [вверх](#top) diff --git a/rh199_(rapid)/labs_solutions.md b/rh199_(rapid)/labs_solutions.md index bc0a74a..7b9f604 100644 --- a/rh199_(rapid)/labs_solutions.md +++ b/rh199_(rapid)/labs_solutions.md @@ -17,7 +17,13 @@ root password: redhat Дополнительно необходимо: *SERVER1* -1. Установить httpd +1. Прописать доменное имя server2 +```bash +[student@server2 ~]$ sudo -i +[sudo] пароль для student: +[root@server2 ~]# echo '192.168.10.11 server2' >> /etc/hosts +``` +2. Установить httpd ```bash [student@server2 ~]$ sudo -i [sudo] пароль для student: @@ -49,6 +55,33 @@ This is SERVER2 WEB-SERVER ``` +Перечень необходимых команд root (*стоит это оформить в виде скрипта*) +```bash +echo '192.168.10.11 server2' >> /etc/hosts +yum install httpd -y +systemctl enable --now httpd +echo "This is SERVER2 WEB-SERVER" > /var/www/html/index.html +firewall-cmd --add-service=http +firewall-cmd --add-service=http --permanent +mkdir /test +echo "This is the html file for the SELinux final lab on SERVER2." > /test/lab.html +mv /test/lab.html /var/www/html/ +rmdir /test/ +``` + +*SERVER2* +1. Прописать доменное имя server1 +```bash +[student@server2 ~]$ sudo -i +[sudo] пароль для student: +[root@server2 ~]# echo '192.168.10.10 server1' >> /etc/hosts +``` + +Перечень необходимых команд root (*стоит это оформить в виде скрипта*) +```bash +echo '192.168.10.10 server1' >> /etc/hosts +``` + *** ###### top