Page 1 of 1

DocumentRoot linux

Posted: Sat Mar 28, 2009 6:23 am
by mikebr
I have created an account on a server I have access to, I have added a directory called 'portal'. This server is linux and has cpanel, the old server where the account was is also linux.

I have moved a small 'hand rolled' ftp application over from the old account to the new account, there is a folder called 'appconfig' in the root of the old account which I have also moved over to root folder of the new account. This folder contains a file called 'httpd.include' and it contains various php.ini directives, one of which is to include a file in the same root directory folder that contains the following:

Code: Select all

DocumentRoot /home/theaccount/public_html/portal
AddType application/x-httpd-php .php .html
On the server the old account these seem to work so must be loaded at runtime, on the new server they do not. Now if I add an .htaccess file with the following:

Code: Select all

AddType application/x-httpd-php .php .html
that seems to work... but when I add:

Code: Select all

DocumentRoot /home/theaccount/public_html/portal
to it I get a 500 error. The reason I am adding this in the htaccess is to try and get the document root to be the portal directory as I don't know what or how the root directory 'appconfig' file 'httpd.include' gets loaded, would this be set in the main php.ini file?

Anyone any ideas how I can get this root directory file 'httpd.include' to be used by the php.ini file? I have access to the whole server where the new account is but only limited access to pull the app off the old server although I have all the files the app uses and altered any configuration files for the app. The problem is that when someone enteres the domain.com they are taken to the 'home' folder, while I want them to be taken to the 'portal' folder.. in otherwords for the portal folder to be used as the home directory.

I have an account that uses cpanel, I have a sub domain set up as portal in cpanel, the portal directory I want to default to as the document root.

Thanks in advance

Re: DocumentRoot linux

Posted: Sat Mar 28, 2009 12:51 pm
by mikebr
I think I am getting somewhere but still getting stumped:

I see that if I alter the 'Include' parameter in httpd.conf I can make the conf file the httpd directives are in get included and so make the account function as I need it to but... on the server the new account is on the httpd.conf file is in /home/user/etc/httpd.old/conf/ which kind of confuses me, httpd.old, does this mean that it is not used on this server?

I see the include parameters set in this file are as

Code: Select all

Include conf.d/*.conf
but cannot seem to find more information in using include, is the * a wildcard for anything.conf? if so can I then change this to:

Code: Select all

Include conf.d/*.conf/*.include
add the file httpd.include to the conf directory and have it included by default?

Thanks

Re: DocumentRoot linux

Posted: Thu Apr 02, 2009 2:22 am
by mikebr
I got this sorted by adding...

Code: Select all

AddType application/x-httpd-php .php .html
to an .htaccesss and then altered the DocumentRoot for this domain in the httpd.conf file.

Seems to do the trick. :)