Apache DocumentRoot to a Network Directory for Virtual Host

15,659

Here is Answer http://adam-carter.com/posts/158

  1. Change your DocumentRoot to the network share (drive remapping doesn’t seem to work). Example: DocumentRoot “//path/to/share”

  2. Make sure to update the DocumentRoot path in your config

  3. Edit the Apache service and On the “Log On’” tab, click the “Browse” button next to the “This account” radio button.

  4. Type in an account name that has access privileges to the network share and click “OK”

  5. Enter the correct password for the user Restart Apache and LOL your way to the bank.

Using this you can add Network Drive, Network Directory to both Virtual Host as well as in Alias.

Share:
15,659
Wasim A.
Author by

Wasim A.

[email protected] | Skype:wasimxe | Whatsapp: +923455407008

Updated on August 07, 2022

Comments

  • Wasim A.
    Wasim A. over 1 year
    NameVirtualHost *:80
    <VirtualHost *:80>
    ServerName tmp
    DocumentRoot "//192.168.1.25/www/"
    <Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>
    

    This configuration is not working, Services can't start from Services.msc but if i tried to run httpd.exe in cmd.exe then it successful and obviously its not good way.

    I have tried Alias but still not working, services Run but when i access its 403 Access Error.

    I tried Map Network Drive to Z: but Services Fail to run from Services.msc

    Do any one have good solution to Run Apache DocumentRoot from a Network Directory or Network Drive for virtual host.