proftp and virtualhost

Rick Stevens ricks at nerd.com
Thu Apr 24 17:08:28 UTC 2008


Guillaume wrote:
> hi,
> 
> I request your help to run two ftp sites on the same machine with
> proftpd & virtualhost.
> 
> in my case, i have 2 domains 1.com & 2.com
> 
> I start creating configuration files -one conf file per host- but it's
> not working has expected.
> 
> My config:
> 1 host with ONE IP adress.
> 	+the default ftpsite with higth access restriction
> 	+the www1 site with some settings, root is located in /data/www1.com
> 	+the 2.com ftp server with other settings. Root is located in /data/www2.com
> 
> I want a behaviour like apache virtual host and i don't know if its possible

Not possible.  FTP does not support the concept of "host headers" which
is what Apache's <VirtualHost> depends on.  You can only have one FTP
site per IP address.  You could split the content up based on the
username someone uses to get in, but it's still one site.  Sorry.

> 	-> when user enter the IP adress of the fedora box, the default
> website send the response, and so on, user is unable to connect.
> 	-> when user enter the domain name he's redirected directly to the
> right ftproot.
> 
> 
> Actually, ALL ftp connection are redirected to the default ftpsite.
> 
> The www1.conf host is registered in the local dns & point to the local
> ip of the server (192.168.28.30)
> 
> Hope someone could help me.
> 
> Here is a sample of my config files.
> 
> -------- /etc/vsftpd.conf -----------
> ServerName                      "Default FTP server"
> ServerIdent                     on "FTP Server ready."
> ServerAdmin                     root at website
> ServerType                      standalone
> DefaultServer                   on
> AccessGrantMsg                  "User %u logged in."
> DeferWelcome                    off
> TimeoutIdle                     600
> Include                         /etc/proftp.d/www1.conf
> DefaultRoot                     ~ !superuser
> AuthPAMConfig                   proftpd
> AuthOrder                       mod_auth_pam.c* mod_auth_unix.c
> IdentLookups                    off
> UseReverseDNS                   off
> Port                            21
> Umask                           022
> AllowRetrieveRestart            on
> AllowStoreRestart               on
> MaxInstances                    20
> User                            nobody
> Group                           nobody
> UseSendfile                     no
> ScoreboardFile                  /var/run/proftpd.score
> <Global>
>   AllowOverwrite                yes
>   <Limit ALL SITE_CHMOD>
>     AllowAll
>   </Limit>
> </Global>
> 
> 
> 
> -----------------/etc/proftp.d/www1.conf-----------------------
> <VirtualHost www1.com>
> ServerName "www1.com"
> MaxClientsPerHost 2 "Sorry, no more than two simultaneous connections allowed"
> DefaultRoot /data/www1.com
> DisplayConnect /etc/ftpissue
> ServerLog /var/log/proftpd/www1.com.log
> TransferLog  /var/log/proftpd/xfer.www1.com.log
> TimeoutIdle 300
> TransferRate RETR 250:0
> </VirtualHost>
> 
> 


-- 
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                       rps2 at nerd.com -
- Hosting Consulting, Inc.                                           -
-                                                                    -
-         Microsoft Windows:  Proof that P.T. Barnum was right       -
----------------------------------------------------------------------




More information about the users mailing list