FreeBSD6.2架設(shè)之Pure-FTPd服務(wù)器 Pure-FTPd Server On FreeBSD6.2 HowTo |
Mongolia |
Pure-FTPd Server On FreeBSD6.2 HowTo.pdf
193.23 KB, 下載次數(shù): 934
簡介 |
Pure-FTPd is a free (BSD), secure, production-quality and standard-conformant FTP server. It doesn't provide useless bells and whistles, but focuses on efficiency and ease of use. It provides simple answers to common needs, plus unique useful features for personal users as well as hosting providers. |
Step 1 Installation Apache22. | |
whereis apache22 apache22: /usr/ports/www/apache22 cd /usr/ports/www/apache22 make install clean |
Options for apache 2.2.6_2 | |||
|
To run apache www server from startup, add apache22_enable="YES" in your /etc/rc.conf. Extra options can be found in startup script. ===> Cleaning for autoconf-wrapper-20071109 ===> Cleaning for p5-gettext-1.05_1 ===> Cleaning for apache-2.2.6_2 rehash |
vi /etc/rc.conf |
#Apache22 apache22_enable="YES" |
/usr/local/etc/rc.d/apache22 start Syntax OK Starting apache22. |
It works! |
Step 2 Installation MySQL Server. |
whereis mysql50-server mysql50-server: /usr/ports/databases/mysql50-server cd /usr/ports/databases/mysql50-server/ make install clean |
http://www.mysql.com/ ===> Cleaning for mysql-client-5.0.45_1 ===> Cleaning for mysql-server-5.0.45_1 rehash |
vi /etc/rc.conf |
#MySQL5.0 mysql_enable="YES" |
netstat -an | grep "3306" tcp4 0 0 *.3306 *.* LISTEN ps -aux|grep mysql|grep -v grep mysql 97589 0.0 0.3 1728 1376 p0 I 3:03PM 0:00.09 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/va mysql 97609 0.0 4.9 53844 25576 p0 S 3:03PM0:01.07 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysq |
mysqladmin -u root password '123456' ('123456')是你要設(shè)定的密碼 |
mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.0.45 FreeBSD port: mysql-server-5.0.45_1 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.01 sec) mysql> quit Bye |
Step 3 Installation PHP5. |
whereis php5 php5: /usr/ports/lang/php5 cd /usr/ports/lang/php5/ make install clean |
Options for php5 5.2.5 | ||||||
|
*************************************************************** Make sure index.php is part of your DirectoryIndex. You should add the following to your Apache configuration file: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps *************************************************************** ===> Cleaning for pkg-config-0.22_1 ===> Cleaning for libxml2-2.6.30 ===> Cleaning for php5-5.2.5 rehash |
cd /usr/local/etc/apache22/ cp httpd.conf httpd.conf.bak |
vi /usr/local/etc/apache22/httpd.conf |
index.php AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps |
# probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz |
# probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps |
DirectoryIndex index.php index.html index.htm |
# <IfModule dir_module> DirectoryIndex index.html </IfModule> # |
# <IfModule dir_module> DirectoryIndex index.php index.html index.htm </IfModule> # |
whereis php5-extensions php5-extensions: /usr/ports/lang/php5-extensions cd /usr/ports/lang/php5-extensions/ make install clean |
Options for php5-extensions 1.0 | ||||||||||||
|
===> Cleaning for php5-posix-5.2.5 ===> Cleaning for php5-session-5.2.5 ===> Cleaning for php5-extensions-1.1 rehash |
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini |
/usr/local/etc/rc.d/apache22 restart |
vi /usr/local/www/apache22/data/test.php |
<? phpinfo(); ?> |
Step 4 Installation Pure-FTPd. | |
whereis pure-ftpd pure-ftpd: /usr/ports/ftp/pure-ftpd cd /usr/ports/ftp/pure-ftpd/ make with_language=simplified-chinese install |
Options for pure-ftpd 1.0.21_1 | ||||||||||||||||||
|
===> Compressing manual pages for pure-ftpd-1.0.21_1 ===> Registering installation for pure-ftpd-1.0.21_1 rehash |
vi /etc/rc.conf |
#Pure-FTPd pureftpd_enable="YES" |
Step 5 Creating a MySQL Database. | |
cd /root/ fetch "http://machiel.generaal.net/files/pureftpd/v2.x/script.mysql" |
mysql -u root -p < /root/script.mysql Enter password:此處輸入你的MySQL密碼 |
Step 6 Configuration of PureFTPd. |
cd /usr/local/etc/ cp /usr/local/etc/pure-ftpd.conf.sample /usr/local/etc/pure-ftpd.conf |
vi /usr/local/etc/pure-ftpd.conf |
MySQLConfigFile /usr/local/etc/pureftpd-mysql.conf CreateHomeDir yes |
# MySQL configuration file (see README.MySQL) # MySQLConfigFile /etc/pureftpd-mysql.conf # Automatically create home directories if they are missing #CreateHomeDir yes |
# MySQL configuration file (see README.MySQL) MySQLConfigFile /usr/local/etc/pureftpd-mysql.conf # Automatically create home directories if they are missing CreateHomeDir yes |
cd /usr/local/etc/ fetch http://machiel.generaal.net/files/pureftpd/v2.x/pureftpd-mysql.conf |
/usr/local/etc/rc.d/pure-ftpd start |
Step 7 User manager for PureFTPd. |
whereis usermanager usermanager: /usr/ports/www/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 For more info look at http://machiel.generaal.net 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. ***************************************************************** rehash |
cp /usr/local/etc/apache22/httpd.conf /usr/local/etc/apache22/httpd.conf.bak vi /usr/local/etc/apache22/httpd.conf |
Alias /ftp "/usr/local/www/data/UserManager/" <Directory "/usr/local/www/data/UserManager"> AllowOverride None Options None Order allow,deny Allow from all </Directory> |
Configuration 'User manager for PureFTPd' | Step [1 - 7] | |
This configuration script has carried out a few checks to see if everything is ready to start the configuration. | ||
Checking if config.php exists | OK! | |
Checking if config.php is writable | OK! | |
Checking if PHP Extension MYSQL is enabled | OK! | |
Checking if PHP Extension PCRE is enabled | OK! | |
Checking if PHP Extension POSIX is enabled | OK! | |
Checking if PHP Extension SESSION is enabled | OK! | |
PureFTPd 帳號(hào)管理 | 按此以新增帳號(hào) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Step 8 寫在最后. | |
mkdir -p /home/ftp/demo chown nobody:guest demo |
vi /usr/local/www/apache22/cgi-bin/ftpstatus.c |
#include <stdlib.h> int main(int argc, char *argv[]) { system("/usr/local/sbin/pure-ftpwho -H -w"); return 0; } |
cc -Wall -o ftpstatus ftpstatus.c chmod 755 ftpstatus chmod ug+s ftpstatus |
Pure-FTPd server status | |||||||
PID | Account | Time | State | File name | Remote host | Kbytes | Local host |
11692 | sunny | 00:01 | UL | file.iso | 192.168.0.8 | 5248 (79 KB/s) | 192.168.0.88:21 |
Step 9 F.A.Q. | |
Links to other sources | |
原帖由 小丑人間 于 2007-11-30 19:00 發(fā)表
我按你上面裝的。都裝好了。賬號(hào)管理后臺(tái)可以訪問了。
PureFTPd 也啟動(dòng)了。
現(xiàn)在就是賬號(hào)不知道怎么用。搞什么登陸。
Step 8 寫在最后.
User manager for PureFTPd后臺(tái)管理程序,創(chuàng)建用戶時(shí)需要手動(dòng) ...
=> port manually into /usr/ports/distfiles/gnome2 and try again.
*** Error code 1
Stop in /usr/ports/devel/pkg-config.
*** Error code 1
Stop in /usr/ports/devel/pkg-config.
*** Error code 1
Stop in /usr/ports/lang/php5.
*** Error code 1
Stop in /usr/ports/lang/php5.
# uname -a
FreeBSD www.FreeBSD7.org 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
# make showconfig
===> The following configuration options are available for php5-5.2.6:
CLI=off "Build CLI version"
CGI=off "Build CGI version"
APACHE=on "Build Apache module"
DEBUG=off "Enable debug"
SUHOSIN=off "Enable Suhosin protection system (not for jails)"
MULTIBYTE=on "Enable zend multibyte support"
IPV6=off "Enable ipv6 support"
MAILHEAD=off "Enable mail header patch"
REDIRECT=off "Enable force-cgi-redirect support (CGI only)"
DISCARD=off "Enable discard-path support (CGI only)"
FASTCGI=off "Enable fastcgi support (CGI only)"
PATHINFO=off "Enable path-info-check support (CGI only)"
===> Use 'make config' to modify these settings
歡迎光臨 Chinaunix (http://www.72891.cn/) | Powered by Discuz! X3.2 |