Linux运维笔记-文档总结-Apache基本配置的介绍和语言支持,虚拟主机,访问控制的实现
来源:互联网 发布:政府数据开放 分析 编辑:程序博客网 时间:2024/06/01 09:08
以下所有操作都是在Red-hat 7.0上
|####################Apache的安装#####################|
yum install httpd -y
systemctl start httpd
systemctl stop firewalld
systemctl enable httpd
systemctl disable firewalld
|##################Apache的基本参数#################|
1.Apache的默认文件
index.html
2.Apache的配置文件
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/*.conf
3.Apache的默认发布目录
/var/www/html
4.Apache的默认端口
80
|##################Apache的基本配置#################|
1.修改默认发布文件
vim /etc/httpd/conf/httpd.conf
164 DirectoryIndex westos.html
2.修改默认发布目录
** ##当selinux是disabled状态
vim /etc/httpd/conf/httpd.conf
**120 DocumentRoot “ /westos/www/test”
* Require all granted*
systemctl restart httpd
* ##当selinux是Enforcing状态*
vim /etc/httpd/conf/httpd.conf
120 DocumentRoot “ /westos/www/test”
systemctl restart httpd
semanage fcontext -a -t http_sys_content ‘/westos(/.*)?’ ##修改安全上下午
restorecon -RvvF /westos ##激活刚才修改的安全上下文
|####################Apache支持的语言#####################|
1.Apache支持的语言
HTML PHP CGI
2.cgi语言
mkdir /var/www/html/cgi ##建议cgi的默认目录
vim index.cgi
#!/usr/bin/perl
**print “Content-type”:text/html\n\n”;
**print date
;
**vim /etc/httpd/conf/httpd.conf
* Options +ExecCGI*
* AddHandler cgi-script .cgi*
* systemctl restart httpd*
**(提示:做这个实验时,一定将selinux不要改成Enforing)
|##################Apache的访问控制###################|
1.设定ip访问
**vim /etc/httpd/conf/httpd.conf
* Order Allow,Deny ##这里别乱敲空格*
** Allow from All
** Deny from 172.25.254.250
**vim /etc/httpd/conf/httpd.conf
* Order Deny,Allow ##这里别乱敲空格*
** Allow from 172.25.254.250
** Deny from All
2.设定用户访问
创建认证用户
htpasswd -cm /etc/httpd/accessuser admin ##第一次创建时是-cm,如果第二次还是-cm,就会覆盖前面的内容
vim /etc/httpd/conf/httpd.conf
AuthUserFile /etc/httpd/accessuser ##用户认证文件
AuthName “Please input your name and password!”##提示信息
AuthType basic ##认证类型
Require valid-user ##认证用户,建立的都可以认证
|##################Apache的虚拟主机###################|
1.定义
可以让我们的一台Apache服务器在被访问不同域名时候显示不同的主页
2.建议测试页
3.配置
4.测试
在真机上先做好解析
The end
阅读全文
0 0
- Linux运维笔记-文档总结-Apache基本配置的介绍和语言支持,虚拟主机,访问控制的实现
- linux系统之apache基本配置及语言支持及虚拟主机 访问控制
- Apache的虚拟主机、内部访问控制及支持语言
- apache的访问控制和虚拟主机的配置
- Linux运维笔记-文档总结-控制对文件的访问
- apache实现虚拟主机的配置
- Apache访问控制之虚拟主机配置
- apache基于名字的虚拟主机配置笔记
- Ubuntu Linux Apache虚拟主机的安装配置
- linux下apache的虚拟主机配置
- Linux 下Apache虚拟主机的配置
- Apache虚拟主机的配置
- Apache虚拟主机的配置
- apache 虚拟主机的配置
- [Apache]虚拟主机的配置
- Apache虚拟主机的配置
- Apache虚拟主机的配置
- 配置Apache的虚拟主机
- POJ1102 LC-Display【打印图案】
- IOS学习 iOS多线程非常好
- Visual Basic快捷教程——Visual Basic 2017 破冰
- tomcat server.xml 配置详解
- 关于手动删除Tomcat下的项目,重启Tomcat后报错的问题
- Linux运维笔记-文档总结-Apache基本配置的介绍和语言支持,虚拟主机,访问控制的实现
- centos,linux下django 链接mysql提示mysql.sock无法打开问题
- bond,team链路聚合
- UVALive6428 A+B【扩展欧几里得算法+GCD】
- Linux运维笔记-文档总结-通过ssl加密的HTTPS超文本传输协议和网页重写
- 第35课:彻底解密Spark 2.1.X中Sort Shuffle 中TimSort排序源码具体实现
- Struts2_对Action中所有方法进行输入校验
- Linux运维笔记-文档总结-虚拟网络接口bond
- 图解正向代理、反向代理、透明代理