zoukankan      html  css  js  c++  java
  • Apache 搭建虚拟主机

    Apache 搭建虚拟主机方法

    DocumentRoot: /home/fdipzone/sites/demo.fdipzone.com
    ServerName:demo.fdipzone.com

    1.进入apache虚拟主机设置目录

    cd /etc/apache2/sites-available

    2.创建文件demo.fdipzone.com

    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
    
            DocumentRoot /home/fdipzone/sites/demo.fdipzone.com
            ServerName demo.fdipzone.com
            ServerAlias demo.fdipzone.com
            <Directory "/home/fdipzone/sites/demo.fdipzone.com">
                    allow from all Options + Indexes
            </Directory>
    </VirtualHost>
    
    3.激活虚拟主机配置
    sudo a2ensite demo.fdipzone.com
    4.进入 /etc/apache2/sites-enabled/目录,可以查看所有激活的虚拟主机。可以用 sudo a2dissite demo.fdipzone.com 注销

    cd /etc/apache2/sites-enabled
    ls -lt
    显示
    lrwxrwxrwx 1 root root 36 2013-04-05 17:29 demo.fdipzone.com -> ../sites-available/demo.fdipzone.com
    5.重启apache服务
    sudo /etc/init.d/apache2 restart
    6.ubuntu 设置host
    vim /etc/hosts
    127.0.0.1 demo.fdipzone.com
    7.<Directory>设置开启.htaccess与显示目录结构列表
    <Directory "/home/fdipzone/demo.fdipzone.com">
    AllowOverride none
    AllowOverride all
    Options -Index FollowSymLinks
    </Directory>
    AllowOverride none 表示关闭.htaccess,如要开启可设置为AllowOverride all
    Options -Indexes 表示关闭目录结构显示,如要开启可设置为 Options Indexes
    Options FollowSymLinks 表示支持symbol link(软连接),如要关闭可设置为Options -FollowSymLinks


  • 相关阅读:
    HttpRunnerManager使用(一)
    python入门(七):字符串
    python入门(六):函数
    python入门(五):切片列表元祖字典
    python入门(四):字符串、编码、random
    HttpRunnerManager安装部署
    python入门(三):循环
    python入门(二):isinstance、内置函数、常用运算等
    js 去掉空格
    JQ赋值
  • 原文地址:https://www.cnblogs.com/fdipzone/p/3715127.html
Copyright © 2011-2022 走看看