Centos7, Apache, subdomains and .conf-file configuration
Hi all.
system used: Code:
uname -a I installed a server(I'm in a hurry again) about 1,5 weeks ago using CentOS 7 and after about 5 minutes of googling I found out the how .conf-files should be of a subdomain. It all worked OK but later I did the thing a Linux Admin SHOULD NOT DO!!!! Using runninglevel 3(as always) I changed to a directory, as I thought, but I wrote a little wrong so I happened to be in root-dir and there I did 'rm -rf'. I saw what happened so I CTRL-C it but as I knew, that system was gone. Now I reinstalled it again but THIS time I just can not find the apache-subdomain-conf-file-example-thing and I just can't get it to work. I've been doing this for 5 days now and still nothing works. 'DocumentRoot' is set to the directory of the main domain name. As I can't recall at all how the conf-file looked like I gotta ask; YES, I googled my a$$ of for this, this 2nd time and nothing works. Also tried different browsers on different devices and still nothing, so no cash problems :( -?- Do I have to have the subdomain-directives in the same .conf-file as the 'main' domain as some google-result says? (tried that and it didn't work, if I did it correctly) I probably have missed showing you info about the system but I don't know what to show. It's a "normal" CentOS 7 installation and its' versions all the latest applications. I'm about to give up even though I already got it working like 1 week ago. |
Quote:
If /etc/httpd/conf.d/vhost.conf does not exist, you can create it using the example in the link above as a template. FYI apache reads all .conf files under /etc/httpd/conf.d at startup. |
Well it's not a vhost I'm after. I want to add subdomains under domainname.com like
aaa.domainname.com, bbb.domainname.com, ccc.domainname.com etc All other things with "normal" domainnames work perfectly just this thing with subdomains that won't work. I own a real domainname and I want to add more other sites to it but by using the above subdomains. |
Quote:
Or else, post the config that is not working and the error you get so we could help you better on that. |
Well ain't that typical :( today it worked and I've been trying this for almost a week now.
I tried different types that I googled up and this is supposed to work and it does, like all subdomains in the same conf-file as where the main domain was, which ALSO works now. Just can't figure out why it didn't work the other days. As I said, I flushed all browsers and tried on different PCs and mobile devices. Ah well, it works so I'm glad :D This is what I have now Code:
<VirtualHost *:80> All of them works as subdomain under domain.com, like: http://domain.com show one site, the main one. and these; http://dom1.domain.com http://dom2.domain.com http://dom3.domain.com http://dom4.domain.com all shows different sites Marking this post solved and thanks :D |
All times are GMT -5. The time now is 02:30 AM. |