http

Posted 肀肀

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了http相关的知识,希望对你有一定的参考价值。

13. 配置server0 Web服务,网站wwwX.example.com。拒绝cracker.com域 访问。
注:命名为index.html,勿修改网页内容
14. 配置server0 Web服务,网站wwwX.example.com启用TLS加密。TLS certificate http://classroom/pub/tls/certs/wwwX.crt
15. 配置server0 Web服务,网站serverX.example.com,网站目录为/var/www/virtual
注:命名为index.html,勿修改网页内容
16. 配置server0 Web服务,网站webappX.example.com,端口为8888/tcp
Python application
17. 配置server0 Web服务,http://serverX.example.com/private,仅允许从server0访问。
注:命名为index.html,勿修改网页内容
 
 
13
server0
yum -y install httpd mod_ssl mod_wsgi
cp /root/www.html /var/www/html/index.html                                                   #copy yes change name
vim /etc/httpd/conf.d/www0.example.com
<Virtualhost   *:80>
       DocumentRoot    /var/www/html
        ServerName        www0.example.com
</Virtualhost>
 
 
<Directory    /var/www/html>
            <RequireAll>
               Require all granted
               Require not ip 172.24.0.0/16
            </RequireAll>
</Directory>
systemctl enable httpd
systemctl start httpd
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
restorecon -RFvv /var/www
firefox &            #test client
 
14
server0
cd /etc/httpd
vim /etc/httpd/conf.d/www0.example.com
<VirtualHost *:443>
        DocumentRoot /var/www/html
        servername   www0.example.com
        SSLEngine on
        SSLProtocol all -SSLv2
        SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
        SSLHonorCipherOrder on
        SSLCertificateFile /etc/httpd/www0.crt
        SSLCertificateKeyFile  /etc/httpd//www0.key
        SSLCACertificateFile  /etc/httpd/example-ca.crt
</VirtualHost>
httpd -t
systemctl reload httpd
firefox &           #test
 
15
server0
mkdir /var/www/virtual
cp /root/server.html    /var/www/virtual/index.html
vim /etc/httpd/conf.d/server0.conf
<Virtualhost    *:80>
        DocumentRoot /var/www/virtaul
        Servername    server0.example.com
</Virtualhost>
 
<Directory    /var/www/virtual>
    Require all granted
</Directory>
restorecon -RFvv /var/www
systemctl reload httpd
firefox &                 
 
16
server0
mkdir /var/www/webapp0
cp /root/webapp.wsgi /var/www/webapp0/                                #copy no change name
vim /etc/httpd/conf.d/webapp0.conf
Listen 8888
<Virtualhost    *:8888>
    WSGIScriptAlias  /    /var/www/webapp0/webapp.wsgi
    Servername    webapp0.example.com
</Virtualhost>
restorecon -RFvv /var/www
firewall-cmd --permanent --add-ports=8888/tcp
firewall-cmd --reload
semanage port -l |grep -l                                                                          #list port label 
semanage port -a -t http_port_t -p tcp 8888
systemctl restart httpd
firefox &                         
 
17 
mkdir /var/www/virtual/private
cp /root/private.html  /var/www/virtual/private/index.html          #static default index.html
vim /etc/httpd/conf.d/server0.conf
<Directory /var/www/virtual/private>
    Require local 
</Directory>
restorecon -RFvv /var/www
systemctl restart httpd
firefox &                 #server  test
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

以上是关于http的主要内容,如果未能解决你的问题,请参考以下文章

HTTPHTTP协议的请求与响应

HttpHttp请求的流程

HTTPHTTP1.0HTTP1.1HTTP2.0HTTPS

HTTPHTTP POST GET 本质区别详解

httphttp的方法,状态码和组成部分

HTTPHTTP请求体中的四种格式,requests库发送post请求