文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>a2ensite的使用方法

a2ensite的使用方法

时间:2006-08-22  来源:nothing9

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 [email protected]
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.

相关阅读 更多 +
排行榜 更多 +
末日枪战精英手机版

末日枪战精英手机版

飞行射击 下载
末日模拟生存最新版

末日模拟生存最新版

飞行射击 下载
末日求生枪战安卓版

末日求生枪战安卓版

飞行射击 下载