zoukankan      html  css  js  c++  java
  • 虚拟站点配置

    一:
    Apacheconfextrahttpd-vhost.conf  虚拟目录配置文件

    添加两个站点

    <VirtualHost *:80>
    #    ServerAdmin webmaster@dummy-host.example.com
        DocumentRoot "C:/www/w1"
        ServerName w1.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-host.example.com
        DocumentRoot "C:/www/w2"
        ServerName w2.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>


    二:
    修改Apacheconfhttpd.conf,包含httpd扩展
    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf

    三:


    修改http.conf,允许其它ip访问



    四:
    windows下修改
    C:WINDOWSsystem32driversetchosts
    增加

    linux下
    vi /etc/hosts
    -----------------------------------linux下---------------------

    在ubuntu server搭建LAMP环境
    ----------------------------安装--------------------------------
    su、sudo获取root权限
    sudo apt-get update 更新软件园本地列表
    apt-get安装的软件,默认配置文件都在/etc下
    /etc/apache2   /etc/mysql  /etc/php5

    sudo apt-get install apache2
    apache2 -v
    sudo apt-get install php5
    php5 -v
    查看apache是否加载php模块
    cat /etc/apache2/mods-enabled/php5.load
    sudo apt-get install mysql-server
    查看mysql.so是否加载,php在安装过程中并不默认加载mysql.so扩展,需要手动安装
    cat /etc/php5/conf.d/mysql.ini
    手动安装mysql扩展
    sudo apt-get install php5-mysql

    一步到位
    二:
    sudo ap-get install apache2 php5 mysql-server php5-mysql
    三:
    sudo tasksel install lamp-server
    ---------------------------扩展--------------------------------------

    php添加常用扩展
    sudo apt-get install php5-gd curl libcurl3 libcurl3-dev php5-curl


    ----------------------------虚拟主机---------------------------------
    vi /etc/hosts
    主机ip       test1.com
    主机ip       test2.com
    主机ip       test3.com
    二级域名全部解析到了  主机ip

    sudo mkdir -p /var/wwwroot/{test1,test2,test3}
    在apache中配置虚拟主机

    cat /etc/apache2/sites-available/default

    cp default test1
    增加:ServerName test1.com
    修改DocumentRoot /wwwroot/test1
    修改<Directory /wwwroot/test1/>

    启用配置文件,建立软ln
    cd ../sites-enanled/
    sudo ln -s ../sites-available/test1 test1

    重启apache2
    vi /etc/mysql/my.cnf
    #bind-address            = 127.0.0.1
    在phpmyadmin中修改

  • 相关阅读:
    hdoj 2803 The MAX【简单规律题】
    hdoj 2579 Dating with girls(2)【三重数组标记去重】
    hdoj 1495 非常可乐【bfs隐式图】
    poj 1149 PIGS【最大流经典建图】
    poj 3281 Dining【拆点网络流】
    hdoj 3572 Task Schedule【建立超级源点超级汇点】
    hdoj 1532 Drainage Ditches【最大流模板题】
    poj 1459 Power Network【建立超级源点,超级汇点】
    hdoj 3861 The King’s Problem【强连通缩点建图&&最小路径覆盖】
    hdoj 1012 u Calculate e
  • 原文地址:https://www.cnblogs.com/lly-lly/p/5492153.html
Copyright © 2011-2022 走看看