Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Linux > a2ensite的使用方法
【标  题】:a2ensite的使用方法
【关键字】:a2ensite
【来  源】:http://www.cublog.cn/u/6418/showart.php?id=158789

a2ensite的使用方法

Your Ad Here Setting Up a Web Site

First, create a subdirectory of /var/www/ to contain the site. It makes sense to name this directory after the domain that will live there.

$> mkdir /var/www/mydomain.com

Now create the subdirectory /var/www/mydomain.com/docs/. This will be the only directory that is publicly accessible.

$> mkdir /var/www/mydomain.com/docs

Now create /var/www/mydomain.com/docs/index.html, something simple like the following:

<html>
<head>
<title>Mydomain.com test index page</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>

Now create /etc/apache2/sites-available/mydomain.com. We use the <VirtualHost> directive to define the virtual site, and the <Directory> directive to define the ...xxx/docs/ directory as publicly accessible (Allow from all). Like so:

<VirtualHost * >
#Basic setup
ServerAdmin webmaster@mydomain.com
ServerName www.mydomain.com
DocumentRoot /var/www/mydomain.com/docs

<Directory /var/www/mydomain.com/docs>
Order Deny,Allow
Allow from all
# Don't show indexes for directories
Options -Indexes
</Directory>
</VirtualHost>

Now, to enable the site you use the a2ensite command (Note:use a2dissite to disable). The following creates a symlink /etc/apache2/sites-enabled/mydomain.com, which enables the site.

$> a2ensite mydomain.com

You need to reload Apache to see the site...

$> /etc/init.d/apache2 reload

If DNS is working, you should now be able to point your browser at www.mydomain.com see the index.html page you created above.

推荐一个音乐播放器:【上一篇】
gcc libraries GNU FTP Mirror List:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • informix存储过程
  • 【收藏】开发J2ME的重要站点
  • RF WS5 上安装 mpich2 手记
  • IBM错误代码查询
  • 在listview 控件标题上添加图标的模块 (VB)
  • ASP环境下邮件列表功能的实现 (四)(推荐)
  • 直接使用ODBC API访问数据库的VB程序
  • Delphi设置专家
  • Office SharePoint Server 2007 搜索模块的两个“大”问题
  • WinCE源代码的一个Bug
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.