[Solved] Sites opening a different document root folder

Discussion in 'Server Operation' started by anark10n, Dec 30, 2020.

  1. anark10n

    anark10n Member

    Hey there. So i redid my server and recreated the previous sites i was hosting, and uploaded all relevant files. One of them is a wordpress site, and the other site hasn't been used yet. Now when i visit the wordpress site, it opens the web folder of the unused site for some reason. It opened in the correct web folder before i uploaded the wordpress files. Any ideas on what's causing this?
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You probably have SSL enabled for one site and not the other, while accessing the other over HTTPS. Enable SSL and create a cert for the web that doesn't have it to resolve it.
     
  3. anark10n

    anark10n Member

    I made sure, both of them have ssl enabled. I have the same problem even when i disable ssl for both sites. when visiting the as yet unused site, it opens correctly. when i try visiting the wordpress site, it opens the unused site's web directory instead of its own. I've only ever encountered this when i've disabled a site, and the disabled site url opens the web directory of another site, for some reason.
     
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    If SSL is enabled, you need to install a SSL certificate. You can generate a self signed one by going to the SSL tab and selecting "Create certificate". Then save.
     
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Check that both sites use the same ip address (eg. use * for both).
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If it is only wordpress that redirects to wrong site, check what settings that wordpress has for site-url and home-url.
     
  7. anark10n

    anark10n Member

    Turns out it's not because of wordpress, even after removing the all wordpress files the domain still opens the wrong web folder. I'll be updating the tile to reflect this.
    And it's not SSL either as disabling SSL still opens the incorrect web folder when visiting the domain without https. Enabling SSL, whether self-signed or with let's encrypt, gives the same error. All sites on my server are opening a web folder that isn't the Document Root listed in their settings. Changing the IP address to (*) didn't help, and there's now no option to select the IP address even though it was available when I created the site. One of the sites was opening correctly until recently, but is now behaving the same way as the rest.
    I'm at a loss as to what to try, or what to look for.
     
  8. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    What does 'apachectl -S' show (actual domain names would make it easier to examine externally)? Have you tried other machines or other browsers, and cleared your browser cache?
     
  9. anark10n

    anark10n Member

    So, it appears the problem was because of the record for my subdomain for my FQDN, I had unchecked 'Active', because i didn't want it to have a reachable webpage, but as soon as I activated, all sites are now opening the correct the document root folder.
    I guess it's solved, but is this way it's supposed to work or is this a bug?
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    If you disabled the web, all traffic goes to the first web in the list. You can create a site like 000.aaaaa.com so that is first in the list.
     
  11. anark10n

    anark10n Member

    Even if it's just that single site that i deactivate, and all the others remain active?
     
  12. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I think @Th0m meant, that if you deactivate a site, and write the URL of that site in browser address bar you end up in another site, first in alphabetic order.
    I have site 00aa.mydomain.tld with index.html stating "you ended up here because https on non https site or site does not exist".
     
  13. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Just curious, what would you expect to happen when you set a site as inactive?
     
  14. anark10n

    anark10n Member

    A "Server not found" related message when i enter the domain into my web browser.
    Yeah, I've seen that happen before and I expected that. What i didn't expect is a site that is inactive to affect the other sites that are inactive.
     
  15. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    You would have to change your dns for that; with valid dns, the server's address is found, and hence you get "something" back from your web server. As mentioned above, you can create a custom site/response for the default if you want it to show a specific message.
    Deactivating one site does not affect any others unless those others were tied to that site, redirecting to/through it, etc. It wouldn't affect other inactive sites unless it was the default site on the server and by disabling it, a new default site was in use.
     
  16. anark10n

    anark10n Member

    Except that it did, you see, because deactivating the site for my FQDN causes all the other sites to open document root folder that belongs to another site, and even then not necessarily the first site listed alphabetically, as the SSL warning i got was for a site starting with 'o' while the site i was trying to reach started with 'd'. And then it would change as I deactivated the site it was attempting to reach.
     

Share This Page