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

[EP-tech] technical question: one archive with two domains



Hey there,
I finally solved my problem using the same archive with two domains. After
trying and failing with any "nice" configurations, I used mod_substitute
and it works great (on my low-traffic site).
Here are my steps:
Create your archive with only one domain (eg domain1.com). epadmin will do
this work, if you have an archive already you can use this one.
copy your apache config file .../eprints/apache/domain1.conf to
.../eprints/apache/domain2.conf and change the line 'ServerName domain1.com'
to 'ServerName domain2.com'
Add these lines in the <VirtualHost *:80> ... </VirtualHost> block:
<Location "/">
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s;domain1.com;domain2.com;ni"
</Location>
Reload apache, eprints should now work as intended.

If you have to use https, it changes a little bit. I didn't find a way to
use both domain1 and domain2 with http and https, so I configured domain1
with https as usual (see eprints manual) and copied
.../eprints/apache/domain1.conf to .../eprints/apache_ssl/domain2.conf.
Then I added the certificate files for domain2, changed server name, added
the line 'PerlSetVar EPrints_Secure yes' in the <Location ""> ...
</Location> block and added a modified version of the substitution:
<Location "/">
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s;http://domain1.com;https://domain2.com;ni";
</Location>
At last, I redirected http://domain2.com to https://domain2.com (if you
enable both http and https, http://domain2.com will change to
https://domain1.com during login.

This works fine for me, its not the best option, but it is okay.

Thank you again for your help,
best regards

Thorsten Buelo

University of Cologne
Institut fuer Informatik
www.informatik.uni-koeln.de





On 9 March 2017 at 13:09, Thorsten B?lo <thorsten.buelo at gmail.com> wrote:

> Hey there,
> I'm still trying to configure my eprints archive to work with two domains.
> I tried all your suggestions (except mod_substitute) in different ways, but
> it still don't work.
> My goal: I want to access one archive using two different domains. So I
> modified the apache-includes to add a ServerAlias, this part works fine:
> domain1 and domain2 show the exact same website. My problem: It is the
> EXACT same website, so all links are the same, too. So if i use one of the
> links on domain2, I go to domain1 and do not remain on domain2.
> Do you have any more ideas why this could happen and how to avoid it?
>
> On my way finding a solution, I tried to modify the html-snippets used to
> build the website - this worked for some parts, but changing other parts
> killed the whole site. My idea was to change all links manually (if it was
> working, i would automate this with a little script). Do anybody know the
> part/script of eprints which combines the html snippets? I hope that
> reading this script might help me to modify my repo.
>
> Thany you again for your help,
> best regards
>
> Thorsten Buelo
> University of Cologne
> Institut fuer Informatik
> www.informatik.uni-koeln.de
>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 18 Jan 2017 17:02:34 +0100
>> From: Thorsten B?lo <thorsten.buelo at gmail.com>
>> Subject: Re: [EP-tech] Antwort: technical question: one archive with
>>         two     domains
>> To: eprints-tech at ecs.soton.ac.uk
>> Message-ID:
>>         <CABvrU_81MN+CcGbdBYBXe5_AC71Pab0bRMPabRHU90O6hxgtnw at mail.
>> gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> Hey,
>> thank you very much for your answers.
>> I tried to configure a test repository like you suggested.
>> I tried to configure /cfg.d/10_core.pl manually and added a ServerAlias
>> at
>> the apache config files. This didn't work, so i used epadmin config-core
>> to
>> add a second url. I tried to use a second virtual host in the apache
>> config
>> instead of ServerAlias, too. But my problem still remains: if i access the
>> repo using the new domain, i reach it, but it is equivalent to a redirect.
>> All links are hardlinks, if i use one of them, i get redirected to the old
>> domain. It seems that changing 10_core.pl does not affect my repo in any
>> way. Reloading or regenerating with epadmin does not help.
>> So i tried to set up a new test repo with 'epadmin create' and defined a
>> second url in this process, setting redirecting to 'no'. The result still
>> remains the same - i can access it with both domains, but all links point
>> to the main domain.
>> Do you have any ideas of what I could have done wrong?
>> Using apaches mod_substitute is still an option, but I think that there
>> should be a better solution.
>> Thank you very much,
>> best regards
>>
>> Thorsten Buelo
>>
>> University of Cologne
>> Institut fuer Informatik
>> www.informatik.uni-koeln.de
>>
>> >
>> > Message: 1
>> > Date: Wed, 18 Jan 2017 08:14:31 +0100
>> > From: martin.braendle at id.uzh.ch
>> > Subject: [EP-tech] Antwort: technical question: one archive with two
>> >         domains
>> > To: eprints-tech at ecs.soton.ac.uk
>> > Message-ID:
>> >         <OF46765916.67BC9E18-ONC12580AC.00262D37-C12580AC.
>> > 0027C817 at lotus.uzh.ch>
>> >
>> > Content-Type: text/plain; charset="iso-8859-1"
>> >
>> >
>> > Hi,
>> >
>> > it is no problem to configure several domains for the same archive:
>> >
>> > in  archives/{yourrepo}/cfg/cfg.d/10_core.pl  :
>> >
>> > $c->{host} = 'domain1';
>> > $c->{aliases} = [ 'domain2', 'domain3', ...]
>> >
>> >
>> > in cfg/apache/yourrepo.conf
>> >
>> > <VirtualHost *:80>
>> > ServerName domain1
>> > ServerAlias domain2
>> > ServerAlias domain3
>> > .
>> > .
>> >
>> >
>> > In archives/{yourrepo}/ssl/securevhost.conf
>> >
>> > <VirtualHost *:443>
>> > ServerName domain1
>> > ServerAlias domain2
>> > ServerAlias domain3
>> > .
>> > .
>> > .
>> >
>> >
>> > Of course, all the domains must be registered as Aliases in the DNS. And
>> > the SSL certificates must contain all the domains.
>> >
>> > Our observation ist that usually the domain the user starts with is used
>> > during the visit of the repo website. Only during login, the URL
>> switches
>> > to the main domain.
>> > We have no problem with that change.
>> >
>> > Best regards,
>> >
>> > Martin
>> >
>> >
>> > --
>> > Dr. Martin Br?ndle
>> > Zentrale Informatik
>> > Universit?t Z?rich
>> > Stampfenbachstr. 73
>> > CH-8006 Z?rich
>> > -
>> >
>> > On 17/01/2017 12:01, Thorsten B?lo wrote:
>> > > Hey there,
>> > > I have a problem with our running eprints archive:
>> > > It is necessary to access the same archive using two different
>> > > domains, so I configured two apache.conf include files with different
>> > > domains using the same 'PerlSetVar EPrints_ArchiveID'. This works fine
>> > > - both domains point to the same archive - but the html files
>> > > generated by eprints include hardlinks to the first domain. Is there
>> > > any option to make eprints using links to relative URLs? Or is there
>> > > another way
>> > > to solve my problem?
>> > > It would be great if you had some suggestions.
>> > >
>> > > Thank you very much,
>> > >
>> > > Thorsten Buelo
>> > >
>> > > University of Cologne
>> > > Institut f?r Informatik
>> > > www.informatik.uni-koeln.de <http://www.informatik.uni-koeln.de>
>> >
>> >
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attach
>> ments/20170118/be16a38c/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 2
>> ...
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attach
>> ments/20170119/ec760c8c/attachment-0001.html
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Thu, 19 Jan 2017 07:39:03 +0000
>> From: Ian Stuart <Ian.Stuart at ed.ac.uk>
>> Subject: Re: [EP-tech] Antwort: technical question: one archive with
>>         two domains
>> To: <eprints-tech at ecs.soton.ac.uk>
>> Message-ID: <5ad4346d-2275-a1e6-da2f-a5ce018d0d3b at ed.ac.uk>
>> Content-Type: text/plain; charset="windows-1252"; format=flowed
>>
>>
>>
>> On 18/01/17 16:02, Thorsten B?lo wrote:
>> > I tried to configure /cfg.d/10_core.pl <http://10_core.pl> manually and
>> > added a ServerAlias at the apache config files.
>>
>> Did you run all the generate_xxxx scripts having changed 10_core?
>>
>> (Remember that EPrints works by pre-creating snippits of web pages,
>> which it then inserts into the templates - it's why you need to
>> re-generate all the "browse" pages periodically: because the ingest
>> process doesn't always get it right....)#
>>
>> --
>> Ian Stuart.
>> Bibliographics and Multimedia Service Delivery team,
>> EDINA,
>> The University of Edinburgh.
>>
>> http://edina.ac.uk/
>>
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Thu, 19 Jan 2017 07:45:59 +0000
>> From: Ian Stuart <Ian.Stuart at ed.ac.uk>
>> Subject: Re: [EP-tech] Antwort: technical question: one archive with
>>         two domains
>> To: <eprints-tech at ecs.soton.ac.uk>
>> Message-ID: <fd1220b6-8291-9c30-a399-ec8d88b2e379 at ed.ac.uk>
>> Content-Type: text/plain; charset="windows-1252"; format=flowed
>>
>>
>>
>> On 19/01/17 07:39, Ian Stuart wrote:
>> >
>> >
>> > On 18/01/17 16:02, Thorsten B?lo wrote:
>> >> I tried to configure /cfg.d/10_core.pl <http://10_core.pl> manually
>> and
>> >> added a ServerAlias at the apache config files.
>> >
>> > Did you run all the generate_xxxx scripts having changed 10_core?
>> >
>> > (Remember that EPrints works by pre-creating snippits of web pages,
>> > which it then inserts into the templates - it's why you need to
>> > re-generate all the "browse" pages periodically: because the ingest
>> > process doesn't always get it right....)#
>> >
>> .... and you restarted the server, having changed the config, yes?
>>
>> --
>> Ian Stuart.
>> Bibliographics and Multimedia Service Delivery team,
>> EDINA,
>> The University of Edinburgh.
>>
>> http://edina.ac.uk/
>>
>> The University of Edinburgh is a charitable body, registered in
>> Scotland, with registration number SC005336.
>>
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Eprints-tech mailing list
>> Eprints-tech at ecs.soton.ac.uk
>> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
>>
>>
>> End of Eprints-tech Digest, Vol 100, Issue 13
>> *********************************************
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20170420/558bdf7d/attachment-0001.html