# setting up VsFTPd for web uploading to the webserver



## JonathanAnon (Dec 17, 2004)

Should I just change the home directory of my Apache to the default directory of the FTP server and then set the file permissions on this. 

Or is there any easier way to set it up.


----------



## Squashman (Apr 4, 2003)

Who needs access to upload files to your Web Server? Do you just use this server for yourself?

I don't use FTP anymore since OpenSSH gives me the ability to use Secure Copy and Secure FTP, which doesn't send my password in clear text over the wire.

I have Apache setup with Virtual Servers so every user on my system has their html directory in their home directory (/home/username/public_html).


----------



## JonathanAnon (Dec 17, 2004)

I have a web server where I want to give the users write access to their own web folders only. Simple as that.


----------



## Squashman (Apr 4, 2003)

Where are their web folders located?


----------



## JonathanAnon (Dec 17, 2004)

are located in 

/var/www/html/website1
/var/www/html/website2

etc etc

The users I have setup have access to to much - from the html folder up. 
And I cant get the virtual hosts to work I am sure that this is permissions as well. Where can I find exactly what permissions each folders requires.


----------



## Squashman (Apr 4, 2003)

I would say you don't have your Apache config file setup correctly if you can't get Virtual Hosts setup correctly or if you can't get their websites to run in their home directories. Apache is rather easy to configure if you want users home directories to be in /home/username/public_html

Then there web space will be http://www.somedomain.com/~username

If you want them to be a subdomain or have their own domain , then you will need to get Virtual Servers running.


----------



## JonathanAnon (Dec 17, 2004)

Ok I think it's something to do with the fact that I created everything through the root user. 
See I only have ssh access to the server as it is on a remote site. I would usually use the user GUI. Im gonna go through the LAMP document and try to do everything from scratch correctly. Rather than just messing around with it. 

Thanks for your help anyway.


----------



## Squashman (Apr 4, 2003)

I configure everything with SSH. I dont even install a GUI on any of my servers.


----------



## JonathanAnon (Dec 17, 2004)

Well I'm a web designer / mostly windows based networker. I have one problem driving me mad now. I mean why dont it just work out of the box like Microsoft products.

Set up the virtual hosts on Apache and now only the first host shows up when any of the host domains are requested??? I mean the thing is going out the window if I dont get this sorted soon.

<VirtualHost *:80>
DocumentRoot "/var/www/html/hillofallen"
ServerName www.hillofallen.net
<Directory "/var/www/html/hillofallen">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *>
DocumentRoot "/var/www/html/leinstergas"
ServerName www.leinstergas.com
<Directory "/var/www/html/leinstergas">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

Only the first website shows up for all domains. I have only shown two here but there are more. ANY ideas - it's three o'clock in the morning and I'm going mad. Oh i have the dns directed through HOSTS file until it is working.


----------



## Squashman (Apr 4, 2003)

I can't say that IIS will work out of the box, like you say it will. I actually highly doubt it.

Do you have this uncommented?
NameVirtualHost *:80

Did you restart the httpd service?

What is the Document Root in the main configuration file?

You need to get rid of the Quotes. I really don't think you need to put in the Directory Directive either.

I would put everything in their home directories.
You can put the Options Indexes in a .htaccess file. I would not turn that on by default. Bad idea. You don't need the allow from all.

<VirtualHost *:80>
DocumentRoot /home/jsimkowski/html
ServerName jason.somedomain.com
ServerAdmin [email protected]
ScriptAlias /cgi-bin/ /home/jsimkowski/cgi-bin/
ErrorLog logs/jeremy.somedomain.com-error_log
CustomLog logs/jeremy.somedomain.com-access_log common
</VirtualHost>


----------



## JonathanAnon (Dec 17, 2004)

Brilliant. well done. That line was missing. 

NameVirtualHost *:80

I'm using Webmin and it seems to be buggy as hell. I mean I worked the whole Virtual Host setup through it's Apache interface, so as not to make any mistakes using vi editor (as the server is in another country and I have limited access). Think I'll be bypassing Webmin in the future. 

Thanks again, I'm headn to bed for a few hours before the morning.


----------



## Squashman (Apr 4, 2003)

Webmin will host your Apache config file. You can't edit it with VI and then edit it with Webmin. It will usually end up screwing up the config file. 

I would learn VI or actually VIM which has Text highligting. Or, give Pico a try if it is installed on that machine.


----------



## JonathanAnon (Dec 17, 2004)

Hey I had the same issue for setting up the SSL. Had to add

NameVirtualHost *:443

to the httpd.conf manually again. Is Webmin that badly programmed???

Everything is okay now though. Sites working fine over SSL. Have to put up phpMyAdmin now.


----------



## Squashman (Apr 4, 2003)

I had an issue with SSL as well when I upgraded from Rh7.2 to Rh9. I believe RH7.2 was using apache 1.2 and Rh9 was using Apache 2.x. I don't remember what we did to fix the issue. My other admin fixed it. I would have to look at his documentation to find out. I know it wasn't what you did.


----------



## JonathanAnon (Dec 17, 2004)

Well I was a bit confused when I put on phpMyAdmin. When I went to the setup script it tells me "warning: not working over a secured connection" even though the address is https://www.xxx.ie - I run a packet capture with Ethereal and the information is encrypted. Is there any test other than this you can to to make sure it is encrypted.


----------



## dsartain (Feb 5, 2007)

Hi, I'm having issues getting any ftp users (whether with full access or chrooted to /var/www/html) to be able to read the /var/www/html dir via FTP and they can't upload either...

/var/www/html and all ancestor dirs are chmod 0777 (I even tried 7777)

I even tried creating a link between /home/user and /var/www/html/user and it still gave me the same issues....Any ideas??

VSFTPD.CONF FILE:


> # Example config file /etc/vsftpd/vsftpd.conf
> #
> # The default compiled in settings are fairly paranoid. This sample file
> # loosens things up a bit, to make the ftp daemon more usable.
> ...


----------

