1.将www.aaa.com 与 www.bbb.com 的DNS解析到你的服务器上

2.添加两个发布目录 /var/www/html/aaa  /var/www/html/bbb

3.修改配置文件.进入目录/etc/apache2/sites-enabled.复制000-default文件->001-default

编辑000-default

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
<VirtualHost *:>
        ServerName www.aaa.com
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/aaa
   <Directory />
      Options FollowSymLinks
      AllowOverride None
   </Directory>
   <Directory /var/www/aaa/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
   </Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all
   </Directory>

#ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

#CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow 
    </Directory>

</VirtualHost>

编辑001-default

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
<VirtualHost *:>
        ServerName www.bbb.com
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/bbb
   <Directory />
      Options FollowSymLinks
      AllowOverride None
   </Directory>
   <Directory /var/www/bbb/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
      Order allow,deny
      allow from all
   </Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   <Directory "/usr/lib/cgi-bin">
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all
   </Directory>

#ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn

#CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow 
    </Directory>

</VirtualHost>

apache详细权限在以上配置文件修改就行。

ubuntu apache 一个ip绑定多个域名,发布目录的更多相关文章

  1. apache一个IP绑定多个域名

    用ServerAlias <VirtualHost *:80>ServerAdmin i@kuigg.comDocumentRoot /www/kuigg.comServerName ku ...

  2. tomcat一个IP绑定多个域名,不同域名访问不同的应用

    修改conf文件夹下面的server.xml的Engine里面的内容即可原始内容如下: …… <Engine name="Catalina" defaultHost=&quo ...

  3. Tomcat配置一个ip绑定多个域名

    在网上找了半天也没找到相关的资料,都说的太含糊. 本人对tomcat下配置 一ip对多域名的方法具体例如以下,按以下配置一定能成功,经过測试了. <Host name="localho ...

  4. Tomcat 下配置一个ip绑定多个域名

    原文:http://pkblog.blog.sohu.com/68921246.html 在网上找了半天也没找到相关的资料,都说的太含糊.本人对tomcat下配置 一ip对多域名的方法详细如下,按下面 ...

  5. 一个IP绑定多个域名的实现方法

    方案一: 文字叙述: 具体步骤如下:比如讲apache服务器127.0.0.1 配置成 www.sohu.com 首先在http.conf文件中 做如下处理: ①关闭默认的 #DocumentRoot ...

  6. 一个IP绑定多个域名

    http://www.zhihu.com/question/29390934/answer/44252886

  7. APACHE如何里一个站点绑定多个域名?用ServerAlias servername

    APACHE2如何里一个站点绑定多个域名?用ServerAlias以前很笨,要使多个域名指向同一站点总是这样写: <VirtualHost *:80>ServerAdmin i@kuigg ...

  8. 配置Nginx支持SSL SNI(一个IP绑定多个证书) 以及Haproxy实现多域名证书

    概述 传统的每个SSL证书签发,每个证书都需要独立ip,假如你编译openssl和nginx时候开启TLS SNI (Server Name Identification) 支持,这样你可以安装多个S ...

  9. APACHE如何里一个站点绑定多个域名?用ServerAlias

    APACHE2如何里一个站点绑定多个域名?用ServerAlias以前很笨,要使多个域名指向同一站点总是这样写: <VirtualHost *:80>ServerAdmin i@kuigg ...

随机推荐

  1. Scrum立会报告+燃尽图 02

    本次作业要求参见:https://edu.cnblogs.com/campus/nenu/2019fall/homework/9912 一.小组情况组长:贺敬文组员:彭思雨 王志文 位军营 徐丽君队名 ...

  2. 简易的文件上传 tp5

    /** * 保存新建的资源 * @return \think\Response */ public function save() { //判断一下提交类型 if ($this->request ...

  3. spark MLlib 概念 1:相关系数( PPMCC or PCC or Pearson's r皮尔森相关系数) and Spearman's correlation(史匹曼等级相关系数)

    皮尔森相关系数定义: 协方差与标准差乘积的商. Pearson's correlation coefficient when applied to a population is commonly r ...

  4. Win10卸载预装应用

    Win10的预装应用大多数都比较鸡肋,没啥用,喜欢纯净的系统的朋友可以将其卸载掉. 1.以管理员身份启动powershell,键入命令[Get-AppxPackage | Select Name, P ...

  5. Windows 10下怎么远程连接 Ubuntu 16.0.4(小白级教程)

    前言: 公司因为用Ruby做开发,所有适用了Ubuntu系统,但是自己笔记本是W10,又不想装双系统,搭建开发环境,便想到倒不如自己远程操控公司电脑,这样在家的时候也可以处理一些问题.故此便有了下面的 ...

  6. [flask-sqlalchemy]倒序查询结果

    按创建时间倒序查询测试用例 >>> a= TestCase.query.order_by(TestCase.create_time.desc()).first() >>& ...

  7. Go语言基本类型

    1.Go语言fmt包详解 fmt.Println() ###常用打印 fmt.Print() fmt.Printf() ###格式化 fmt.Sprintf() ###字符串拼接 a)普通占位符 占位 ...

  8. iOS charts CombinedChartView First and last bars are shown half only

    charts 使用CombinedChartView 绘图时,发现第一个和最后一个bar只能显示一半的问题,解决方法: ChartXAxis *xAxis = chartView.xAxis; xAx ...

  9. WPF图标拾取器

    <Grid x:Name="LayoutRoot"> <Border BorderBrush="> <Border.Effect> & ...

  10. 替换RTXLogo插件说明

    一.包含Logo图标文件介绍 (一)桌面图标包含在RTX.exe (二)桌面右下角图标包含在MainFrameRes.dll (三)RTX设置图标包含在Config.dll (四)查看用户信息图标包含 ...