2

I am trying to set up 2 different domains in two different folders, first one say

www.test-one.co.uk

which point to /home/test1/public_html and other

www.test-two.co.uk

which point to /home/test2/public_html. www.test-one.co.uk is the base one. Multiple store and website all are created. Now the problem is we cant point www.test-two.co.uk to the doc-root of test-one.co.uk, because both are pointed to different folders as shown above.

Also thought of doing parked domain way to point, but since second website got certain mailid, dropped that idea.

Another option is to point via httpd.conf and point test-two site to primary site folder.

Is there any better way to handle this case? Without being copied index.php and .htaccess to second site folder and editing same.

Could somebody drop some light towards my issues

  • This isn't the best place to ask this. You'll want to ask on a SE page dedicated to Apache or Nginx depending on your server setup. Also a heads up that you may run into issues with SSL with this method since each SSL cert will it's own IP. – Tyler V. Oct 28 '15 at 5:27
  • Never mind. Fixed ourself. – Shyam Krishna Sreekumar Oct 28 '15 at 8:56
0

Never Mind. We fixed ourself.

We cant add virtual host redirect in httpd.conf, as we got cpanel, when it restarts, all that we written will be lost.

So we tried an alternate way to include another .conf file in httpd.conf and we succeeded. The second domain pointed to first.

But next we met with another issue. We always got 500 internal server error page when taking second domain. So we checked the error log and we found this error

[Wed Oct 28 06:28:00 2015] [error] [client ip] SoftException in Application.cpp:422: Mismatch between target UID (505) and UID (501) of file "/public_html/index.php"
[Wed Oct 28 06:28:00 2015] [error] [client ip] Premature end of script headers: index.php

This is because of the different ownership of two domains. So for fixing this, we written to assign owner ship of first domain for second in the custom included .conf file.

Problem solved and we are ready to shoot. :)

Might be helpful for someone in future, so posted these.

0

One point to add here related to 500 internal server error and different ownership. In your second website .conf file add:

suPHP_UserGroup firstwebsiteuser firstwebsiteuser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.