Press "Enter" to skip to content

日期: 2011 年 7 月 12 日

FreeBSD8.2中用axel提高ports的安装速度

提升ports下载速度实现多线程。

首先到
cd /usr/ports/ftp/axel 之后 make install clean

安装完成后把/etc/make.conf文件编辑如下:

FETCH_CMD=axel
FETCH_BEFORE_ARGS= -n 10 -a
FETCH_AFTER_ARGS=
DISABLE_SIZE=yes

其次添加下载源地址,不用去国外下载

MASTER_SITE_FREEBSD_ORG= ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/%SUBDIR%/
MASTER_SITE_GNOME=  http://mirrors.geekbone.org/gnome/%SUBDIR%/
MASTER_SITE_LOCAL=  ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/%SUBDIR%/
MASTER_SITE_OVERRIDE=ftp://ftp.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
Leave a Comment

FreeBSD8.2下vsftp安装配置

由于涉及FTP到解决方案,特别在FreeBSD8.2下采用ports部署vsftp,配置如下:

先创建用户:leaf 密码:123456  采用adduser命令添加此用户,关于添加用户另一章中已经有介绍。

kiccleaf# cd /usr/ports/ftp/vsftpd
kiccleaf# make install clean

可以不用选择
Options for vsftpd 2.3.4 x

===> Compressing manual pages for vsftpd-2.3.4
===> Registering installation for vsftpd-2.3.4
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/vsftpd

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:
http://vsftpd.beasts.org/
kiccleaf#

防止修改错误先备份vsftpd.conf文件

kiccleaf# mv /usr/local/etc/vsftpd.conf /usr/local/etc/vsftpd.conf.bak
kiccleaf# ee/usr/local/etc/vsftpd.conf

在新建文件vsftpd.conf输入以下代码内容:

anonymous_enable=NO
write_enable=YES
local_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
data_connection_timeout=3
nopriv_user=nobody
listen=YES
secure_chroot_dir=/usr/local/share/vsftpd/empty
chroot_local_user=YES
tcp_wrappers=Yes
userlist_enable=Yes
userlist_deny=No
pasv_enable=Yes
pasv_min_port=65000
pasv_max_port=65100
userlist_file=/usr/local/etc/vsftpd.user_list

创建一个文件,添加可登陆的FTP用户

kiccleaf# echo leaf >> /usr/local/etc/vsftpd.user_list
kiccleaf# cd /usr/local/etc/
kiccleaf# ll
total 32
-rw-r--r--  1 root  wheel  3770 Jul 12 17:39 axelrc
drwxr-xr-x  2 root  wheel   512 Jul 12 17:12 devd
drwxr-xr-x  2 root  wheel   512 Jul 12 17:12 man.d
drwxr-xr-x  2 root  wheel   512 Jul 12 17:12 pam.d
drwxr-xr-x  2 root  wheel   512 Jul 12 18:39 rc.d
-r--r--r--  1 root  wheel  5010 Jul 12 21:22 vsftpd.conf
-r--r--r--  1 root  wheel  4586 Jul 12 21:20 vsftpd.conf.dist
-rw-r--r--  1 root  wheel     1 Jul 12 21:23 vsftpd.user_list
-r--r--r--  1 root  wheel  4499 Jul 12 17:37 wgetrc.sample
kiccleaf# cat /usr/local/etc/vsftpd.user_list
leaf  #刚执行添加的用户leaf
kiccleaf# /usr/local/libexec/vsftpd &
[1] 1952

添加到随系统启动项中

kiccleaf# echo vsftp_ebable=YES >>/etc/rc.conf

回去Win下采用FlashFxp进行链接测试


链接成功后

Leave a Comment

FreeBSD直接可以用命令升级,比如将FreeBSD8.1升级成FreeBSD8.2[原创]

升级FreeBSD系统FreeBSD8.1升级成FreeBSD8.2的操作过程

kiccleaf# uname -a
FreeBSD qm.w 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
kiccleaf# freebsd-update -r 8.2-RELEASE upgrade
Looking up update.FreeBSD.org mirrors... 4 mirrors found.
Fetching metadata signature for 8.1-RELEASE from update5.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base

The following components of FreeBSD do not seem to be installed:
src/base src/bin src/cddl src/contrib src/crypto src/etc src/games
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
world/catpages world/dict world/doc world/games world/info
world/manpages world/proflibs

Does this look reasonable (y/n)? y

Fetching metadata signature for 8.2-RELEASE from update5.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 8.1-RELEASE for merging... done.
Preparing to download files... done.
Fetching 5591
60....5570....5580....5590 done.
Applying patches... done.
Fetching 47 files... done.
Attempting to automatically merge changes in files... done.
kiccleaf# freebsd-update install
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

记住以下这两步不可少,否则远程登陆不了就要跑机房咯
第一步:先更新一下ssh

kiccleaf# vi /etc/ssh/sshd_config

Port 22
PermitRootLogin no
PubkeyAuthentication yes
AuthorizedKeysFile    .ssh/id_dsa.pub
PasswordAuthentication no
PermitEmptyPasswords no

第二步:把配置ssh随系统启动

kiccleaf# cat /etc/rc.conf

sshd_enable="YES"

kiccleaf# shutdown -r now
kiccleaf# uname -a
FreeBSD qm.w 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
Leave a Comment

修改phpMyAdmin使其能够管理多台远程MySQL服务器[原创]

因为最近采用多数据维护和操作,每个数据库安装一个phpmyadmin不太现实也太繁琐。所以就对phpmyadmin进行修改实现了多mysql数据库管理的方法

经过测试版本:phpMyAdmin 3.3.5-rc1、phpMyAdmin3.4.3.1

修改方法:

第一步:打开/phpmyadmin/libraries 目录

第二步:修改config.default.php 文件(linux下可用vim编辑,FreeBSD下可用vi或是ee编辑)找到“AllowArbitraryServer
代码内容

$cfg['AllowArbitraryServer'] = false;
修改成:
$cfg['AllowArbitraryServer'] = true;

第三步:保存后去浏览器输入地址http://youdomain.com/phpmyadmin/
查看结果:

phpmyadmin登陆界面
phpmyadmin登陆界面
Leave a Comment