http://www.tootoogo.org/wordpress/?p=230

apache的配置由httpd.conf 文件配置。

1.基本配置

ServerRoot "/mnt/software/apache2" 你的Apache软件安装的位置。

(其它指定的目录如果没有指定绝对路径,则目录是相对于该路径)

PidFile logs/httpd.pid 

listen 80 

ServerName www.lxdisk.com:80 

ServerAdmin admin@clusting.com 

DounmentRoot "/mnt/web/lxdisk"

以下是对主站点的目录进行访问控制:

<Directory "/mnt/web/lxdisk">

Options FollowSymLinks

AllowOverride None

Allow from all

</Directory>

 Apache 在接受请求时,首先会在默认第一个VirtualHost,然后再找匹配的,如果没有匹配的,就是第一个VirtualHost起作用。

  <VirtualHost *:80>

   ServerName *

   DocumentRoot </opt/lampp/htdocs/guest>

   <Directory /opt/lampp/htdocs/guest>

     Order deny,allow

     Allow from all

   </Direcotry>

  <VirtualHost/>

后面的,依次添加就可以

  <VirtualHost *:80>

   ServerName www.myweb1.com

   DocumentRoot </opt/lampp/htdocs/myweb1>

   <Directory /opt/lampp/htdocs/myweb1>

     Order deny,allow

     Allow from all

   </Direcotry>

  <VirtualHost/>

 

相关文章:

  • 2021-08-16
  • 2021-11-28
  • 2022-12-23
  • 2021-09-27
  • 2021-10-06
  • 2021-07-15
  • 2021-06-01
  • 2021-05-09
猜你喜欢
  • 2021-05-17
  • 2021-09-19
  • 2022-12-23
  • 2021-04-17
  • 2021-11-19
  • 2021-07-15
  • 2022-12-23
相关资源
相似解决方案