How to properly edit the virtual host config for test site on ubuntu apache server?

rivkamak
rivkamak used Ask the Experts™
on
Hi,

My company site is currently hosted on windows IIS web server  called  bob.com (for example). I have setup a separate test site that is on a ubuntu apache server hosted on a different cloud provider.
I want to edit the virtual host configuration on my test site (apache) to be a subdomain of my production website. So on the test site it will be test.bob.com. Is it enough/correct way to change the ServerName to bob.com and the ServerAlias to test.bob.com ? The reason I want to edit the virtualhost config is in order that I can put an ssl cert on test.bob.com
Are there any security concerns/ will there be any connection issues?

Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fractional CTO
Distinguished Expert 2018
Commented:
Best avoid... "Is it enough/correct way to change the ServerName to bob.com and the ServerAlias to test.bob.com?"

Mucking about with configs like this can produce massive amounts of debugging time.

Better to either use

1) test.bob.com or

2) bob.com, then access your IP using an /etc/hosts entry like this...

IP bob.com www.bob.com

Open in new window


Also trying to setup a cert covering test.bob.com will not in anyway work if you try using bob.com in your VirtualHost setup.

Best way to handle this is likely to setup test.bob.com covered by HTTPS + do whatever work is required to the bob host.

This is the only way to get HTTPS to work, as HTTPS is designed for security + accessing bob.com with a test.bob.com cert is 100% incorrect.

Author

Commented:
Thank you
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You're welcome!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial