Apache HTTP Server (Apache for short) is an open source web server Apache Software Foundation's
cross-platform, highly efficient and stable, http Hypertext Transfer Protocol support and other servicesRelated Resources apache
main configuration file /etc/httpd/conf/httpd.conf
child profile the /etc/httpd/conf.d/ .conf
default publish directory / var / www / html
default index.html file publish
the default port 80 is
the default security context httpd_sys_content_t
program to open the default user the Apache
the Apache logs / etc / httpd / logs /
premise
selinux set to off mode
restart
Install apache: yum -y install httpd
install apache documentation to help
start-up and start apache
added firewall mechanism
to restart apache
View httpd port
to view the apache id
View apache process
view apache log
Note ---> access_log normal log
---> error_log error log
edit the default index.html file released
into the page
.
Httpd modify the port services
主配置文件中修改
修改httpd服务的端口为8080
8080端口加入防火墙机制
重启apache
进入端口为8080的网页
.
制定默认发布文件优先级别
主配置文件中修改
设置test文件优先显示
添加编辑test文件
打开网页
.
修改默认发布目录
主配置文件中修改
修改默认发布目录并授权
注 ---> 需注释之前的 默认发布目录
创建默认发布目录,并复制发布文件
注 ---> 如遇到以下错误提示
---> 新建文件和系统默认的上下文不一致
修改安全上下文
semanage fcontext -a -t httpd_sys_content_t '/test(/.*)?'
restorecon -RvvF /test/
---> 或关闭selinux即可
.
apache内部的访问控制
禁止单独ip访问
创建目录/var/www/html/testdir
创建并编辑文件index.html
编辑子配置文件
注 ---> 允许全部访问,禁止172.225.254.31访问
172.225.254.31访问,无权限访问
172.225.254.131可访问
172.225.254.31 allow access to prohibit all access
to edit the configuration file child
Note ---> 172.225.254.31 accessible, the other can not access
172.225.254.31 can access
other can not be accessed
.
Access control user authentication method
only allows the user to access the admin login password
to create a password to authenticate the user admin and view the encrypted password
to edit the configuration file child
create a user password encryption and access authentication directory testdir
Note ---> AuthUserfile user authentication file
--- > AuthType authentication type basic types
---> AuthName authentication name
---> Require user authentication only allows admin access
verification
Accessible to all user authentication password
to create a password to authenticate the user admin1 and view the encrypted password
to edit the configuration file child
create access testdir directory user password authentication and encryption
Note ---> AuthUserfile user authentication file
---> AuthType basic types of authentication type
---> AuthName authentication name
---> Require user authentication allows all users access to
verify that all users can access the login password
.