× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Apache Virtual Host inherits default server Alias/Locations

lkeagle
Follower

Apache Virtual Host inherits default server Alias/Locations

I'm trying to configure the apache server in my Duo to support named virtual hosts from the internet. What I want is to allow my Public share to be served by the _default_:80 VirtualHost and be password protected, but I also want to be able to set up a specific directory to be served as a different ServerName on my domain. The problem I am seeing is that because of the way the Duo is configured, my virtual hosts inherit all of the Aliased locations from the main server.

Here is an example:

http://www.mydomain.org/ redirects to http://www.mydomin.org/Public because of the rewrite rules in the _default_ virtual host.
http://otherhost.mydomain.org/ serves files from /c/OtherHost (not necessarily a shared directory. Contains some symbolic links to other shared directories, however).

My problem is this:

http://otherhost.mydomain.org/Public still shares the Public folder, and I assume that all of the other shares are available in the same manner, as well as /admin, /password_reset, and everything else Aliased with <Location> tags in the main server.

This sort of goes against the idea that otherhost.mydomain.org be viewed as an isolated virtual server if it picks up all the shares of the main server. Is there any way to reconfigure my new virtual host such that it ignores all of the aliases and shares created in the main server?

I realize this may be complicated due to the fact that the Shares.conf file seems to be autogenerated. Otherwise I would just move all of the Alias and Location directives into my default VirtualHost and be done with it, but that doesn't solve how to hide the Shares.conf Aliases from otherhost.mydomain.org.

Here is the relevant VirtualHost sections in my Virtual.conf file:


NameVirtualHost *:80

<VirtualHost _default_:80>
SSLEngine off
RewriteEngine on
RewriteRule ^/$ /Public [R,L]
RewriteRule ^/admin/(.*)$ https://%{SERVER_NAME}/admin/$1 [R,L]
</VirtualHost>

<VirtualHost *:80>
SSLEngine off
RewriteEngine off
ServerName otherhost.mydomain.org
DocumentRoot /c/OtherHost
ErrorLog /var/log/frontview/error.otherhost.log
<Directory "/c/OtherHost">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>



Any help is appreciated,

~Loren
Message 1 of 2
placid2000
Aspirant

Re: Apache Virtual Host inherits default server Alias/Locati

Hello Loren

I'm encountering the same issue.
Were you able to find a solution? Could you help me out?

Thx in advance
Cyril
Message 2 of 2
Top Contributors
Discussion stats
  • 1 reply
  • 3348 views
  • 0 kudos
  • 2 in conversation
Announcements