Have www.mysite.com working, how to get www2.mysite.com set up?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Have www.mysite.com working, how to get www2.mysite.com set up?
Hi all,
I am running Apache on Red Hat and my home website works fine. I am pretty new to all of this, but what I'd like to do is have other 'sites' with my domain, like instead of www.mysite.com, something like www2.mysite.com or blah.mysite.com.
I assume it isn't too hard to do? Hopefully someone can just point me to some documentation or let me know how to change a configuration file somewhere. I'd gladly provide more info about my system if it's helpful.
I've wrestled with this for a while now and can't seem to get it to work properly. The virtual hosts section of my httpd.conf file looks something like this:
What I have noticed in this setup is that if I switch the order of these two virtual host blocks, the site is affected. Specifically, which ever comes first controls the site: www.mydomain. com and other.mydomain.com will both use the DocumentRoot of the VirtualHost that appears first. This tells me I am definitely doing something wrong. Hopefully it's something simple... All of the examples I've seen have been for two sites like www.domain. com and www.domain2. com, I figured it shouldn't be much different, but maybe it is?
I'll gladly provide more info if it helps you help me! Thanks in advance...
What I have noticed in this setup is that if I switch the order of these two virtual host blocks, the site is affected. Specifically, which ever comes first controls the site:
Actually, this is correct behavior. When Apache doesn't recognize a virtual domain, it defaults to the first one in the list.
My virtual hosts directives aren't much different from yours, but there is one potentially critical difference.
I took the 7 seconds to make that change, restarted the httpd, and everything worked fine. Thanks so much for noticing that little difference. Should have posted my question before trying 50 things that didn't work!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.