logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Route traffic to an index on a network connected server/PC
Author
shred67



Joined: 24 Mar 2022
Posts: 3
Location: UK

PostPosted: Fri 25 Mar '22 14:24    Post subject: Route traffic to an index on a network connected server/PC Reply with quote

Good Afternoon all,

Very new to Apache web server so looking for a few pointers.

I have installed Apache 2.4.53 on a Windows 10 machine for testing. I have successfully installed 3 websites in the htdocs folder and have created links to the site through the httpd-vhosts.conf. I can now reach all of the sites through my web explorer.

Is there a way to route incoming clients to a site that is on another machine attached to the same network?

Something like the following:
Code:
<VirtualHost *:80>
    ServerAdmin xxxx@gmail.com
    DocumentRoot "192.168.2.94\ProgramData\Niagara4.9\vykon\stations
\Thermatic_TEC\shared\viewBuilder\Niagara49\index.html"
    ServerName 192.168.2.94
    ServerAlias www.cloudabc123.co.uk
    ErrorLog "logs/www.cloudabc123.co.uk-error.log"
    CustomLog "www.cloudabc123.co.uk-access.log" common
</VirtualHost>


Or am I going in the totally wrong direction.

Any pointers would be greatly appreciated.


Last edited by shred67 on Fri 25 Mar '22 16:02; edited 1 time in total
Back to top
Otomatic



Joined: 01 Sep 2011
Posts: 212
Location: Paris, France, EU

PostPosted: Fri 25 Mar '22 15:47    Post subject: Reply with quote

Hi,

DocumentRoot must be the path to a folder, not to a file ans must use slash / not backslash \ even in Windows.

See : https://httpd.apache.org/docs/2.4/en/mod/core.html#documentroot
Back to top
shred67



Joined: 24 Mar 2022
Posts: 3
Location: UK

PostPosted: Fri 25 Mar '22 16:21    Post subject: Reply with quote

Thank you for the speedy reply and for pointing out my schoolboy errors.

So I am presuming that as long as the server can see the file over the network then it is possible to present the site out to clients?
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 348
Location: UK

PostPosted: Fri 25 Mar '22 21:51    Post subject: Reply with quote

DocumentRoot needs to be local to the Apache server, but you can present content shared from a remote server using an alias.

In the past I've used a UNC share reference to remote site content as follows:

Code:
Alias / "\\\\Remote_Server/Shared_Content/"

<Directory "\\\\Remote_Server/Shared_Content/">
  Options None
  AllowOverride None
  Require all granted
</Directory>

Set Alias as required ("/" for the whole site), or a path below the site root as required.

Of course, you need to configure suitable share permissions to allow the Apache server access.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sat 26 Mar '22 0:15    Post subject: Reply with quote

There might be also the need to change the user for the apache service. The default system account isn't allowed to access external drives / paths.
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 348
Location: UK

PostPosted: Sat 26 Mar '22 0:33    Post subject: Reply with quote

Thanks James for pointing out this omission. You're absolutely right; a named account is needed, which brings with it potential problems with password ageing (if AD domain policies apply).
Back to top
shred67



Joined: 24 Mar 2022
Posts: 3
Location: UK

PostPosted: Mon 28 Mar '22 9:50    Post subject: Reply with quote

Thanks for the pointers I will give this a go.
Back to top


Reply to topic   Topic: Route traffic to an index on a network connected server/PC View previous topic :: View next topic
Post new topic   Forum Index -> Apache