Ставим MySQL из порта
.
Ниже дано краткое описание действий.
test# cd /usr/ports/databases/mysql51-server/
test # make WITH_CHARSET=cp1251 WITH_XCHARSET=all WITH_PROC_SCOPE_PTH=yes
BUILD_OPTIMIZED=yes BUILD_STATIC=yes install clean
test# mysql -uroot -p
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Остается только создать базу и пользователя в MySQL, база создается так:
mysql> create database ftpusers;
Query OK, 1 row affected (0.00 sec)
Даем привилегии пользователю
ftpuser@localhost
с паролем pureftp.
mysql> grant all on ftpusers.* to ‘ftpuser’@’localhost’ identified by ‘pureftp’;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Переходим к установке PureFTP сервера из порта.
test# cd /usr/ports/ftp/pure-ftpd/
test#make
Выбираем следующие опции:
Видим :
Making all in contrib
Making all in man
Making all in pam
Making all in gui
Making all in configuration-file
Making all in m4
test# make install
Видим :
This port has installed the following startup scripts which may cause
these network services to be started at boot time.
/usr/local/etc/rc.d/pure-ftpd
Добавляем автозапуск сервиса при загрузке.
test# ee /etc/rc.conf
Пишем:
pureftpd_enable=»YES»
Теперь установим UserManager
:
cd /usr/ports/www/usermanager/
make install clean
Видим и внимательно читаем:
*****************************************************************
Please check /usr/local/www/data/UserManager/readme.txt
To use this manager, you will need to compile your
Pure-FTPd with -DWITH_MYSQL
*****************************************************************
‘User manager for PureFTPd’ is made by M.Mastenbroek 2002 — 2005
Version 2.1
Installation:
Run the installation wizard install.php in your web browser.
The installation wizard will lead you step by step
through the configuration of the User manager for PureFTPd.
Running:
The User manager for PureFTPd starts from the index.php file.
*****************************************************************
===> Registering installation for UserManager-2.1
===> SECURITY REPORT:
This port has installed the following world-writable files/directories.
/usr/local/www/data/UserManager/config.php
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type ‘make deinstall’
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
Apache 2.2 со всеми прибамбасами у нас стоит, поэтому создаем виртуальный хост.
test#ee /usr/local/etc/apache22/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /usr/local/www/data/UserManager/
ServerName usermanager.ru
ServerAlias www.usermanager.ru
<Directory /usr/local/www/data/UserManager/ >
Options FollowSymLinks
AllowOverride all
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
Далее в файле config.php прописываем данные для подключения к MySQL.
test# cd /usr/local/www/data/UserManager/
test# ee config.php
$DBHost = «127.0.0.1»; // Ip-address of MySQL server
// (Don~Rt change this if you are using the default database)
$DBLogin = «ftpuser»; // Username of MySQL user
$DBPassword = «pureftp»; // Passw of MySQL user
$DBDatabase = «ftpusers»; // Name of database
$FTPAddress = «myipaddress.com:21»; // Domain name or ip-address of your ftp server
$DEFUserID = «65534»; // nobody // Default user id of virtual ftp user.
$DEFGroupID = «31»; // guest // Default group is of virtual ftp user.
$UsersFile = «/etc/passw(d)»; // The unix user file
$GroupFile = «/etc/grou(p)»; // The unix group file
$StyleSheet = «style/default.css.php»; // The location of the style sheet
$EnableQuota = 0; // Enable virtual quota’s (0=Off 1=On)
$EnableRatio = 0; // Enable ratio (0=Off 1=On)
Запускаем инсталляцию через Веб
http://10.10.10.205/install.php
Проверка PHP перед настройкой Pure-ftp
Далее указываем Новую инсталяцию.
Выбираем root (Mysql) и его пароль для создания таблиц.
Добавляем пользователя , от имени которого будем обращаться к базе данных MySQL. (ftpuser)
Прописываем данные о сервере и сохраняем их в файле config.php кнопкой Save.
Если необходимо выбираем квоту а поддержку скорости закачки.
Назначаем пароль администратору pureftp.
Создаем файл pure-ftpd.conf копированием файла pure-ftpd.conf.sample
test# cd /usr/local/etc
test# cp pure-ftpd.conf.sample pure-ftpd.conf
Редактируем файл pure-ftpd.conf
test# ee ./pure-ftpd.conf
Ищем запись
# MySQLConfigFile /etc/pureftpd-mysql.conf
Раскоментируем и меняем на :
MySQLConfigFile /usr/local/etc/pureftpd-mysql.conf
Создаем файл pureftpd-mysql.conf копированием файла pureftpd-mysql.conf.sample
cp ./pureftpd-mysql.conf.sample ./pureftpd-mysql.conf
test# ee pureftpd-mysql.conf
Добавляем или изменяем выделенные красным цветом строки
Типа :
MYSQLServer 127.0.0.1 и пр. и сохраняемся.
Заходим под администратором через веб и видим:
А теперь осталось русифицировать.
Файл русификации можете взять
здесь.
Этот файл я нашел в Интернете, но где — не помню.
Русификацию я провел следующим образом: переименовал файл russian.php в english.php в каталоге
language и все заработало. Знаю, что неправильно, просто не было времени разбираться.
Вот что получилось.