Help - Search - Members - Calendar
Full Version: Running MT in a chroot environment
Movable Type Community Forum > Additional Resources > Tips and Tricks
neurostar
Hello,

I recently switched from hosting at home to a *real* hosting place. However, it broke mt. I can add entries to the database, but the files won't rebuild. I get this error when rebuilding:

QUOTE
mkdir /home/neurostar: Permission denied at lib/MT/FileMgr/Local.pm line 104


I know it's because the chroot "feature" makes it so I've got my own little filesystem. However, the mt cgi scripts don't run under my name, so they don't have access to the filesystem in the same method. Is there a way to make mt work without knowing the actual path? i.e. can I make the script run under my username?

Update: I don't have access to the "setuid" command either.

Thanks,

neurostar
neurostar
Ummm... I guess I posted this in the wrong board. Could an admin move it to "install troubles"?

Thanks,

neurostar
vandahm
You aren't having problems because MT is running under a different username (although it probably is). You're having problems because your shell (a 'shell' is the UNIX command prompt) and the webserver don't agree on which directory is the "root" directory. Your ISP gave you a chrooted shell so that you can't peek into other user's directories and mess with their files. But the webserver needs to see all the directories, since it has to serve web pages from them.

I had the same problem, and it's pretty easy to fix. I just made my paths relative to the directory in which the CGIs were installed. I don't know how much you already know about how directories work in UNIX, so to be safe I'll assume you are a total beginner, and you can just skip over the stuff that you already know.

Say that your Moveable Type CGIs are installed in:

CODE
/public_html/weblog/mt_dir

This means that "mt_dir" is inside of "weblog," which is inside of "public_html", which is inside of what your shell thinks is the root directory. Now say that you want your index.html file to be in
CODE
/public_html/weblog/main/

Here's what you want MT to do:
  • Start in the directory in which the MT CGIs are located.
  • Go backwards, into the weblog directory.
  • Go forwards into the main directory.
In a path statement, two periods ("..") mean "the directory that's one jump backwards from this one." So, the final path statement looks like
CODE
../main

You can have multiple ".." gizmos in a path statement if you need to go backwards by more than one directory. In our example, this path statement would be equivilant to /public_html
CODE
../../

This works because, since your path statements always start from the MT CGI directory, it doesn't matter where the "root" directory is.

Hope this helps,

Steve
bmk
more
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.