Create symlink from domain web directory to another domain web directory

Discussion in 'Installation/Configuration' started by Poliman, Oct 6, 2017.

  1. Poliman

    Poliman Member

    I have two domains. I would like to have something like this:
    I enter in web browser domain1.com and I have open site from proper web directory. I have domain2.com and after enter in web browser this address I need have opened website domain1.com but in URL I need have domain2.com. I found out how to do it. I need create symlink in domain2.com to web directory of domain1.com domain. Unfortunatelly it's impossible, because there is currently one web directory but I can't rename it (as root it's impossible as well), I can't do enything with it. How could I resolve the issue? Maybe should I change DocumentRoot in vhost of domain2.com?
     
  2. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    what's wrong with using domain alias?
    Btw. you can't modify the web-folder because of immutable bit set, which can be changed on system config but it's not adviseable to do so
     
  3. Poliman

    Poliman Member

    Problem is that both domains are created under Website tab. So is it possible with symlink? Btw does the domain alias can provide different URL in address bar but this same content loaded? Second thing -> option Aliasdomain or maybe Aliasdomain (vhost)? If option with symlink is not possible I will try Aliasdomain but which one option. :)
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Then delete domain 2 and add it as alias.

    that's exactly what a domain alias is.
     
  5. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    yes, domain won't be changed and it's the same content beeing displayed.
    However you might want to change the aliasdomain behaviour
    enable system => Main config => Create aliasdomains as web site
    this allows you to add an aliasdomain (vhost) as websites.
    It'll ask for a document-root, use /web/

    this way you can have valid ssl for both domains


    edit: oh and do what @till suggested first ;)
     
  6. Poliman

    Poliman Member

    Ok, I will do it. Appreciate quick and substantive answers. Which option should I choose: Aliasdomain or Aliasdomain(vhost)? I need that aliasdomain domain2.com would has ssl, so I think second option will be good in this case. Am I right?

    PS
    @ztk.me You add your answer with part which answered my question from this post. :p
     
  7. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    haha yeah :)
    you want to use aliasdomain(vhost) - the other option does not provide ssl setup
     

    Attached Files:

  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Both options provide SSL. It depends on your SSL cert which one is right.

    - For letsencrypt, choose aliasdomain.
    - If you have a multidomain ssl cert from another ssl authority, choose aliasdomain.
    - If you have two separate ssl certs from another ssl authority, then choose aliasdomain vhost.
     
  9. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    ah yeah these wild wildcard certs, didn't have that in mind right now, thx for mentioning @till
     
  10. Poliman

    Poliman Member

    Currently domain2.com has LE and domain1.com uses redirect 301 to domain2. At the begin of creation both webdomains both had LE. Curretly only domain2 has it. I need to have both domains using LE but I don't know which option is proper - each domain has own LE cert or they use one LE cert, because one domain is an alias for second one.
     
  11. HSorgYves

    HSorgYves Active Member

    IMHO, it doesn't matter, the user sees a cert, that's all that matters...
     
  12. Poliman

    Poliman Member

    Second thing I have both - domain1.com and domain2.com created via Website tab. Both have also created shell user. Both use this same database. Should I remove shell user which belongs to domain which has to be removed (and then create an alias) ?
     
  13. Poliman

    Poliman Member

    Ok, so I added aliasdomain under "Aliasdomain for website" and domain which is an alias doesn't use main domain ssl cert. "https" is crossed out but - of course - I have nicely opened content from main domain. This part is finished but still problem with LE ssl.

    Probably I need use "Aliasdomain (Vhost)" but how should looks the path for web folder in "Web folder" input?

    EDIT
    I just put in above path "web". Now I am trying setup LE ssl.
     
    Last edited: Oct 10, 2017

Share This Page