Results 1 to 7 of 7

Thread: Apache chroot question... [resolved]

  1. #1

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Resolved Apache chroot question... [resolved]

    Greetings people...

    First off, sorry if this is in the wrong section, but I couldn't figure where to put my thread, move if needed...

    I just bought a domain of one & one (great deal 7$ domain)... and I don't think you can enable a wildcard (*.mydomain.com) through them... which I usually used with apache.

    I used my sub-domains for user webpages, they have full access to their root, but they have access denial to anything else...

    apache config:
    Code:
    <VirtualHost *>
     DocumentRoot d:/web/member/USERXXXXXXXX
     ServerName USERXXXXXXXX.mydomain.com
     User USERXXXXXXXX
     Group MYGROUP_FTP
     php_admin_value open_basedir "z:/web/member/USERXXXXXXXX"
    </VirtualHost>
    so there, that was the way I locked them... however, since 1 & 1 does not allow wildcard fowarding (or so I think, help me on this if yes),

    My question is this how can I lock them to a folder... instead of a domain?

    let's say I do a virtual directory of

    mydomain.com/member/USERXXXXXXXX

    how can he be locked to z:\web\member\USERXXXXXXXX?

    (I'd need to change "ServerName USERXXXXXXXX.mydomain.com" by something that gets a folder instead of a domain)

    Thanks in advance to break out your heads for me...!!!!!


    Last edited by Ruku; Apr 27th, 2006 at 06:25 PM.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  2. #2

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: Apache chroot question...

    *bump*

    A friend of mine showed me "htaccess" methods in the apache config file...

    what htaccess does is simple, it gives read/write permissions over the directories you have within apache (real or virtual).

    However, the problem is that all users would have read access to my main .php files, which is a problem.

    I really need to chroot the folder, so that the php files within the folder don't have access to anywhere else than within the folder...

    my brain is still going on this... any help, any at all?
    Last edited by Ruku; Apr 19th, 2006 at 01:46 PM.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Apache chroot question... [Unresolved]

    Change permissions either through an FTP client or your hosting software such as Cpanel or DirectAdmin, both have file system tools.

  4. #4

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: Apache chroot question... [Unresolved]

    All the permissions are already set...

    What I'm looking for is a way to login the user locked under the permissions over a specific folder, which would be his root...

    (I don't need 1 general user account, I need to chroot all users individually)

    how do I do that through apache config?

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Apache chroot question... [Unresolved]

    The only way you can croot PHP is to have it start as root, carry out the chroot and demote itsself to the user you want to run it as. There are programs that do this for you, such as suexec. To do this you need to have PHP run as a CGI not a web server module.

    Another method you can use is the powerful URL rewriting module in Apache. A request to http://www.example.com/user/ gets rewritten to http://user.example.com/ (you can then have a name server running on the server which resolves unknown .example.com addresses to the IP address of the server).
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Apache chroot question... [Unresolved]

    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  7. #7

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: Apache chroot question... [Unresolved]

    Quote Originally Posted by visualAd
    thx alot... for now, I can rewrite

    mydomain.com/member/member1 (limited subdomains, no wildcard, but .com)

    to

    member1.mydomain.gotdns.com (wildcard, but .gotdns.com)

    it still has the ugly gotdns part... but it's better than nothin'...!

    !

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width