Subdomain no output of index.html but apache

Discussion in 'General' started by illuder, Apr 16, 2020.

  1. illuder

    illuder New Member

    Hello
    The subdomain doesnt show the custom index.html but the apache screen as below.
    I've checked file and directory ownership, its correctly set.
    I've check subdomain redirect as L and /directory/ correctly set as well.
    other subdomains on another domain.tld works fine, only this particular domain that this subdomain is not displaying correctly.
    please advise, thank you.
    apache.PNG
     
  2. nhybgtvfr

    nhybgtvfr Active Member

    is this a normal subdomain or a vhost subdomain?

    1st thing I would suggest checking is /etc/apache2/sites-available/ for the vhost file, make sure the relevant vhost file is actually there, and there's not one with a .err extension.
    if there's a .err extension, then it's still using the previous configuration, you'll need to check what the error is in that .err file.
    alternatively, are you trying to connect with https:// ? if so, is there a valid certificate configured in the vhost file for that subdomain?
     
  3. illuder

    illuder New Member

    i checked the vhost file and noticed lines with the sub domain in it.
    after much tinkering, i actually deleted the sub domain, and i deleted the domain itself.... it STILL displays the apache page......

    i'm lost now...dunno whats next step..
     
  4. nhybgtvfr

    nhybgtvfr Active Member

    did you just delete the config file itself? or just the domain entry inside the config file?

    if you deleted the file, you could just copy an existing vhost config file, and rename the copy so it uses the correct domain name, then edit it to change all instances of the domain name within the file. make sure you choose one that uses the same version of php.
    you'll also need to change the clientid and webid used in the folder paths in the file.

    if you just deleted the domain name line inside the file, you can look at one of the other files for the correct format/syntax and just re-add the deleted line back into the folder.

    or you can just go to tools - resync in the control panel, tick the websites checkbox and select the correct server from the drop-down next to it. then click start. that should recreate all the vhost files with whatever configuration is still set in ispconfig.
    if you have a lot of websites on that server, and it's set to check the configs, it could take a little while to complete, and the apache process will get restarted quite a bit. assuming you haven't manually edited a lot of vhost configs with changes you want to keep, this would be the easiest/safest method.
     
  5. illuder

    illuder New Member

  6. illuder

    illuder New Member

    i deleted from the UI the website and subdomain.
    i recereated the subdomain as a website, added to dns, and same problem, the apache webpage comes up.. however, it gave he message as below, and it redirects the website to another website hosted on the server.
    i then tried to redo the SSL certificate, but it showed erros. both screenshots below.
     
  7. nhybgtvfr

    nhybgtvfr Active Member

    ok, go back into the settings for the site and set auto-subdomain to none.
    I assume that letsencrypt failed completely to get a cert, and the checkbox will be unticked. that's ok, leave it like that for now, let it save the auto-subdomain settings and generate the new vhost config file.
    once it's done that, go back into the sites settings again and now tick the letsencrypt checkbox and save the settings again, and give it a minute or two to get the certificate.
     
  8. illuder

    illuder New Member

    1- i've followed your instructions:
    a) set sub-domain (now created under its own site instead of subdomain under site) as none in auto-subdomain..saved and exited page.
    b) went back and enabled letsencrypt checkboxes. saved, exited.
    c) waited few hours, still redirects site to another site hosted on the server.

    -----but wait-----
    d) deleted both sites, domain and subdomain
    e) left the DNS settings intact. not deleted
    f) when i go to those domain and subdomain, it still redirects to the website...even though its not existant on the server.
    tried 3 browsers, 1 mobile browser..same thing.
     
  9. nhybgtvfr

    nhybgtvfr Active Member

    hang on, you said before
    ?

    so that's the same thing, were you creating it before as a subdomain under bolotalk.com, in the same folder structure? as a vhostsubdomain? or as a full website?
    and have you changed any dns records? previously I was getting errors doing an nslookup for bolotalk.com, but it was resolving for ulema.bolotalk.com, now both resolve ok.

    it loads the default page, or redirects to the first vhost alphabetically, if it can't find the config for that domain/subdomain on that port.
    if you don't have a default vhost set for port 80, it'll load the standard apache page, if you have ssl enabled sites, it'll load the first one.

    which is what it sounds like is happening to you.
    considering you're saying it's happening on the root dotmain as well, and the issue I had with resolving that, for now I would suggest keeping things as simple as possible.

    firstly it seems like you want a site on the root domain, so create the site bolotalk.com, with auto-subdomain set as www if you want to use that as well, otherwise, set it to none.
    forget about ssl and the subdomain for now. let's just make sure it's all working properly on the root domain on port 80.

    and for clarification for getting the subdomain working later, are you trying to get it working as a normal subdomain, which uses the same folder structure as the root domain, and has a folder path starting inside /web, and uses the bolotalk.com vhost file, with rewrite rules in there.
    or as a vhostsubdomain, which again uses the same folder structure has it's own vhost configuration, but still uses the same folder structure as the root domain, and may still be inside /web, but may also have it's own folder in / alongside /web, /log, /private etc..etc..
    or as it's own full website, with it's own vhost config, and it's own folder structure in /var/www/ completely separate from the root domain's bolotalk.com folder structure?
     
  10. illuder

    illuder New Member

    so that's the same thing, were you creating it before as a subdomain under bolotalk.com, in the same folder structure? as a vhostsubdomain? or as a full website?
    >>I tried both
    a) tried as a sub domain under same folder structure (redirected L and created separate subfolder for the sub domain)
    the main vhost showed subdomain traces in the file, same problem
    b) Tried on its own website, has its own vhost file, same problem
    c) deleted domains, recreated subdomain as site, same problem. Then deleted its vhost file, used a working vhost of another domain, changed the path and URL/TLD, same problem


    and have you changed any dns records? previously I was getting errors doing an nslookup for bolotalk.com, but it was resolving for ulema.bolotalk.com, now both resolve ok.
    >>>i havent changed any DNS yet...didnt see it affecting the redirect...as the DNS is needed whichever way.

    it loads the default page, or redirects to the first vhost alphabetically, if it can't find the config for that domain/subdomain on that port.
    >>it seems that it's redirecting to the first alphabetical vhost.
    if you don't have a default vhost set for port 80, it'll load the standard apache page, if you have ssl enabled sites, it'll load the first one.
    >>i've created a custom index.html page in the first alphabetical domain, to indicate which website it's redirecting to. Thus far, it keep redirecting to the website which SSL certificate is adopted.

    which is what it sounds like is happening to you.
    >>yep
    considering you're saying it's happening on the root dotmain as well, and the issue I had with resolving that, for now I would suggest keeping things as simple as possible.

    firstly it seems like you want a site on the root domain, so create the site bolotalk.com, with auto-subdomain set as www if you want to use that as well, otherwise, set it to none.
    >>can try that again, yes... that is the proper way , anyway..so ok, i will do so now..
    forget about ssl and the subdomain for now. let's just make sure it's all working properly on the root domain on port 80.
    >>noted, done, tested ok, showing default ispconfig welcome page (green band)

    and for clarification for getting the subdomain working later, are you trying to get it working as a normal subdomain, which uses the same folder structure as the root domain, and has a folder path starting inside /web, and uses the bolotalk.com vhost file, with rewrite rules in there.
    >>>well noted, thank you
    or as a vhostsubdomain, which again uses the same folder structure has it's own vhost configuration, but still uses the same folder structure as the root domain, and may still be inside /web, but may also have it's own folder in / alongside /web, /log, /private etc..etc..
    >>will lookout for that
    or as it's own full website, with it's own vhost config, and it's own folder structure in /var/www/ completely separate from the root domain's bolotalk.com folder structure?
    >>>I prefer to remain within standard.. which is MAIN domain >>SUB Domain under it. so sub domain folder under main domain..
    Just a thought for convenience that
    ISPConfig should consider creating the sub folder, and DNS settings automatically when a subdomain is created.
     
  11. illuder

    illuder New Member

    To clarify the DNS settings:
    when adding a Subdomain
    a) go to DNS of the main domain
    b) create A record subdomain.domain.tld. (note the dot after tld)
    c) create NS records: ns1.nameserver.tld. and ns2.nameserver.tld. (note the dot after tld)

    is the above correct?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is creating the subfolder automatically when you create a vhost subdomain. Normal subdomains (not vhost) have not and shall not have their own folder as the routing on which page is shown is handled by the CMS of the website in such a case. DNS is not created automatically, we might change that in future though.
     
  13. illuder

    illuder New Member

    Maybe I'm missing it, but when i went to site/create subdomains/ set redirect L and listed the folder /ULEMA/, it did not physically and automatically create the folder...i manually created it via SSH. Could that perhaps not be the problem? Maybe I was too hasty to manually create the subfolder so its not linking the manually created folder in DB? How long should I wait for?
    Perhaps i'm creating a 'vhost subdomain' incorrectly?

    hmmm, unfamiliar with 'normal subdomain creation'...is it when creating the subdomain under sites? or creating the subdomain as a site (root)?

    >>absolutely fantastic.... perhaps it will ease complication and potentially support posts..
     
  14. nhybgtvfr

    nhybgtvfr Active Member

    there are two ways to create a subdomain (apart from as a completely separate standalone website).

    on the sites tab, under the website menu on the left, listed under website, is the menu item 'subdomain for website' this is the standard method, in this section you have the field 'redirection path', which is where I believe you're putting '/ulema/' , I may be wrong, i'll need to recheck the manual when I can find where I saved it, but I believe you need to put the full url, ie 'http://bolotalk.com/ulema/' or 'http://bolotalk.com/subfoldername1/...../subfoldername#/ulema/' if the target folder is several folders deep.
    this folder needs to be manually created if a plain php/html site, or exist as a wordpress/joomla/ stub/path/etc

    the other menu item is 'subdomain (vhost)' this will only show if ispconfig is configured with system - main config - sites - 'Create subdomains as web site' enabled. if you're using this option, then parent domain would be bolotalk.com, hostname would be ulema, domain would be bolotalk.com, and web folder would be '/ulema', '/web/ulema', or '/web/subfoldername1/…../subfoldername#/ulema' dependent upon where you actually want that folder to be created. ispconfig will create this folder, and put the normal error,stats,index.html files/folders in it.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Creating a redirect shall not create a subfolder. As mentioned above, adding a subdomain is normally used in conjunction with multi-domain capable CMS systems and if ISPConfig would automatically create a folder, these systems would break. @nhybgtvfr explained the difference between subdomains and vhost subdomains in detail above.
     
  16. illuder

    illuder New Member

    This is the method i prefer to use. In the last try, I have done so...and inserted /ulema/ in the redirect, which sent me to the other website... HOWEVER..
    a) I have created a new testsubdomain as per method above listed, hence /testsubdomain/ in the redirect field.... and it WORKS fine! yet the ulema one still doesnt work
    b) so i've entered the full URL as you've suggested, and now ulema.bolotalk.com WORKS!! wow! This is SO weird!!


    I was not aware of this method, nor intend using it if above method works...

    I will run further tests as well as deploy Wordpress in the sub domains to see if it continues to work..

    I do point out that in DNS zones, under bolotalk, I've only created A records for the 2 subdomains mentioned above....and it seems fine with that.

    Will provide further test results... thank you SO much for prompt assistance thus far.... God bless and keep you safe!
     
  17. illuder

    illuder New Member

    Well noted and understood... thank you so much for the teamwork in assisting me!! Really happy.. thank you!!
     

Share This Page