Linux 第十節(jié)( APACHE )
Apache 基金會,軟件
http 協(xié)議
httpd 軟件包
vim /etc/httpd/conf/httpd.conf //網(wǎng)站配置主文件
systemctl restart httpd
systemctl enable httpd
1.網(wǎng)站數(shù)據(jù)不存在
/var/www/html
2.權(quán)限不足
------------------------------------------------------------
SElinux 安全子系統(tǒng)
vim /etc/selinux/config
SElinux域 //對管理服務(wù)功能
SElinux安全上下文
三種方式:
enforcing //強(qiáng)制開啟
permissive
disabled
getenforce
關(guān)閉:setenforce 0
開啟:setenforce 1
semanage fcontext -a -t http_sys_con_content_t /home/wwwroot/*
restorecon -Rv /home/wwwroot //立即生效
-----------------------------------------------------------------------------
useradd xiao //新建一個用戶
vim /etc/httpd/conf.d/userdir.conf //用戶準(zhǔn)入功能文件
su - xiao
mkdir public_html
cd public_html
vim index.html
chmod -R 755 public_html/
systemctl restart httpd
setenforc 0
getsebool -a | grep http //查看SElinux的http策略信息
setsebool -P //設(shè)置selinux策略
htpaswd -c /etc/httpd/passwd xiao //創(chuàng)建一個密碼驗證文件
vim /etc/httpd/conf.d/userdir.conf
allowoverrid all
authuserfile /etc/http/passwd
authname xxxxxxxxxxxxxxxx
authtype basic
requier user xiao
systemctl restart httpd
-------------------------------------------------------------------------------
虛擬主機(jī)功能:
1.Ip 地址
2.域名
3.端口
vim /etc/sysconfig/network-scripts/ifcfg-eno16777728

浙公網(wǎng)安備 33010602011771號