Knowledgebase

Do I have to edit the httpd.conf file ?

Posted by chilli, 01-09-2013, 07:51 AM
This has probably been asked many times before but here's my situation. I have a bunch of sites moved from another server to mine (VPS Cpanel to Cpanel) but all the sites have problems working on my server. It seems they used the httpd.conf file on the old server to set the Document Root for all their sites. How then would I get their sites working on my server? Do I need to edit the httpd.conf file? How would I do that and more importantly, how would I do that without affecting sites that were already on my server? Server Version Apache 2.2.23 running CentOS 6.3 x86_64 kvm WHM 11.34.1 build 6 I have noticed that all the site files have this at the beginning. include($_SERVER['DOCUMENT_ROOT']."/includes/config.php"); include($_SERVER['DOCUMENT_ROOT']."/includes/header.php"); Alternatively is there a way to get individual sites working without editing the httpd.conf file ? Many thanks in advance.

Posted by nerdsein, 01-09-2013, 01:01 PM
Sorry for being so directly, but I would say doing it in the way of $_SERVER['DOCUMENT_ROOT'] is pretty bad and is causing situations like this. Anyway, do you still have access to your old VPS? If yes, then why not put a file 'docroot.php' with content of '' to your old and current one in the same directory and look what it results if you visit it... this should be a good starting point to debug this. And after you know in which directory this is, you can decide if editing your httpd.conf is necessary

Posted by kencox, 01-09-2013, 01:18 PM
I would simply create the sites on the new cpanel server and them move the content for each site into the proper home directory. This is probably your fastest solution that will work in the long term. cpanel to cpanel moves generally go very well.

Posted by nixrookie, 01-11-2013, 02:53 AM
This seems to be a bteer move with cpanel servers. You can create a simple bash script to create the accounts from back end, if you have the domain list.

Posted by chilli, 01-11-2013, 04:29 AM
Thanks for all the replies. Thing is, these guys were on a dedicated box developing web sites for their own customers, of which at the moment there are about 40. All of the sites had their site files in a sub folder of public_html For some reason this is how they designed things. most of the sites are php based with variations of bespoke cms mixed with and integrated into bog standard web sites. Some rely on things like Zend and Ioncube. Some have sub domains which seem to have become the main site with the original main domain redirecting to it. It's all quite a mix and because it was their own box they pretty much tailored it to their own certain needs. They were also using the dso php handler. On my VPS I can't use that at the moment because it stops some existing Word Press sites from working...not sure if there is a workaround for that? Anyway I switched the FastCgi which "seems" to allow both to work, although I'm not sure if that is now preventing these imported sites from working how they should. I did try dso but it made no difference. Sites were no more working than they are now and like I say, it stopped some existing sites from working. Have tried changing the documentroot for each site via httpd.conf but that made no difference. Pretty much at a loss as to what to do now. Have spent days trying to sort this out and I am getting no where



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read


Language:

Client Login

Email

Password

Remember Me

Search