资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

http2-创新互联

1.http访问权限

成都创新互联公司欢迎咨询:028-86922220,为您提供成都网站建设网页设计及定制高端网站建设服务,成都创新互联公司网页制作领域十载,包括成都房屋鉴定等多个行业拥有丰富建站经验,选择成都创新互联公司,为企业锦上添花!

cd /var/www/

mkdir taxing#selinux 为强制状态时需要此步骤,关闭则不需要

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

restorecon -RccF /www/

ls -Zd .

vim /etc/httpd/conf/httpd.conf

119 #DocumentRoot "/var/www/html"#修改访问默认目录

120 DocumentRoot "/var/www/taxing"

121

122         require all granted#开放对所有人的访问权限

123         Order Allow,Deny#读取顺序

124         Allow from ALL#允许对所有人

125         Deny from 172.25.254.24#拒绝172.25.254.24对httpd的访问

126

170     DirectoryIndex timo index.html#访问文件 (172.25.254.124/timo)(172.25.254.124)

42 Listen 80#8080#访问端口(172.25.254.124)(172.25.254.124:8080)

ctrl+shift+Delete#清除缓存

2.密码登陆

cd /etc/httpd/

htpasswd -cm htpasswdfile timo#创建用户和密码

htpasswd -m htpasswdfile rito#添加用户和密码

[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#读取文件

        Authname "Please input username and password"#

        Authtype basic

        Require user timo

3.创建虚拟主机

vim /etc/http/conf/httpd.conf#删除之前的修改,恢复到修改之前

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

在使用浏览器主机上

vim /etc/hosts

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

4.创建自己的https证书

yum install  mod_ssl -y

systemctl restart httpd.service

netstat -antlpe | grep 443

yum install crypto-utils.x86_64 -y

genkey www.timo.com

http2

http2

http2

http2

http2

http2

http2

http2

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

在客户机:https://172.25.254.124

ctrl+alt+delete删除缓存

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页名称:http2-创新互联
地址分享:http://cdkjz.cn/article/egdeh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220