CentOS-7-local-repo-用户httpd目录UserDir

mkdir /media/cdrom
mount /dev/cdrom /media/cdrom

vim /etc/yum.repos.d/local.repo

[local]
name=local
baseurl=file:////media/cdrom
enabled=1
gpgcheck=0


yum install -y httpd

vim /etc/httpd/conf.d/userdir.conf
UserDir enabled
UserDir public_html

useradd user9
chmod 755 /home/user9
chmod 755 /home/user9/public_html
echo "Hello World" > /home/user9/public_html/index.html

setsebool -P httpd_enable_homedirs=on

curl http://127.0.0.1/~user9/