简体   繁体   中英

Problems with network shares using Apache on Windows server 2019 Standard

I am replacing an old web server running IIS 7 (?) with a new server running XAMPP (Apache 2.4) on a Windows Server 2019 Standard machine. I have a couple of.network shares with content I need to display, but I cannot get Apache configured correctly. I am calling one such.network folder "eom".

I created a new user specfically to run the Apache service, the user account has.network access, and I have the service running as that user. That user (as well as my own user account) has full control/access to the.network folder identified below.

I have tried simply identifying the.network location with a block, like this:

<Directory "//OLDSERVER/data/eom">
  AllowOverride None
  Allow from All
  Options +FollowSymLinks
</Directory>
Alias /eom/ "//OLDSERVER/data/eom"

In this case, "/data" is a shared folder. If I try it with the drive letter identified like "//OLDSERVER/c$/data/eom", Apache doesn't like it. It says the path is invalid.

I have also tried creating a symbolic link called "eom" and pointing to the same folder with this command:

mklink /D eom \\OLDSERVER\data\eom 

When I created the symlink, I commented out the block in the config file. Nothing is working. No matter how I try it, the response I get is "403 Forbidden You don't have permission to access this resource."

I have also tried starting the web service as myself, especially when testing the symbolic link, but I always get the same result.

Any help is appreciated.

FINALLY figured it out: The steps are (all from the web server):

  1. make sure you have access rights to the content you are trying to share

  2. find the IP address of the remote server with the needed content

    ping -a \OLDSERVER

  3. navigate to your web root folder, in my case "c:\xampp\htdocs".

  4. use "mklink" to create a symbolic link:

    mklink /D eom \10.20.30.40\data\eom

  5. add block in your httpd.conf file:

    <Directory "/eom"> AllowOverride none Allow from All Options +FollowSymLinks

  6. restart Apache

Now you can test. There may be other ways to do it, but this is what has finally worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM