apache on windows virtual directory config help

前端 未结 7 458
萌比男神i
萌比男神i 2021-02-04 02:25

I\'m running Apache on Windows XP via Xampplite, and could use help configuring my virtual directory. Here\'s what I\'m hoping to do on my dev box:

  1. I want my sourc
7条回答
  •  梦毁少年i
    2021-02-04 03:03

    To accomplish your list of needs.

    1) Make the directory:

    mkdir c:\xampp\sites\myproject

    2) Edit c:\windows\system32\drivers\etc\hosts so it contains this line:

    127.0.0.1         myproject

    and add the following to c:\xampp\apache\conf\extra\httpd-vhosts.conf:

      NameVirtualHost myproject:80
    
      
      DocumentRoot c:/xampp/sites/myproject
      Options Indexes FollowSymLinks Includes ExecCGI
       AllowOverride All
      Order allow,deny
      Allow from all  
      
    

    3) Add the following lines to the end of c:\xampp\apache\conf\httpd.conf:

      Alias /myproject/  "/xampp/sites/myproject/"
    
      
      AllowOverride None
      Options None
      Order allow,deny
      Allow from all
      
    

    4) Leave DocumentRoot, Directory, etc in c:\xampp\apache\conf\httpd.conf alone to accomplish this. For reference these lines would be:

      DocumentRoot "/xampp/htdocs"
    
      
       Options FollowSymLinks
       AllowOverride None
       Order deny,allow
       Deny from all
      
    
      
       Options Indexes FollowSymLinks Includes ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
      
    

提交回复
热议问题