apache on windows virtual directory config help

2020-05-22 07:57发布

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 source files to live outside of the xampp htdocs dir
  2. on my local machine I can access the project at http://myproject
  3. others on my local network can access the project at my.ip.address/myproject
  4. keep localhost pointing to the xampp's htdocs folder so I can easily add other projects.

I've got 1 & 2 working by editing the windows hosts file, and adding a virtual directory in xampp's apache\conf\extra\httpd-vhosts.conf file. I don't immediately see how to do 3 without messing up 4.

7条回答
倾城 Initia
2楼-- · 2020-05-22 08:47

In httpd.conf add the following lines, mutatis mutandis:

<IfModule alias_module>
    Alias /angular-phonecat "C:/DEV/git-workspace/angular-phonecat"
</IfModule>

<Directory "C:/DEV/git-workspace/angular-phonecat">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride all
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

This worked great on my (Windows) XAMPP installation after restarting the Apache server. I had to add the "Require all granted", but otherwise it is pretty much the same as the above answers.

查看更多
登录 后发表回答