One shell user for ssh access to few websites

Discussion in 'Installation/Configuration' started by Poliman, Jul 19, 2017.

  1. Poliman

    Poliman Member

    What is the option to change? In Main Config I've found:
    "Create subdomains as web site" and "Create aliasdomains as web site". Both are unticked as on the attached screen.

    Attached Files:

  2. ahrasis

    ahrasis Well-Known Member

    Yup. I think that is the one. To enable vhost you need to tick the one you want, which in this case is the aliasdomains. If you need vhost for subdomains as well, you shoud tick the one for it too.

    For this, a separate vhost will be created for each aliasdomains / subdomains, i.e. different from the main website. The advantages, among others, are to have their own individual vhost which you may want to vary from the main website. For example, they may even have a different php version or own individual LE SSL certs.
  3. Poliman

    Poliman Member

    But of course they have by default LE SSL from main domain. I created - as first - subdomain using "Subdomain for website" which is redirected to directory which I made inside main domain directory. If I would create subdomain using option with vhost, can I use this created directory earlier? I suppose I should remove subdomain configuration from "Subdomain for website" place. And finally what should be path to directory for "Subdomain for website vhost" - /web/some_directory and what about DNS configuration?
    Last edited: Jul 27, 2017
  4. ahrasis

    ahrasis Well-Known Member

    1. Solution for this thread that I suggested earlier is by using aliasdomain, not subdomain.

    2. If it is a subdomain/aliasdomain without vhost, the certs will only be under main website, but with vhost, the will be certs under main website and under subdomain/aliasdomain respectively.

    3. You can certainly use any directory even the one you have created earlier. This you use / create on your own choice.

    4. It, as if, is a website on its own, so you will need dns for it, whether subdomain or aliasdomain.
  5. Poliman

    Poliman Member

    All work fine. One question about 2nd point. Subdomain is done with vhost. Main domain has enabled LE SSL and SSL options. Subdomain, without enabled LE SSL/SSL options, didn't have SSL. One shell user can access /web directory of main domain and /web/testh directory of subdomain. After ssh login console shows something like: [email protected]
    Last edited: Jul 27, 2017
  6. ahrasis

    ahrasis Well-Known Member

    Correct. You can use cd /web/ to access the web folder and above it.
    Poliman likes this.
  7. Poliman

    Poliman Member

    Ok, so now I have to only turn on redirection from http to https. Btw I saw strange thing. On PC with Windows subdomain is redirected (tested on Chrome incognito mode) like main domain but on MAC it isn't (redirection for subdomain is not enabled). Second thing - after creation subdomain I checked LE SSL and SSL, after changes propagation I tried open subdomain with https and nothing - Chrome said that can't establish connection but via http subdomain worked. I should untick both ssl options and mark them again but firstly I checked SSL then LE SSL, because conversely it didn't work. This schema repeat does not for all sites but more of them. Bug or something?
  8. ahrasis

    ahrasis Well-Known Member

    1. Kindly explain what redirection that you wrote as it's not clear to me.

    2. Please note that subdomain vhost is something like sub as it will become sub.domain.tld of the main website domain.tld. So in the main domain dns A record, there should be sub, pointing to the same ip as the main domain. It cannot be other website like domain2.tld etc.

    3. What I suggested earlier was aliasdomain vhost, where on the other hand, you can put any domain like domain2.tld under the main website domain.tld web folder and above. Though pointing at the same web folder and/or above, they are treated as a different website and thus need their own dns.

    4. In both cases you should ensure that the dns has been properly propagated and the website is properly accessible from the outside your LAN before ticking SSL + LE. Otherwise, LE won't issue any SSL certs for the sub / alias domain. To confirm this, do check LE error log.

    5. I won't assume it is a bug unless I have really exhausted all possible yet correct ways in obtaining LE SSL certs via ISPC.

Share This Page