FTP problem


#1

Hello,

I have created a new FTP user

Mydomain/Home/User_name

so when The user upload something he can see them but when he post them we can’t download .

E.g :

http://www.mydomain.com/user_name/File_name

it appears " File not found" How can i fix it ? I can see the files in his FTP.

Any help ?

Thanks :slight_smile:


#2

[quote]
I have created a new FTP user

Mydomain/Home/User_name

so when The user upload something he can see them but when he post them we can’t download .

E.g :

http://www.mydomain.com/user_name/File_name

it appears " File not found" How can i fix it ? I can see the files in his FTP.[/quote]
You know how on Windows and other OS you can login as different users and get your own menus and desktop and have separate places to keep your data? It’s the same at DreamHost with the Linux they use. So if you have a program and your are running it as “User A” then you specifically have to tell that program to open files that belong to someone else “User B”

You’ve managed to skip that step. Your User B needs a special subdirectory of his own - call it “uploads” if you want. He needs to move his files to that directory. You need to write down that full path as well eg. /home/userb/uploads Then to inform the web server (which by default wants to work with “User A” files) to user these “User B” files follow the directions in my other post here: http://discussion.dreamhost.com/showthreaded.pl?Cat=&Board=forum_beginners&Number=121414&page=&view=&sb=&o=&vc=1#Post121414

Customer since 2000 :cool: openvein.org


#3

i sent you a pm - please can you help me?


#4

Subdomains might be easier for you instead of alias or symlinks.

First create the FTP user in the DreamHost Web Panel at Users -> Manage Users. You will note that when doing so there is a Home Directory and you will need to write this down.

After creating the user go to Domains -> Manage Domains and click on “Add New Domain / Sub-domain” button. There are several forms on this page we are only concerned with “Fully Hosted”.

For example if you domain is ‘example.com’ and the user is ‘bob’

Domain to host: bob.example.com
Do you want the www in your URL? Remove WWW
Run this domain under the user: bob
Web directory: /home/username/bob.example.com
PHP mode: CGI (unless you know you are using FastCGI apps)
Extra Web Security? Check

Leave the rest uncheck, then submit “Fully host this domain now”.

In a few minutes ‘bob’ should see a directory appear in his home directory named ‘bob.example.com’ but if it doesn’t he can make it himself. In other words, when logging into FTP as ‘bob’ a person should see:
Maildir/
bob.example.com/
logs/

And the files need to be uploaded into the bob.example.com directory.

The important thing is that for any files to appear at http://bob.example.com/ you MUST login as user ‘bob’ and you MUST put the files in the bob.example.com directory. You CAN NOT login to FTP as a different user.

Customer since 2000 :cool: openvein.org


#5

Thank you so much.

But I have a question why would I need a subdomains?

I need to upload some Files using a directory :
mydomain/bob

so when he upload, the links must be mudomain.com/bob/My_Files_here

till Now i am not getting why a subdomain ? to get the things work.

In all the other companies you can create FTP and that’s all. No need for sub-directory or something.

I’ll try this Guide and see if it works because I need mydomain/bob not mydomain/bob.mydomain.com …

Thanks


#6

[quote]till Now i am not getting why a subdomain ? to get the things work.

In all the other companies you can create FTP and that’s all. No need for sub-directory or something.

I’ll try this Guide and see if it works because I need mydomain/bob not mydomain/bob.mydomain.com …[/quote]
I’ve told you how to use a subdomain because you don’t understand my step-by-step instructions with using url-paths. Unfortunately it appears your lack of understanding is due to a reliance on “user friendly tools” instead knowledge of how the web site server software works.

Going over this again:

Your domain is 'example.com
And you have users “bob” and “alice”

When setting up ‘example.com’ as fully-hosted, DreamHost tell the web server software (Apache) to look for files in a “Web Directory” of the “FTP / CGI runs-as user”. In this case that user is bob and the “Web Directory” is going to be ‘/home/bob/example.com’ as a result. This means the web server software is told to look in ‘/home/bob/example.com’ for files when someone browsers to ‘http://example.com/

Now the next thing you need to understand is url space. The part after the hostname is call the url-path and for web sites most of the time it looks like a directory path. The web server can interpret this path in different ways but the default way is to match it to a file system path starting with the “Web Directory”. You must understand though that a url-path is not a file system path but it can be mapped to a file system path or interpreted other ways.

In order to do what you want, you have to setup an exception to the default behavior of mapping the url-path to a file system path relative to the “Web Directory”. In order to do what you want, you have to tell Apache to map certain url-paths (those beginning with /alice/) to a directory unrelated to ‘bob’

You have ‘alice’ setup with her home directory of ‘/home/alice’ so create a directory for ‘alice’ called ‘/home/alice/uploads’ which will be the directory we will tell Apache to look for the ‘alice’ files.

With Remap Sub-dir will tell Apache that for url-paths starting with /alice/ we want it to skip looking at ‘bob’ files and to look at ‘alice’ files in particular ‘/home/alice/uploads’ and that way http://example.com/alice/page.html is mapped to /home/alice/uploads/page.html

I’m sorry but if you have a hard time understand the process. The actual server software documenation is available here: Apache documentation - Alias directive

Customer since 2000 :cool: openvein.org