httpd apache

虚拟主机

配置环境

[root@localhost ~]#cd /var/www/html/
[root@localhost html]#mkdir 123
[root@localhost html]#mkdir abc
[root@localhost html]#ls
123  abc
[root@localhost html]#cd 123/
[root@localhost 123]#echo 123 > index.html
[root@localhost 123]#cd ../abc/
[root@localhost abc]#echo abc > index.html
[root@localhost abc]#cat index.html 
abc
[root@localhost abc]#cd ../123/
[root@localhost 123]#cat index.html 
123
[root@localhost 123]#systemctl restart httpd

 一、 基于IP

[root@localhost ~]#vim /etc/httpd/conf.d/test.conf

二、基于端口

[root@localhost ~]#vim /etc/httpd/conf.d/test.conf

[root@localhost ~]#vim /etc/httpd/conf/httpd.conf

三、基于域名

[root@localhost ~]#vim /etc/httpd/conf.d/test.conf

[root@centos7-2 ~]#vim /etc/hosts

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-20 10:22:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-20 10:22:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-02-20 10:22:02       87 阅读
  4. Python语言-面向对象

    2024-02-20 10:22:02       96 阅读

热门阅读

  1. Runtime

    2024-02-20 10:22:02       49 阅读
  2. 头歌:共享单车之数据分析

    2024-02-20 10:22:02       50 阅读
  3. 每天一个数据分析题(一百五十九)

    2024-02-20 10:22:02       64 阅读
  4. 23种设计模式-Golang(完整版)

    2024-02-20 10:22:02       43 阅读