大多数情况下,在主机只有一个IP情况下,我们又想运行多个站点.那么就需要我们在不同的端口上运行不同的站点,进行相关的虚拟主机的配置,虚拟主机的常用相关配置选项说明如下所示.

<VirtualHost IP地址:端口号>
    DocumentRoot c:\xampp\htdocs\example1
    ServerName www.example1.com
    Serveralias example1.com
    ServerAdmin webmaster@wz120.cc
    ErrorDocument 404 http://www.example1.com/404.html
    ErrorLog c:\xampp\htdocs\example1\error.log
    <Directory c:\xampp\htdocs\example1>
                Options  FollowSYmLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                #deny from IP地址
    </Directory>
</VirtualHost>

DocumentRoot:指定站点目录
ServerName:指定域名
Serveralias:域名别名
ServerAdmin:服务器返回给客户端的错误信息中包含的邮件地址
ErrorDocument:定义了当遇到错误的时候服务器将给客户端什么样的回应
ErrorLog:定位服务器存放错误日志的位置
Directory:对具有某个名字的文件系统目录及其子目录起作用(参考:访问控制)

15 Comments

  1. Some time ago, I needed to buy a good car for my organization but I didn’t have enough cash and couldn’t purchase anything. Thank heaven my dude adviced to try to take the business loans from reliable bank. Hence, I did so and was satisfied with my short term loan.

发表评论

电子邮件地址不会被公开。 必填项已用*标注

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


*