当前位置: 首页 > news >正文

钻石网站建设怎样建设网站 需要哪些条件

钻石网站建设,怎样建设网站 需要哪些条件,园林景观设计公司点评的网站和论坛,wordpress批量上传插件下载文章目录 1、搭建一个网络yum源2、基于域名访问的虚拟主机3、基于端口来访问域名4、搭建个人网站5、加密访问显示自定义网页内容 1、搭建一个网络yum源 [roottest01 conf.d]# cat repo.conf <virtualhost *:80>documentroot /var/www/html/ServerName 10.104.43.154ali…

文章目录

      • 1、搭建一个网络yum源
      • 2、基于域名访问的虚拟主机
      • 3、基于端口来访问+域名
      • 4、搭建个人网站
      • 5、加密访问+显示自定义网页内容

1、搭建一个网络yum源

[root@test01 conf.d]# cat repo.conf 
<virtualhost *:80>documentroot /var/www/html/ServerName 10.104.43.154alias /repo /var/www/html/repo  # 使用alias指令来进行指定访问repo的时候访问到/var/www/html/repo这个里面
</virtualhost>
<directory /var/www/html/repo>require all grantedOptions Indexes FollowSymLinks
</directory>
<FilesMatch "\.(iso|img)$">Require all denied
</FilesMatch>

2、基于域名访问的虚拟主机

  • 通过访问域名来访问对应的内容
# 创建访问网页的内容
[root@test01 share]# tree ./apache
./apache
├── a
└── b2 directories, 0 files[root@test01 apache]# echo "welcome a.com" > a/index.html
[root@test01 apache]# echo "welcome b.com" > b/index.html# 编写配置文件
[root@test01 conf.d]# cat a.conf b.conf 
<Virtualhost *:80>Documentroot /share/apache/aServerName www.a.com
</virtualhost>
<Directory /share/apache/a>require all granted
</Directory>
<Virtualhost *:80>Documentroot /share/apache/bServerName www.b.com
</virtualhost>
<Directory /share/apache/b>require all granted
</Directory># 安全放行
[root@test01 /]# firewall-cmd --permanent --add-service=http
[root@test01 /]# firewall-cmd --reload 
success# 自定义的目录需要给予上下文
[root@test01 share]# semanage fcontext -a -t httpd_sys_content_t './apache(/.*)?'
[root@test01 share]# restorecon -RFv ./apache/
restorecon reset /share/apache context unconfined_u:object_r:default_t:s0->system_u:object_r:default_t:s0
restorecon reset /share/apache/a context unconfined_u:object_r:default_t:s0->system_u:object_r:default_t:s0
restorecon reset /share/apache/a/index.html context unconfined_u:object_r:default_t:s0->system_u:object_r:default_t:s0
restorecon reset /share/apache/b context unconfined_u:object_r:default_t:s0->system_u:object_r:default_t:s0
restorecon reset /share/apache/b/index.html context unconfined_u:object_r:default_t:s0->system_u:object_r:default_t:s0# 进行访问
# 重启服务
[root@test01 conf.d]# systemctl restart httpd[root@test02 ~]# curl www.a.com
welcome a.com
[root@test02 ~]# curl www.b.com
welcome b.com

3、基于端口来访问+域名

# 配置文件
[root@test01 conf.d]# cat a.conf 
Listen 8088
<Virtualhost *:8088>Documentroot /share/apache/aServerName www.a.com
</virtualhost>
<Directory /share/apache/a>require all granted
</Directory># 添加端口
[root@test01 conf.d]# semanage port -a 8088 -t http_port_t -p tcp
[root@test01 conf.d]# semanage port -l | grep 8088
http_port_t                    tcp      8088, 80, 81, 443, 488, 8008, 8009, 8443, 9000
# 重启服务
[root@test01 conf.d]# systemctl restart httpd# 安全放行
[root@test01 conf.d]# firewall-cmd --permanent --add-port=8088/tcp
success
[root@test01 conf.d]# firewall-cmd --reload
success# 访问
[root@test02 ~]# curl www.a.com:8088
welcome a.com
[root@test02 ~]# curl www.b.com:8089
welcome b.com

4、搭建个人网站

# 修改user.conf文件 
UserDir enabled
UserDir public_html# 创建个人网站文件
[root@test01 q7]# tree public_html/
public_html/
└── index.html0 directories, 1 file
[root@test01 q7]# ll -Z public_html/
-rw-r--r--. root root unconfined_u:object_r:httpd_user_content_t:s0 index.html# 安全放行
[root@test01 q7]# setsebool -P httpd_enable_homedirs on
# 权限放行
[root@test01 q7]# ll -d
drwx--x--x. 3 q7 q7 81 Sep 27 11:35 .# 访问
http://10.104.43.154/~q7/

5、加密访问+显示自定义网页内容

# 安装加密的包
[root@test01 q7]# yum -y install mod_ssl# 生成私钥
openssl genrsa > tlsweb.key# 生成一个证书请求文件
openssl req -new -key tlsweb.key > tlsweb.csr#  生成一个证书文件
openssl req -x509 -days 365 -in tlsweb.csr -key tlsweb.key > tlsweb.crt# 将生成的私钥和证书文件移动到指定的路径
[root@test01 tls]# pwd
/etc/pki/tls
cp /root/tlsweb.key ./private/
cp /root/tlsweb.crt certs/firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload# 网页内容
[root@test01 conf.d]# cat a.conf 
<Virtualhost *:443>Documentroot /share/apache/aServerName www.a.comSSLEngine onSSLCertificateFile /etc/pki/tls/certs/tlsweb.crtSSLCertificateKeyFile /etc/pki/tls/private/tlsweb.key
</virtualhost>
<Directory /share/apache/a>require all granted
</Directory>[root@test01 conf.d]# systemctl restart httpd
# https访问
http://www.yayakq.cn/news/718796/

相关文章:

  • 服饰品牌网站建设临清网站建设临清
  • 佛山销售型网站建设简单的wordpress模板下载地址
  • 保护环境网站模板如何安装织梦做的网站
  • 做外单网站有哪些文件管理
  • 海南网站制作公司贵港网站开发
  • 南昌网站维护成立公司的条件
  • 仿糗事百科网站腾讯云备案域名
  • 品牌网站建设968产业互联网平台
  • 网站存在的问题外贸网站怎样注册
  • 网站前端杭州网站建设技术支持
  • c2c网站系统学建筑的网站
  • 低价网站建设浩森宇特自己电脑做网站服务器小工具
  • 给 小企业 建设网站无极电影网在线观看完整版
  • 网站翻译建设巩义企业网站建设
  • 做网站 编程语言全网软文推广
  • 公司网站域名及空间阿里云 ip 网站
  • wordpress博客建站外包加工网合法吗
  • 建设企业网站需要注意的问题东莞市保安公司排名
  • 勒流网站制作网站平台建设需要哪些人员
  • 网站已经克隆好了 怎么做仿站网站续费后为何还不能用
  • 男女做那个暖暖网站网站英文域名怎么查
  • 微商城网站建设流程方案wordpress个人支付宝
  • 广州专业网站设计公司公司小程序制作
  • wordpress免费建站教程龙口网站建设价格
  • 怎么把别人网站的tag写上自己的成都营销型网站制作公司
  • 深圳专业网站建设产品运营之中的广度讲解app下载的视频为什么手机找不到
  • 网站编程设计如何写备注音乐中文网站模板
  • flash网站制作工具海口网站建设加q.479185700
  • 建设网站的费用吗大学生做家教比较好的网站
  • 学校门户网站开发制作一个网页需要花钱吗