Author |
|
shred67
Joined: 24 Mar 2022 Posts: 3 Location: UK
|
Posted: Fri 25 Mar '22 14:24 Post subject: Route traffic to an index on a network connected server/PC |
|
|
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
|
|
Back to top |
|
shred67
Joined: 24 Mar 2022 Posts: 3 Location: UK
|
Posted: Fri 25 Mar '22 16:21 Post subject: |
|
|
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
|
Posted: Fri 25 Mar '22 21:51 Post subject: |
|
|
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
|
Posted: Sat 26 Mar '22 0:15 Post subject: |
|
|
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
|
Posted: Sat 26 Mar '22 0:33 Post subject: |
|
|
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
|
Posted: Mon 28 Mar '22 9:50 Post subject: |
|
|
Thanks for the pointers I will give this a go. |
|
Back to top |
|