Using ISP config 3.0.1.6 (I just upgraded from 3.0.1.4 to see if that would resolve this problem...but it didn't) I may be misunderstanding something here but I've been trying to create a subdomain that points to it's own folder rather than the main site's homepage. It seems whatever I do when I create a subdomain it doesn't have it's own folder that I can then install a site to, it defaults to pointing at the tlds homepage and I can't see a field in the subdomain setup page that I could use to steer the subdomain to it's own folder. My tld is registered with namecheap. If I don't add a new subdomain record there it wont be found as I don't have a wildcard subdomain catchall set up. If I set up a subdomain with namecheap the address correctly resolves to my server. Once a request for <mysubdomain>.<mytld>.com is sent to my server I expected the host headers to steer it to the correct folder but I don't currently see a way of creating that setting. The only way I can cause ISPConfig to give a subdomain it's own unique folder is if I set it up as a new tld using the tld plus subdomain in the domain field. But even though it has it's own folder when I put the address in a browser I still get my homepage from my tld like it's not pointing to that new folder. Can anyone help?
Make sure that you created every subdomain as DNS A-Record at your domain registrar and that the IP of this dns A-Record is identiacl to the IP of the website that you created for this subdomain. The purpose of the subdomain function is to point subdomains to the same site then this subdomain belongs to. If you want to have a separate directory, you have to create the subdomain as separate website (domain).
Yes I've done this. I've done this also but the new site (using the websites option not the subdomain one) has a directory created for it as I would expect and I can see in the vhosts file that it points to this new separate directory which has the default index.html file added to it but instead of seeing this "Welcome" page when I navigate to the domain which should be using this separate folder I get my homepage from my original tld site which is in a different folder so something somewhere is telling my server when a request comes in using the subdomain's url go to the tlds folder.
I've even been clearing the cache of my browser just in case that was pulling up the homepage from cache.
Then you have to wait about 24 - 48 hours. and you are sure that you selected the IP address and not * in the site settings. It must be the IP that you created in the A-Record, otherwise apache is not able to find the correct website.
Ah! I put the IP address in at the registrar but on the ISPConfig page the drop down list only has the * as an option. There are no IP addresses and no way of entering one. I thought the host header would sort out the routing once it got to my box? I only have one static IP but that doesn't show up in the drop down list. The vhost file for this tld lists *.<tld> as an alias then <mysub>.<tld> below that as another alias.
I'm guessing that's one of the options when you are logged in as admin? I've lost my admin password (doh! ) so I'll have to figure out how to recover that first, thanks for your help.
Ok I found out how to do that, I added the IP, it shows in the list so I've added it to the new domain too. Now I just have to wait for the registrar changes I made (I was messing around trying to get things to work another way) to go through and hopefully I'm sorted. Thanks again.
I've just set up a new subdomain with my registrar and set up a new website for that domain in ISPconfig and the subdomain already resolves to my server but again it gets there and goes straight to the homepage of my tld.
Check if the vhost file exists and if it contains the correct IP and domain name. Check especially for typos. The reason for this problem is always the same, apache will redirect to the first site of an Ip as long as there is no better match for it. So if you get the main site, your subdomain vhost has either atypo in the IP or the servername or the dns record is incorrect.
Hmm I'm stumped. I've gone through everything and it all seems to be spelled properly and has the right IP. ISPConfig automatically generated the vhost files and directories so everything matches perfectly. I've checked out the A record and it's all fine and since it does find my server it's probably set up fine. It's just that last bit of navigation from the header. I removed the following line from the vhost file for my main site: ServerAlias *.<mydomain>.com to see if that made a difference. With this line missing the subdomains no longer point at the homepage of my main website. They point to the Apache test page you get when you've just set up Apache and not installed any site code. This is still the wrong destination as the subdomains' folders have automatically generated pages in them stating the sites name so it's likely that the subdomains are now all pointing at the default apache directory instead of their own directories. Could anyone post an example of a vhost file for a main site and one for a subdomain so I can check against what I have to see if it missed anything out or added something it didn't need?
SubDomain as Full Site or as Folder inside current ? If as folder you cant access using http://name.domain.tld (I cant) only work http://domain.tld/subdomain If as full website is possible to access - http://name.domain.tld Im not sure if is possible to create a folder as subdomain and access as http://name.domain.tld. is it ?
I've set up a whole new site as <subdomain>.<domain>.<tld> It has it's own set of folders and should just behave as a second site on my server but for some reason it still redirects to my main domain's homepage. The reason why I tried in subfolders of my main domain first is that is what I have done in the past with a hosting account I have. I host some sites with Site5.com and how their system works is you set one main domain and then you can use domain pointers to setup as many other domains as you want in subfolders.
Yes, I have a linksys router that port forwards all traffic on port 80 to this server. I selected the IP address.
I've just had a poke around (been a while since I set it up) and my server's IP is actually in the DMZ so there shouldn't be anything blocked.
Make sure that you selected the internal IP adress for the website, the one that you forwarded port 80 to from your router, and not the external IP. IO've also seen that the dms does not work correctly sometimes, I had a linksys router too. The only solution was to forward port 80 in the router to the IP of the server and not using the dmz.
Huzzah! you're a genius. I was putting in the external IP address not the internal one (doh!). Once I switched to the internal one the sites switched to their correct folders. All bar one for which it either has some cached settings or I've screwed it up trying to sort the problem out as that still points at the default apache folder (at least it's not my home page ). I've noticed if I delete the site and then recreate it I don't get a new fresh site it just recreates the old broken one so I'm guessing ISPConfig stores the details in a db and just reuses them?