#1 (permalink)  
Old 07-10-2009, 06:17 AM
Registered User
 
Join Date: Jul 2009
Posts: 25
Julien PHAM is on a distinguished road
Changing base directory

Hi,

Is there a way to setup cpanel to use another base directory than the default public_html one?

I need this because my CMS uses another base one, so I need to point my website base directory to another one.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-10-2009, 06:29 AM
cPanel Partner NOC
cPanel Partner NOC Badge
 
Join Date: Apr 2008
Location: PK
Posts: 294
JawadArshad is on a distinguished road
Quote:
Originally Posted by Julien PHAM View Post
Hi,

Is there a way to setup cpanel to use another base directory than the default public_html one?

I need this because my CMS uses another base one, so I need to point my website base directory to another one.

Thanks
I recommend you not to change the default path, unless you really have to do it. If you still need to do it, here is how to.

1- Edit the document root of a site by editing the '/var/cpanel/userdata/user/domain.tld file

2- Change the 'documentroot: /home/user/public_html' to your specified path, save the file and run this command.

3- /scripts/rebuildhttpdconf

4- Restart Apache.
__________________
JaguarPC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-10-2009, 06:29 AM
Registered User
 
Join Date: Jul 2009
Posts: 25
Julien PHAM is on a distinguished road
This is not the default path for all users I would like to change, this is the base path for my account I need to change.

I explain, I use drupal CMS. Drupal installs itself in /home/username/public_html/drupal directory.

But I do not want to have to use as web address : http://www.mydomain.com/drupal, but instead just http://www.mydomain.com

Do you understand what I mean?

So how can I achieve this?

Thanks

Edit :
I have found this on those forums, is it the same thing?

1. Locate the domain you're trying to edit in /var/cpanel/userdata/user
2. Edit your file
3. Run /scripts/ensure_vhost_includes --user=USER

Last edited by Julien PHAM; 07-10-2009 at 06:56 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-10-2009, 02:11 PM
linux7802's Avatar
Registered User
 
Join Date: Dec 2007
Posts: 154
linux7802 is on a distinguished road
Solution

If you are having root login details the you can change the
DocumentRoot for your domain in /etc/httpd//conf/httpd.conf file

Quote:
From

DocumentRoot /home/username/public_html

To

DocumentRoot /home/username/public_html/drupal_installed_directory_name
So that after browsing the URL http://www.mydomain.com/ it will show content of drupal

OR

If you are not having server access then please contact your domain hosting provider and ask them to change the DocumentRoot for your domain.
__________________
Regards,
Gunjan
cPanel Hosting | Dedicated server Hosting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-11-2009, 02:28 AM
BANNED
 
Join Date: Jun 2005
Location: Wild Wild West
Posts: 2,026
Spiral will become famous soon enough
Lightbulb

Quote:
Originally Posted by Julien PHAM View Post
Hi,

Is there a way to setup cpanel to use another base directory than the default public_html one?

I need this because my CMS uses another base one, so I need to point my website base directory to another one.

Thanks
There is NO SUCH THING as a CMS that can't use /public_html or
otherwise run at your main domain name instead of a subfolder!

Sounds more to me like you don't know what you are doing or otherwise
don't know how to install your CMS program correctly!

There is absolutely no need to change the layout of your web hosting
account, update file folder names, or anything of the sort and it is
absolutely ridiculous to suggest that you do!

If you would like some assistance setting up your CMS program,
I'd be glad to give you a hand with that but you don't need to go off
trying to change account folder names and such! LOL

Quote:
I explain, I use drupal CMS. Drupal installs itself in /home/username/public_html/drupal directory.

But I do not want to have to use as web address : http://www.mydomain.com/drupal, but instead just http://www.mydomain.com
If you are installing Drupal automatically from Fantastico Deluxe, just simply leave the install location blank
and it will install directly to your site root instead of "/drupal" which is what you are asking anyway!

If you are downloading the drupal archive and installing manually, you just simply unpack the archive
directly to the main /public_html folder and then go and run your standard setup and installation.

Last edited by Spiral; 07-12-2009 at 03:13 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-11-2009, 06:28 AM
Registered User
 
Join Date: Jul 2009
Posts: 25
Julien PHAM is on a distinguished road
Quote:
Originally Posted by Spiral View Post
There is NO SUCH THING as a CMS that can't use /public_html or
otherwise run at your main domain name instead of a subfolder!

Sounds more to me like you don't know what you are doing or otherwise
don't know how to install your CMS program correctly!
Not at all, you do not understand...
First, I was finally able to put the base directory where I want to, in /home/username/public_html/drupal

Why I did that? Because it makes the upgrades of my CMS far more easy. Let me explain.

I have created a drupal directory in /home/ In this drupal directory I put the different versions of drupal, such as drupal.6-11, drupal.6-12, and so on.

In /home/username/public_html, there is no drupal directory, the drupal is just a symbolic link that points to /home/drupal/drupal version

This way, when I upgrade drupal, I just have to unzip/untar the new drupal version in /home/drupal and to change the symbolic link to point to the new drupal version.

I find it far more convenient than having to delete all files in the public_html folder then install the new drupal version and move the files elsewhere. (as by default untar the drupal puts it in a subfolder of the current folder)

And this way this is easier to go back to a previous drupal version if something goes wrong while upgrading...

Same thing with the sites folder, it is just a sym link so I do not have to keep this folder in the public_html folder. I prefer to have it elsewhere. And so if I need to I can delete all public_html folder without deleting my datas...

Last edited by Julien PHAM; 07-11-2009 at 06:46 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-12-2009, 03:10 AM
BANNED
 
Join Date: Jun 2005
Location: Wild Wild West
Posts: 2,026
Spiral will become famous soon enough
Thumbs down

Quote:
Originally Posted by Julien PHAM
I find it far more convenient than having to delete all files in the public_html folder then install the new drupal version and move the files elsewhere. (as by default untar the drupal puts it in a subfolder of the current folder)
Who said anything about deleting any files?

Quote:
Originally Posted by Julien PHAM
I have created a drupal directory in /home/ In this drupal directory I put the different versions of drupal, such as drupal.6-11, drupal.6-12, and so on.

In /home/username/public_html, there is no drupal directory, the drupal is just a symbolic link that points to /home/drupal/drupal version

This way, when I upgrade drupal, I just have to unzip/untar the new drupal version in /home/drupal and to change the symbolic link to point to the new drupal version.
What in the world ?????

Nice improvising on the symlink but if you think you have to delete files or take all those ridiculous extra steps to upgrade your Drupal installation, then the other part of my previous post statement truly does apply:
Quote:
Originally Posted by Spiral
Sounds more to me like you don't know what you are doing or otherwise
don't know how to install your CMS program correctly!
And then you say ...
Quote:
Originally Posted by Julien PHAM
Not at all, you do not understand...
I understand perfectly and I know how to install Drupal just fine!

It's clearly you who doesn't understand much per your own posts!

Now if you need help installing (or upgrading) without so many weird extra steps, i'd only be too glad to assist ...

Otherwise, or if you prefer, go on ahead and take 10 extra steps doing things you don't have to do, and making a lot more work for yourself in the ironic name of "making things easier"! There is no need to create extra folders, use symlinks however creative that might be, or delete any files and, the original topic of this thread -- IE: changing your account's home path which is not recommended in general under normal circumstances and especially so when there is no practical reason to do any of that in the first place!

Incidentally, you do know you can extract the files from both TAR and ZIP archives without the folders, right?

Last edited by Spiral; 07-12-2009 at 03:45 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-13-2009, 02:07 AM
Registered User
 
Join Date: Jul 2009
Posts: 25
Julien PHAM is on a distinguished road
And what about going back to previous version? With my solution you just have to change the symlink. With your solution you have to install back the previous one. I prefer my method.

And moreover, perhaps you do not have to delete old files, but I prefer to have a clean drupal directory. So imagine if from one version to another there are some files that are not needed anymore, if you just install new drupal to the same directory, those files will still be there. Not needed but still be there. And the new drupal installation will override old files, so if I want to check how the old files look like, it is less easy.

I know what I'm doing, but I prefer this symlink method. I prefer to separate the drupal install directory from the sites drupal folder as well.

Before using drupal I used typo3. Typo3 used symlink a lot, and I found this very convenient. And so when I migrated to drupal I kept this symlink method.

I prefer a new, fresh drupal install when I migrate to a new drupal install than overriding old files.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-29-2009, 06:05 AM
Registered User
 
Join Date: Sep 2009
Posts: 1
odox is on a distinguished road
I have the same issue with Cpanel and Drupal (warning : newb)

The drupal site is running on www.mydomain.com/drupal

I'd like it to run on www.mydomain.com

At the moment i've just got it forwarding to the /drupal.

Can someone provide me with simple steps on how to do this?

Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 09-29-2009, 10:51 AM
cPanelDavidG's Avatar
Technical Product Specialist
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,615
cPanelDavidG is on a distinguished road
The questions posted to this thread do not seem to be cPanel/WHM-specific.

You may receive faster responses specific to Drupal from Drupal experts if you post to the Drupal forums. Those forums are located at: http://drupal.org/forum
__________________
- cPanel David G., Lead Forum Administrator & cPanel Technical Product Specialist
Do you want 50% off your cPanel Conference Admission? View Coupon Code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 10-03-2009, 10:20 AM
votethehost.com's Avatar
Registered User
 
Join Date: Oct 2009
Location: Chicago
Posts: 27
votethehost.com is on a distinguished road
I agree to cPanelDavidG that this is not a cpanel related question but then also I would like to add something to this. Any php application like, durpal, phpbb etc have two important things, one is the configuration file and other is database. When you install any php application the document root of the application (location where application is installed can be public_html or even a sub directory under it) is recorded in configuration files and even sometimes in database attached to it. If you need to change drupal installation from a sub directory to public_html directory you have to do following things:

first copy all files from the sub directory to directly under public_html, now check the config file of drupal and see where you can change the installation path also if any entry for path is in database then you have to edit it. (Generally its not in database but mostly in config file)

Its a bit tricky thing to do but if you have a little idea of drupal files then it is possible.


Thanks.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 10-22-2009, 10:03 AM
Registered User
 
Join Date: Oct 2009
Posts: 2
linux25 is on a distinguished road
Folder other than public_html

First, this is a cPanel issue because without cPanel, you just set the DocumentRoot in httpd.conf.

Second, Spiral needs to SFTU. This is a forum for cPanel newbies. Bashing people in here helps no one. I guess it helps your self-esteem, Spiral, but get a life. And you don't know what is ridiculous. Every admin has a different need and a different configuration. If you are such an expert, you would know that.

No one looked to see what the real answer here is.

To do what Julien PHAM is trying to do, create a file "/usr/local/apache/conf/userdata/std/2/accountname/sitename/accountname.conf". Replace 'accountname' and 'sitename' with the cpanel account name and the website name. In the file give the DocumentRoot directive for the site. Then run /scripts/rebuildhttpdconf. Then restart Apache.

If you go to edit /etc/httpd/conf/httpd.conf you will find the instructions near the virtual host settings for the host you are trying to modify.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory mode changing by itself ? bignose cPanel and WHM Discussions 0 03-13-2008 03:17 PM
How to move/change the ftp base directory ? pstein cPanel and WHM Discussions 7 03-08-2007 01:50 PM
Changing Home Directory hotsos cPanel Newbies 3 07-28-2006 11:28 PM
changing size of directory ?? basic cPanel and WHM Discussions 3 02-12-2006 10:57 AM


All times are GMT -5. The time now is 11:10 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc