Mica enciclopedie Romaneasca
Instalare Container VPS-uri pe CentOS 5.4
In acest scurt tuotrial voi descrie modul de instalare al Kernel-ului OpenVZ pe sistemul de operare CentOS 5.4 OpenVZ este varianta cu sursa-deschisa (OpenSource) a renumitului Virtuozzo. Ok, Sa incepem: 1. Instalarea OpenVZ Cel mai simplu mod de instalare este sa adaugam in repository-ul YUM si adresa openVZ. Pentru aceasta executam urmatoarele comenzi: cd /etc/yum.repos.d wget http:/...
Installing PHP 5.3, Nginx And PHP-fpm On Ubuntu/Debian
Since Apache is most of the time a memory hungy process, people started to look for different ways to host their website. Apache is clearly not the only webserver available. A few good examples are lighttpd and nginx. In this tutorial I will show you how to install it on your Ubuntu server. This tutorial also applies to Debian, though. There is only a very small difference. Ready? Let's begin...
VBoxHeadless – Running Virtual Machines With VirtualBox 3.1.x On A Headless Debian Lenny Server
This guide explains how you can run virtual machines with Sun xVM VirtualBox 3.1.x on a headless Debian Lenny server. Normally you use the VirtualBox GUI to manage your virtual machines, but a server does not have a desktop environment. Fortunately, VirtualBox comes with a tool called VBoxHeadless that allows you to connect to the virtual machines over a remote desktop connection, so there's no n...
Server Monitoring With munin And monit On Debian Lenny
In this article I will describe how you can monitor your Debian Lenny server with munin and monit. munin produces nifty little graphics about nearly every aspect of your server (load average, memory usage, CPU usage, MySQL throughput, eth0 traffic, etc.) without much configuration, whereas monit checks the availability of services like Apache, MySQL, Postfix and takes the appropriate action such ...
How To Install Z-Push On An ISPConfig 3 Server (Debian Lenny)
Z-push is an implementation of the ActiveSync protocol which is used 'over-the-air' for multi platform ActiveSync devices, including Windows Mobile, iPhone, Sony Ericsson and Nokia mobile devices. With Z-push any groupware can be connected and synced with these devices. This install of Z-Push is on a The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3] setup. I'm using z-push on my 1st w...
How To Set Up Apache2 With mod_fcgid And PHP5 On Ubuntu 8.10
This tutorial describes how you can install Apache2 with mod_fcgid and PHP5 on Ubuntu 8.10. mod_fcgid is a compatible alternative to the older mod_fastcgi. It lets you execute PHP scripts with the permissions of their owners instead of the Apache user. I do not issue any guarantee that this will work for you!   1 Preliminary Note I'm using an Ubuntu 8.10 server in this tutorial wi...
Instalare ProFTP cu suport MySQL pe *.deb
Presupunand ca avem deja instalat PHP5 cu suport pentru MySQL (Gasiti tutorialul de instalare pe situl http://auto-scripts.com) putem incepe procedura de instalare a clientului FTP (in acest caz ProFTP) cu suport MySQL. 1. De ce instalam cu suport MySQL? Deoarece in acest fel putem realiza un numar infinit de conturi FTP virtuale, putem schimba parolele extrem de simplu, putem crea limita de ...
Cum sa repari/citesti un CD sau DVD zgariat sau ars
Battlefield: Bad Company 2, superior pe PC
   Battlefield Bad Company 2 Intr-o era in care jocurile pe PC au inceput sa devina niste simple portari ale versiunilor de consola (de multe ori neadaptate asa cum ar trebui posibilitatilor oferite de un computer), Battlefield: Bad Company 2 pare a fi o exceptie de la aceasta nefericita regula.Din trailerul de mai jos puteti afla ce avantaje va prezenta versiunea de PC a lui B...
Download si instalare Windows 7 in limba romana
Download linkPentru instalare: 1. Deschideti control panel si faceti click pe Change Display Challenge sub Clock, Language, and Region Box. Daca folositi Classic View, selectati Regional and Language Options. 2. Mergeti la “Keyboards and Languages” tab si faceti click pe Install/Uninstall Languages  Navigati unde aveti salvat, si deschideti-l.Acum pachetul trebuie sa va apare...

Instalare ProFTP cu suport MySQL pe *.deb

Posted By: admin on April 13, 2010 in Tutoriale - Comments: No Comments »

Presupunand ca avem deja instalat PHP5 cu suport pentru MySQL (Gasiti tutorialul de instalare pe situl http://auto-scripts.com) putem incepe procedura de instalare a clientului FTP (in acest caz ProFTP) cu suport MySQL.

1. De ce instalam cu suport MySQL?
Deoarece in acest fel putem realiza un numar infinit de conturi FTP virtuale, putem schimba parolele extrem de simplu, putem crea limita de trafic (Trafic Quota) sau limita de spatiu pe disk (Disk Quota), practic nu exista limita de extensibilitate.

2. De ce am nevoie pentru a putea configura ProFTP cu conturi virtuale?
ProFTP-ul implicit (instalat cu comand apt-get install proftpd) nu contine si modulul pentru Virtual FTP, acesta trebuind instalat cu comanda:
apt-get install proftpd-mysql
Sau
apt-get install proftpd-mod-mysql
La instalare ne va aparea o intrebare de genul:
Run proftpd from inetd or standalone?
Selectam standalone .

3. Ok, am instalat programul, si acum?
Dupa instalarea propriu-zisa, urmeaza configurarea ProFTP.
Avem nevoie de un utilizator si un grup pe care va rula daemon-ul ProFTP:
groupadd -g 5500 ftpgroup
useradd -u 5500 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser

Urmeaza sa cream baza de date ftp cu numele de utilizator proftp si parola PAROLA (Aici modificati dupa bunul plac) unde vor fi stocate numele de utilizatori si parolele:

mysql -u root -p
create database ftp;
GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO 'proftpd'@'localhost' IDENTIFIED BY 'PAROLA';
GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO 'proftpd'@'localhost.localdomain' IDENTIFIED BY 'PAROLA';
FLUSH PRIVILEGES;

Dupa crearea bazei de date, trecem la adaugarea tabelelor in care vor fi stocate informatiile:
USE ftp;

CREATE TABLE ftpgroup (
groupname varchar(16) NOT NULL default '',
gid smallint(6) NOT NULL default '5500',
members varchar(16) NOT NULL default '',
KEY groupname (groupname)
) TYPE=MyISAM COMMENT='ProFTP group table';

CREATE TABLE ftpquotalimits (
name varchar(30) default NULL,
quota_type enum('user','group','class','all') NOT NULL default 'user',
per_session enum('false','true') NOT NULL default 'false',
limit_type enum('soft','hard') NOT NULL default 'soft',
bytes_in_avail int(10) unsigned NOT NULL default '0',
bytes_out_avail int(10) unsigned NOT NULL default '0',
bytes_xfer_avail int(10) unsigned NOT NULL default '0',
files_in_avail int(10) unsigned NOT NULL default '0',
files_out_avail int(10) unsigned NOT NULL default '0',
files_xfer_avail int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;

CREATE TABLE ftpquotatallies (
name varchar(30) NOT NULL default '',
quota_type enum('user','group','class','all') NOT NULL default 'user',
bytes_in_used int(10) unsigned NOT NULL default '0',
bytes_out_used int(10) unsigned NOT NULL default '0',
bytes_xfer_used int(10) unsigned NOT NULL default '0',
files_in_used int(10) unsigned NOT NULL default '0',
files_out_used int(10) unsigned NOT NULL default '0',
files_xfer_used int(10) unsigned NOT NULL default '0'
) TYPE=MyISAM;

CREATE TABLE ftpuser (
id int(10) unsigned NOT NULL auto_increment,
userid varchar(32) NOT NULL default '',
passwd varchar(32) NOT NULL default '',
uid smallint(6) NOT NULL default '5500',
gid smallint(6) NOT NULL default '5500',
homedir varchar(255) NOT NULL default '',
shell varchar(16) NOT NULL default '/sbin/nologin',
count int(11) NOT NULL default '0',
accessed datetime NOT NULL default '0000-00-00 00:00:00',
modified datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id),
UNIQUE KEY userid (userid)
) TYPE=MyISAM COMMENT='ProFTP user table';

quit;
Dupa crearea bazei de date urmeaza sa configuram ProFTP sa foloseasca aceasta baza de date:

DefaultRoot ~

# The passwords in MySQL are encrypted using CRYPT
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users* groups*

# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo ftp@localhost proftpd PAROLA

# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo ftpuser userid passwd uid gid homedir shell

# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo ftpgroup groupname gid members

# set min UID and GID - otherwise these are 999 each
SQLMinID 500

# create a user's home directory on demand if it doesn't exist
SQLHomedirOnDemand on

# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser

# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on

SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"

SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"

SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies

SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies

QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

RootLogin off
RequireValidShell off

Nu uitati sa inlocuiti PAROLA cu adevarata parola.

Daca doriti sa se primeasca un banner de forma:
Folosesti 20MB din 100MB. Ai 80MB spatiu disponibil
adaugati la sfarsitul fisierului /etc/proftpd.conf
SQLNamedQuery gettally SELECT "ROUND((bytes_in_used/1048576),2) FROM ftpquotatallies WHERE name='%u'"
SQLNamedQuery getlimit SELECT "ROUND((bytes_in_avail/1048576),2) FROM ftpquotalimits WHERE name='%u'"
SQLNamedQuery getfree SELECT "ROUND(((ftpquotalimits.bytes_in_avail-ftpquotatallies.bytes_in_used)/1048576),2) FROM ftpquotalimits,ftpquotatallies WHERE ftpquotalimits.name = '%u' AND ftpquotatallies.name = '%u'"

SQLShowInfo LIST "226" "Folosesti %{gettally}MB din %{getlimit}MB. Ai %{getfree}MB spatiu disponibil."

VN:F [1.9.0_1079]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.0_1079]
Rating: 0 (from 0 votes)
560 Vizualizari. | Raporteaza Post/Eroare

Raporteaza Post/EroareClose

Tags: , ,

Leave a Reply

Copyright ©2012