Serve Webpages from User's Home Directory with Apache on CentOS 7 (SElinux Version))

preview_player
Показать описание
This video also demonstrates the configuration of SElinux for Apache.

Tested on: CentOS 7
Apache Version: 2.4.6 (x86_64)

Steps and Commands:
1. install apache
sudo yum install httpd -y

2. enable userdir

3. restart apache
sudo systemctl restart httpd

4. make $HOME executable
sudo chmod a+x $HOME

5. create public_html under home
mkdir $HOME/public_html

6. create a dummy html file

7. selinux
sudo chcon -Rt httpd_sys_content_t public_html

8. open port 80 on the firewall
sudo firewall-cmd --add-port=80/tcp --permanent

9. restart firewalld
sudo systemctl restart firewalld

10. find ip address of the server
ip addr show | grep inet

Рекомендации по теме
Комментарии
Автор

Thank you. I went thru many webpages and youtube videos which were not straight enough. This worked really well.

harish
Автор

It doesn't seem what I needed. I'm looking for how to load existing Apache project from user folders.

REgamesplayer