Re: Subdomain to other domain sub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thierry Lavallée wrote:
Can you guide on creating an alias or link in the filesystem?
Also will this run without warning through HTTPS?!

Note that this is not something that I would recommend as good practice, but I will suppose that you know what you are doing.


Suppose you have two VirtualHost's as follows :

<VirtualHost *>
  ServerName host1.company1.com
  DocumentRoot /var/www/host1/docs
  ...
</VirtualHost>

<VirtualHost *>
  ServerName host2.company2.com
  DocumentRoot /var/www/host2/docs
  ...
</VirtualHost>

And suppose that the documents to "share" originally belong to host2 and are located at : /var/www/host2/docs/shareddocs

Then, in the configuration of host1 above, add
Alias /something /var/www/host2/docs/shareddocs
and
<Directory /var/www/host2/docs/shareddocs>
  Order allow,deny
  Allow from all
</Directory>

Now if with a browser you ask for http://host1.company1.com/something, you will get the documents of /var/www/host2/docs/shareddocs. And if you ask for http://host2.company2.com/shareddocs, you will get the same documents.

HTTPS will not make a difference, because these documents still look like they are "in the web space" of each server.

If I was you, rather than allowing host1 to "peek" into a directory belonging to the host2 document structure, I would create another separate directory /var/www/SHARED/docs, I would put the shared documents there, and in *both* VirtualHost I would create an alias
Alias /something /var/www/SHARED/docs
and a corresponding <Directory> section

Just to make it clear and not forget that I am doing this, and thus allowing two websites with maybe different owners and users and permissions and applications to access the same physical documents.
Because for instance :
- if you add/remove/change a document there later, it is immediately visible by both sites, not just one (which is maybe what you want, but..) - if you add/remove/change a document there later, it may work well with the one site, but break the other - if someone else later looks only at the configuration of host2, he may not realise that these documents are also part of, and visible by host1, and do something he should not - if these documents themselves contain links to other documents that live in another part of the web space (e.g. href="/js/mylibrary.js"), these "linked to" documents need to exist in both websites
etc..

And don't forget to add /var/www/shared in your backup procedures.








thanks!!!

On Wed, Oct 22, 2008 at 5:35 PM, Nick Kew <nick@xxxxxxxxxxxx> wrote:

Thierry Lavallée wrote:

I need to set up so that a subdomain looks in a sub folder of ANOTHER
DOMAIN on the same machine.

If they're on the same machine, forget about domains and just
use an alias.  Or even a link in the filesystem.

--
Nick Kew


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
 "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx






---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux