zoukankan      html  css  js  c++  java
  • 安装Apache配置虚拟目录

    首先在apache的安装目录下找到conf目录下找到httpd.conf文件

    然后搜索hosts找到 把前面的井号去掉即可启动虚拟主机

    2、然后在apache的安装目录下找到conf目录下的extra找到httpd-vhosts.conf文件

    1. #配置我们自己的虚拟主机  
    2. <VirtualHost *:80>  
    3.     #修改文档根路径  
    4.     DocumentRoot "D:/Program Files (x86)/myenv/apache2.2.25/htdocs"  
    5.     #主机名称  
    6.     ServerName myvirtualhost.com  
    7.     #欢迎页面  
    8.     DirectoryIndex index.html  
    9.     <Directory "D:/Program Files (x86)/myenv/apache2.2.25/htdocs">  
    10.     Options -Indexes FollowSymLinks  
    11.     AllowOverride None  
    12.     Order allow,deny  
    13.     Allow from all  
    14.     </Directory>  
    15.     #错误日志存放位置  
    16.     ErrorLog "logs/myvirtualhost.com-error.log"  
    17.     CustomLog "logs/myvirtualhost.com-access.log" common  
    18. </VirtualHost>  
    19. 在host文件中添加虚拟主机  高亮部分

    20. 二、apache虚拟目录的配置

      1、首先在apache的安装目录下找到conf目录下找到httpd.conf文件

      搜索DocumentRoot  找到下面的位置 自定义的时候可以把这个关闭 ,不关闭好像也没影响

      2、找到<IfModule>这块,加入下面的代码

      1. # 虚拟目录,访问D盘下面的web目录  
      2. <IfModule dir_module>  
      3.     # 设置缺省载入页面  
      4.     DirectoryIndex index.html index.htm index.php  
      5.     # 设置站点别名,别名与访问路径是相关的,取任何名称都可以(除特殊)  
      6.     Alias /myweb "D:/web"  
      7.     <Directory D:/web>  
      8.     # 设置访问权限  
      9.         Order allow,deny  
      10.     Allow from all  
      11.     </Directory>  
      12. </IfModule>  

      修改完成后重启Apache服务器 在浏览器中输入:http://localhost/myweb/xx.php 来访问 D:/web 下的文件

  • 相关阅读:
    WIDER Face 转为 COCO 格式标签
    latex转word
    No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
    COCO数据集使用super categories时出现IndexError: list index out of range
    VS Code 中 torch has no xxx member
    Anaconda中安装Cascade RCNN(Detectron)的若干问题
    fatal error: nvcuvid.h: No such file
    hive一些语句
    端口号
    hadoop错误: 找不到或无法加载主类 org.apache.hadoop.mapreduce.v2.app.MRAppMaster
  • 原文地址:https://www.cnblogs.com/cgdblog/p/7639550.html
Copyright © 2011-2022 走看看