Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Http2

Shulou Source: shulou.com Published: 2022-06-01 10:18:49 10月02日 Update

1.http access

Cd / var/www/

This step is required when mkdir taxing#selinux is mandatory, but not when closed

Semanage frcontext-a-t http_sys_content_t'/ www/taxing (/. *)?'

Restorecon-RccF / www/

Ls-Zd.

Vim / etc/httpd/conf/httpd.conf

# DocumentRoot "/ var/www/html" # modify access to the default directory

120 DocumentRoot "/ var/www/taxing"

one hundred and twenty one

122 require all granted# opens access to everyone

123 Order Allow,Deny# read order

124 Allow from ALL# allows for everyone

125 Deny from 172.25.254.2deny 172.25.254.24 access to httpd

one hundred and twenty six

170 DirectoryIndex timo index.html# access File (172.25.254.124/timo) (172.25.254.124)

42 Listen 80 '808' access port (172.25.254.124) (172.25.254.124 virtual 8080)

Ctrl+shift+Delete# clears the cache

two。 Password login

Cd / etc/httpd/

Htpasswd-cm htpasswdfile timo# creates users and passwords

Htpasswd-m htpasswdfile rito# add user and password

[root@timo httpd] # cat htpasswdfile

Timo:$apr1 $jUAeuJ.m$LaTdnIBzxWb71oObNgFTx/

Rito:$apr1 $mFwqLnWl$DErf.PJTjijn3Xt8eJfDG/

Vim / etc/httpd/conf/httpd.conf

# DocumentRoot "/ var/www/html"

DocumentRoot "/ var/www/taxing"

# require all granted

AllowOverride All

Authuserfile / etc/httpd/htpasswdfile# reads files

Authname "Please input username and password" #

Authtype basic

Require user timo

3. Create a virtual host

Vim / etc/http/conf/httpd.conf# deletes the previous changes and reverts to the previous modifications

Mkdir / var/www/virtual/news.timo.com/html-p

Mkdir / var/www/virtual/music.timo.com/html-p

Cd / etc/http/conf.d/

Vim default.conf

Documentroot / var/www/html

Customlog "logs/default.log" combined

Require all granted

Vim news.conf

Servername news.timo.com

Documentroot / var/www/virtual/news.timo.com/html

Customlog "logs/news.log" combined

Require all granted

Cp news.conf music.conf

Vim music.conf

Servername music.timo.com

Documentroot / var/www/virtual/music.timo.com/html

Customlog "logs/music.log" combined

Require all granted

Cd / var/www/virtual/news.timo.com/html

Vim index.html

News.timo.com

Cd/var/www/virtual/music.timo.com/html

Vim index.html

Music.timo.com

On the host using the browser

Vim / etc/hosts

172.25.254.124 www.timo.com timo.com music.timo.com news.timo.com

4. Create your own https certificate

Yum install mod_ssl-y

Systemctl restart httpd.service

Netstat-antlpe | grep 443

Yum install crypto-utils.x86_64-y

Genkey www.timo.com

Ls/ etc/pki/tls/certs/

Vim / etc/http/conf.d/ssl.conf

SSLCertificateFile / etc/pki/tls/certs/www.timo.com.crt

SSLCertificateKeyFile / etc/pki/tls/private/www.timo.com.key

In the client: https://172.25.254.124

Ctrl+alt+delete delete cache

Tags: Password host owner file permissions user cache client client step browser status directory port virtual host certificate order open mandatory browse Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS Shulou Information vpn Huawei