Menu

What I'm trying to do

Help
David Lew
2000-09-28
2000-11-23
  • David Lew

    David Lew - 2000-09-28

    Here's my situation. I have an account with a webhost company. In my account, I have several domains for my clients but they're all under my account. The dir structure is like this
    /path/to/myname/
    www.domain1xxxx.xxx
    www.d2xxx.xxx
    etc etc
    Each has their own dir with a cgi-bin, include, html
    Since I don't want them to have my ftp info, I'd like to use phpwebhosting to allow each client to upload files directly into their own dirs
    Thanks

    David

     
    • Jason Wies

      Jason Wies - 2000-09-28

      That setup isn't supported by PHPWebHosting, because it is a very exotic setup.  However, it shouldn't be hard to change a few lines to get it to work.  What would be needed is to create symlinks from /path/to/myname/phpwebhosting/public_html/username to /path/to/the/real/username/public_html.  If you don't need to add new users, just add the symlinks by hand (using 'ln -s').  Note that files in the directory will not show up in PHPWebHosting unless they are uploaded via the web interface, so its not a good idea to mix it with ftp.

      If you want to enable web-based signups, reply to this, and I'll see if I can make it work.  I'll also need a list of the directories and files (and their sizes) that are included in their directory by default, because they will have to be added to the database whenever someone signs up.

       
      • David Lew

        David Lew - 2000-09-29

        Here's an actual account, altho the domain is currently being transferred
        /accounts/dlew/www.linuxaddict.com/html - html
        /accounts/dlew/www.linuxaddict.com/include - nonweb like sql.inc
        all others follow the same format

        /accounts/dlew/www.domain.com/html
        /accounts/dlew/www.domain.com/include
        No files are created by default, right now I'm moving a bunch of clients from one host to another, the file sizes vary, but no one has more then 3M in an account so far

         
        • Jason Wies

          Jason Wies - 2000-09-29

          So you should install PHPWebHosting in /accounts/dlew/phpwebhosting.  Change $rootdir to /accounts/dlew/phpwebhosting/public_html.
          Then use 'ln -s /accounts/dlew/www.linuxaddict.com /accounts/dlew/phpwebhosting/public_html/linuxaddict'.

          Then create an account using signup.php with the username 'linuxaddict', and whatever password you want for them.  You may get an error about not begin able to create the directory; that is expected.

          Then login as that user and create the two directories, html and include.  They should then be able to login as 'linuxaddict' and put their files in html and include, and make new directories and the whole bit.  As for adding the existing files to the database, you're on your own there.  I'll add indexing to my TODO list, but its definitely a low priority.

           
          • David Lew

            David Lew - 2000-09-29

            Thanks I will do this!

             
          • David Lew

            David Lew - 2000-11-15

            Here's an update. They've upgraded to php4.0x and a newer mysql.
            I have shell access now and am testing again.
            /accounts/dlew/www/www.linuxaddict.com/html
            i did ln -s /accounts/dlew/www/www.linuxaddict.com /accounts/dlew/phpwebhosting/public_html/linuxaddict
            pwd
            /accounts/dlew/phpwebhosting/public_html
            ls -l
            lrwxr-xr-x  1 dlew  ftp  38 Nov 15 00:04 linuxaddict -> /accounts/dlew/www/www.linuxaddict.com

            i have no write perm to /accounts/dlew/www, only to /accounts/dlew
            and /accounts/dlew/www/www.host.com/html
            I can create a user linuxaddict ok
            I can u/l and create dirs altho i do not see them on the filesystem at all, so I wonder where it really is!
            $rootdir = "/accounts/dlew/phpwebhosting/public_html";
            so i notice this:
            http://www.linuxaddict.com/linuxaddict/test/testfile
            my mind is blank, please help!
            thanks

             
            • David Lew

              David Lew - 2000-11-15

              $split = preg_split ("|/|",preg_replace("|^http(.*)://|","",$hostname),2);
              $hostname_domain = $split[0];
              $hostname_path = '/' . $split[1];
              the $hostname_path = '/' . $split[1]; gives an error

              Warning: Undefined offset: 1 in /shell/accounts/dlew/www/www.linuxaddict.com/html/main.inc on line 39

               
              • Jason Wies

                Jason Wies - 2000-11-18

                That has been fixed in the CVS.  Getting public_html/main.inc from the tree (see https://sourceforge.net/cvs/?group_id=8677\) will fix the error, or you can be brave and get all of the CVS tree, but I wouldn't recommend it at this time.  Hopefully I'll release a new tarball this weekend; there are certainly enough changes to warrant it.

                 
            • Jason Wies

              Jason Wies - 2000-11-18

              You lost me with your command sequence.  How can you have write access to /accounts/dlew, but not a subdirectory thereof?  Ownership and access are inherent unless specifically set otherwise.

              In any case, the important thing to remember is that Apache is run from the nobody account, and thus the nobody account must have access to write to the public_html and groups directories.  So just 'chmod 777' the public_html and groups directories, and new accounts should be fine.  To change linuxaddict's directory permissions, just do:

              'chmod 777 /accounts/dlew/phpwebhosting/public_html/linuxaddict'

              and maybe also change the mode of the symlink also:

              'chmod 777 /accounts/dlew/www/www.linuxaddict.com'

              And of course realize that giving everyone write access isn't the best solution, but it is the most common and in your case may be the only solution.

               
              • David Lew

                David Lew - 2000-11-18

                $rootdir = "/accounts/dlew/phpwebhosting/public_html";
                $hostname = "http://www.linuxaddict.com";
                $outdir = "/accounts/dlew/www/www.linuxaddict.com/include";
                I symlinked /accounts/dlew/www/www.linuxaddict.com to
                /accounts/dlew/phpwebhosting/public_html :
                [shell8 ~/phpwebhosting/public_html]$ ls -l
                total 16
                lrwxr-xr-x  1 dlew  ftp    38 Nov 15 00:04 linuxaddict -> /accounts/dlew/www/www.linuxaddict.com
                my problem is it's trying to do this
                http://www.linuxaddict.com/linuxaddict/
                every dir I make goes under linuxaddict subir under html/
                the perms are ok, they have it so anything made or u/led has my user/group name

                 
                • Jason Wies

                  Jason Wies - 2000-11-18

                  The problem is that you're symlinking into a directory that already exists.  When you do 'ln -s /accounts/dlew/phpwebhosting/public_html/linuxaddict /accounts/dlew/www/www.linuxaddict.com', you're actually linking to /accounts/dlew/www/www.linuxaddict.com/linuxaddict.

                  So to fix it, delete the www.linuxaddict.com directory /before/ symlinking, and then re-upload any files you had before.

                  "the perms are ok, they have it so anything made or u/led has my user/group name"  That might be true for ftp and shell access, but Apache is a completely different system.  chmod 777 everything if the files aren't showing up.

                   
                  • David Lew

                    David Lew - 2000-11-20

                    I have no permissions over /accounts/dlew/www dir as that's where all the virtual domain dirs are made by root
                    I have perms to each of the subdirs under www tho
                    Thus I cannot symlink it the other way. Is there a way to have / think it's the root dir rather then let's sat /linuxaddict?

                     
                    • Jason Wies

                      Jason Wies - 2000-11-20

                      The strange thought just occured to me that you might be able to link public_html/linuxaddict to www.linuxaddict.com/linuxaddict, and then link THAT to www.linuxaddict.com or vise versa.

                      In any case, this seems to be a system administration issue.  Not that I don't want to help, but there are far better sources of information than me.  Look at the man pages, use --help, ask on IRC (irc.openprojects.net, #linuxhelp).  A good solution is bound to pop up.

                       
                      • David Lew

                        David Lew - 2000-11-21

                        Whatever I try to do, it ends up still trying to go to the subdirectory of the username...like it keeps trying to
                        http://www.linuxaddict.com/linuxaddict/filename
                        is there a way to remove the /username and start from / on?
                        I guess this way require playing with the php code...
                        This is just one domain of 31 I'll be doing...

                         
                        • Jason Wies

                          Jason Wies - 2000-11-23

                          If you're going to do 31 domains, I'd suggest asking the administrator to link the directories.  Are you paying for this hosting service?  If so, I'd demand that they do it.  Its not hard for them to do, and you're paying for it.

                          If you want to get rid of the /username, you'll have to change the code.  It wouldn't be THAT big of a project, but I have enough to do, so you're on you're on if you choose that path.  As a hint, you'll have to remove every $userinfo[username] that is in a call to the filesystem (ie copy() and rename()), and also change the link in the table.

                          Also, you could copy or link the files inside of public_html (except main.inc) into each domain's directory, copy main.inc into each domain's directory, set $rootdir = '/whatever/dlew/www', and add www.whatever.com to the $rootdir/ in every require() (they're only used in main.inc IIRC).  They would then log in as 'www.whatever.com', and PHPWebHosting would put their files in '/whatever/dlew/www/www.whatever.com'.  I think in theory this should work, but I didn't test it, so there may be some side effects.

                           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.