Matrix
Matrix

Reputation: 466

How to publish a virtual directory over IIS or XAMPP?

I have a virtual directory that points to a virtual drive on sql server. I need this directory to be accessible over the Internet, how do I do that? I've tried adding a virtual directory to default IIS website enter image description here When navigating over to localhost/magentofiles this is what I get. enter image description here

Of course it cannot find web.config...it's a directory not a project I'm trying to publish. Any help is much appreciated.

Upvotes: 0

Views: 614

Answers (2)

Matrix
Matrix

Reputation: 466

Since it didn't really matter whether to use IIS or XAMPP, I went with XAMPP because I could not solve the errors of IIS. Now here's how to publish a directory over xampp.

  • Create a directory in xampp/htdocs (let's say "files")
  • In cmd go to that new directory.
  • use mklink to create a symbolic link to your desired destination (let's say "images")

open up xampp\apache\conf\extra\httpd-vhosts.conf and at the bottom of the file append this code

<VirtualHost *:80>
    DocumentRoot "C:\xampp\htdocs\files"

    <Directory "C:\xampp\htdocs\files">
        Options FollowSymLinks Includes ExecCGI
        Require all granted
    </Directory>

</VirtualHost>
  • Restart apache

You should be able to access files in that directory over localhost/images/example.png

Also note that the user, which xampp runs by should have access to the destination that you are publishing, otherwise you will get 403 Access forbidden.

Upvotes: 1

samwu
samwu

Reputation: 5215

There are many reasons for this error, you can try the following methods to solve the problem:

  1. Right-click the website in your iis, then select Explore, check the current project folder if there is a web.config file, if there is then right click your web.config, expand properties, and under security tab, add IIS_IUSRS. Give the group read/write permissions.

  2. Right-click the application pool of your current project, select Advanced Settings, and then change the Identity to LocalSystem.

  3. Adding the IIS_IUSRS with read/write permissions to C:\inetpub\wwwroot.

Upvotes: 0

Related Questions