博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Apache练习题
阅读量:4041 次
发布时间:2019-05-24

本文共 3388 字,大约阅读时间需要 11 分钟。

1)打开HTTPD的持续性连接,即KeepAlive,该指令决定当处理完用户发起的HTTP 请求后是否立即关闭 TCP 连接,该次连接能够传输的最大传输数量为500 参考答案:    修改以下的文件:    vi /etc/httpd/conf/httpd.conf    修改如下内容:     KeepAlive On    MaxKeepAliveRequests 500 保存退出  service httpd restart 2)查看当前apache的应用模式 参考答案:httpd -l 3)调整httpd最大的同時连接数量为10000个 参考答案:    修改以下的文件:    vi /etc/httpd/conf/httpd.conf    修改如下内容:     ServerLimit   10000    MaxClients 10000 保存退出   service httpd restart 4)启动httpd进程的用户为apache 参考答案:    修改以下的文件:    vi /etc/httpd/conf/httpd.conf    修改如下内容:     User apache    Group apache 保存退出    service httpd restart 5)用中文 GB2312 编码 参考答案:    修改以下的文件:    vi /etc/httpd/conf/httpd.conf    修改如下内容:         AddDefaultCharset GB2312 保存退出service httpd restart 6.1)首頁权限相关设定,更改默认的WEB目录为/web 6.2)增加default.html为默认的索引文件 6.3)在default.html网页中增加"I love China" 参考答案:    修改以下的文件:    vi /etc/httpd/conf/httpd.conf    修改如下内容:         DocumentRoot "/web"        
Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all
DirectoryIndex default.html index.html index.html.var 保存退出 mkdir /web cat > default.html I love China! service httpd restart 7.1)启动用户的个人网站,用户为test 7.2)用户目录为/home/test/html 7.3)在用户目录下新建index.html文件 7.4)设定目录别名,即访问http://ip/test,即可浏览页面 参考答案: mkdir /home/test/html chmod 755 /home/test/ -R echo "Test your home">>/home/test/html/index.html 修改以下的文件: vi /etc/httpd/conf/httpd.conf
#UserDir disable UserDir public_html
Alias /test/ "/home/test/html/"
Options FollowSymLinks AllowOverride None Order allow,deny Allow from all
保存退出 service httpd restart 8)只让 192.168.1.0/24 这个网段可以浏览 参考答案: 修改以下的文件: vi /etc/httpd/conf/httpd.conf
Options FollowSymLinks AllowOverride None Order deny,allow Deny from all allow from 192.168.1.0/24
保存退出service httpd restart 9)主机状态说明网页,只让 192.168.1.0/24和127.0.0.1可以浏览 参考答案: 修改以下的文件: vi /etc/httpd/conf/httpd.conf ExtendedStatus On
SetHandler server-status Order deny,allow Deny from all Allow from 192.168.1.0/24 Allow from 127.0.0.1
保存退出 service httpd restart http://192.168.1.103/server-status 查看 10.1).htaccess 与认证网页设定,认证目录为/web 10.2)认证的用户名test密码qiuming 参考答案: 修改以下的文件: vi /etc/httpd/conf/httpd.conf
Options FollowSymLinks AllowOverride AuthConfig
Options Indexes FollowSymLinks AllowOverride AuthConfig Order allow,deny Allow from all
保存退出 修改以下的文件: vi /web/.htaccess AuthName "Protect test by .htaccess" Authtype Basic AuthUserFile /var/www/apache.passwd require user test 保存退出 htpasswd -c /var/www/apache.passwd test service httpd restart 11)建立 SSL (https) 网站,ssl访问的目录为/var/www/html 参考答案: cd /etc/httpd/conf/ssl.key mv server.key server.key.raw openssl genrsa -out server.key 1024cd /etc/httpd/conf/ssl.crtmv server.crt server.crt.rawopenssl req -new -x509 -key ../ssl.key/server.key -out server.crt修改以下的文件:vi /etc/httpd/conf.d/ssl.confDocumentRoot "/var/www/html"ServerName *:443保存退出service httpd restart 查看原文:

转载地址:http://tqmdi.baihongyu.com/

你可能感兴趣的文章
iOS 序列化与反序列化(runtime) 01
查看>>
iOS AFN 3.0版本前后区别 01
查看>>
iOS ASI和AFN有什么区别
查看>>
iOS QQ侧滑菜单(高仿)
查看>>
iOS 扫一扫功能开发
查看>>
iOS app之间的跳转以及传参数
查看>>
iOS __block和__weak的区别
查看>>
Android(三)数据存储之XML解析技术
查看>>
Spring JTA应用之JOTM配置
查看>>
spring JdbcTemplate 的若干问题
查看>>
Servlet和JSP的线程安全问题
查看>>
GBK编码下jQuery Ajax中文乱码终极暴力解决方案
查看>>
Oracle 物化视图
查看>>
PHP那点小事--三元运算符
查看>>
解决国内NPM安装依赖速度慢问题
查看>>
Brackets安装及常用插件安装
查看>>
Centos 7(Linux)环境下安装PHP(编译添加)相应动态扩展模块so(以openssl.so为例)
查看>>
fastcgi_param 详解
查看>>
Nginx配置文件(nginx.conf)配置详解
查看>>
标记一下
查看>>