• lampp服务器配置httpd-vhosts.conf文件,设置多域名


    首先,修改/opt/lampp/etc/httpd.conf文件,开启虚拟主机功能

    找到配置项

    # Virtual hosts
    # Include etc/extra/httpd-vhosts.conf

    修改为

    # Virtual hosts
    Include etc/extra/httpd-vhosts.conf

    然后,修改:/opt/lampp/etc/extra/httpd-vhosts.conf文件

    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "/home/www/aaa"
        ServerName www.aaa.com
        ServerAlias www.dummy-host.example.com
        ErrorLog "logs/dummy-host.example.com-error_log"
        CustomLog "logs/dummy-host.example.com-access_log" common
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerAdmin webmaster@dummy-host2.example.com
        DocumentRoot "/home/www/bbb"
        ServerName www.bbb.com
        ErrorLog "logs/dummy-host2.example.com-error_log"
        CustomLog "logs/dummy-host2.example.com-access_log" common
    </VirtualHost>

    然后,重启apache,按照上面配置后,www.aaa.com对应/home/www/aaa目录;www.bbb.com对应/home/www/bbb目录。

  • 相关阅读:
    码云的安装和配置
    Python解释器安装教程和环境变量配置
    Python基础学习
    buuctf CheckIn
    各种小马收集
    buuctf Easysql 小记
    locust
    封装好的日志模块
    实用的测试网站
    列表操作
  • 原文地址:https://www.cnblogs.com/hereim/p/3936839.html
Copyright © 2020-2023  润新知