Category Archives: Linux

Debian中proftpd+mysql+虚拟用户+匿名用户+磁盘限额的配置

 用惯了proftpd,本来打算用pureftpd的,后来想想算了。proftpd虚拟用户的配置其实很早就解决了,只是虚拟用户和本地用户同时登录,一直没有解决。于是趁这个机会仔细研究了下。依然是debian下面的配置。

参考站点:HowtoForge  上面有很多server的配置,各种平台下,从debian到redhat,以及suse,mandriva都有,非常详细。强烈推荐。

安装mysql和phpmyadmin,其中phpmyadmin不是必需的

apt-get install mysql-server mysql-client libmysqlclient15-dev phpmyadmin apache2

为mysql设置root密码

mysqladmin -u root password yourrootsqlpassword

如果需要其他人访问本机的mysql,同样需要设置密码

mysqladmin -h server1.example.com -u root password yourrootsqlpassword

安装带mysql支持的proftpd,注意选择proftpd工作在standalone模式

apt-get install proftpd-mysql

建立虚拟用户组,这个是为了把proftpd用户虚拟到本机的一个用户上。注意下面的2001修改为自定义的。

groupadd -g 2001 ftpgroup
useradd -u 2001 -s /bin/false -d /bin/null -c “proftpd user” -g ftpgroup ftpuser

Continue reading

debian上qlogic存储空间划分

 debian上挂载的存储,一共2快。大小分别为1T和2T。因为刚刚挂载,所以没有分区。下面是分区过程。同时发现debian下的图形化分区工具cfdisk,效果不错。只是似乎不能选择reserfs格式。但是对于其他应用非常不错

首先对2T空间sdd分区,首先还是建立分区

bt:/# fdisk /dev/sdd

The number of cylinders for this disk is set to 130541.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130541, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130541, default 130541):
Using default value 130541

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

分配文件格式,为了提高效率,设置的reiserfs格式

bt:/# mkfs.reiserfs /dev/sdd1
mkfs.reiserfs 3.6.19 (2003 www.namesys.com)

A pair of credits:
Edward Shushkin wrote the encryption and compression  file plugins,  and the V3
journal relocation code.

The  Defense  Advanced  Research  Projects Agency (DARPA, www.darpa.mil) is the
primary sponsor of Reiser4.  DARPA  does  not  endorse  this project; it merely
sponsors it.

Guessing about desired format.. Kernel 2.6.18-4-686 is running.
Format 3.6 with standard journal
Count of blocks on the device: 262142624
Number of blocks consumed by mkreiserfs formatting process: 16211
Blocksize: 4096
Hash function used to sort names: “r5”
Journal Size 8193 blocks (first block 18)
Journal Max transaction length 1024
inode generation number: 0
UUID: afd18a2b-f8fd-448a-ac64-7886b53706bd
ATTENTION: YOU SHOULD REBOOT AFTER FDISK!
        ALL DATA WILL BE LOST ON ‘/dev/sdd1’!
Continue (y/n):y
Initializing journal – 0%….20%….40%….60%….80%….100%
Syncing..ok

Tell your friends to use a kernel based on 2.4.18 or later, and especially not a
kernel based on 2.4.9, when you use reiserFS. Have fun.

ReiserFS is successfully created on /dev/sdd1.

然后挂载分区

bt:/# mount -t reserfs /dev/sdc1 /var/ftp/

 

开机自动挂载,修改/etc/fstab就可以了

Technorati 标记: , , , ,

hp-unix安装Emulex HBA卡

首先下载相应版本的驱动,我的是

http://www-dl.emulex.com/support/hpux/53109/lpfc.depot-05_31_09-hpux11iv2_64_dlkm.z

然后上传到服务器

重命名

mv lpfc.depot-05_31_09-HPUX11iv2_64_dlkm.z lpfc.depot 05_31_09-HPUX11iv2_64_dlkm.Z

解压缩

uncompress lpfc.depot-05_31_09-HPUX11iv2_64_dlkm.Z

安装
swinstall -s `pwd`/lpfc.depot-t-05_31_09-HPUX11iv2_64_dlkm

似乎hp unix的彷图形界面有些不稳定,同样环境的2台机器,1台一次成功,1台安装总是失败,重新启动2次后安装成功。。

安装后查看是否安装成功

# kcmodule -v lpfc

 

Technorati 标记: , , , ,

Debia下安装Qlogic 2460 HBA卡

新到的存储,准备在Debian下使用,但是Qlogic官方没有提供for debian的驱动,只有for redhat ,SLSE的。在debian下需要自己安装下。

首先插上HBA卡,启动系统。从启动信息中发现似乎已经找到了。

进入系统,执行lsmod,发现模块已经加载了。

qla2xxx               126560  0
firmware_class          9600  1 qla2xxx
scsi_transport_fc      28544  1 qla2xxx

但是无法正常驱动,查看系统日志: more /var/log/systemlog

发现如下信息

QLogic Fibre Channel HBA Driver
qla2xxx 0000:02:01.0: Found an ISP2100, irq 10, iobase 0xf8826000
qla2xxx 0000:02:01.0: Configuring PCI space…
qla2xxx 0000:02:01.0: Configure NVRAM parameters…
qla2xxx 0000:02:01.0: Verifying loaded RISC code…
qla2xxx 0000:02:01.0: Firmware image unavailable.
qla2xxx 0000:02:01.0: Firmware images can be retrieved from: ftp://ftp.qlogic.com/outgoing/linux/firmware/.
qla2xxx 0000:02:01.0: Failed to initialize adapter

提示firmware有问题,到提示的地址下载,ftp://ftp.qlogic.com/outgoing/linux/firmware/.

结果网络实在是太慢。。。下载不到。。于是google了一下debian的deb包,发现确实有。

于是执行

wget ftp://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-qlogic_*

dpkg -i firmware-qlogic_*

update-initramfs -k all -u

然后执行

#find / -name *logic

/usr/src/qlogic
/usr/share/doc/firmware-qlogic
/usr/share/initramfs-tools/hooks/firmware_qlogic

然后执行

./usr/share/initramfs-tools/hooks/firmware_qlogic

重新执行

update-initramfs -k all -u

重新启动系统,然后查看系统日志,已经正确加载

QLogic Fibre Channel HBA Driver
PCI: Enabling device 0000:0f:03.0 (0150 -> 0153)
ACPI: PCI Interrupt 0000:0f:03.0[A] -> GSI 160 (level, low) -> IRQ 74
qla2xxx 0000:0f:03.0: Found an ISP2312, irq 74, iobase 0xf88f8000
qla2xxx 0000:0f:03.0: Configuring PCI space…
qla2xxx 0000:0f:03.0: Configure NVRAM parameters…
qla2xxx 0000:0f:03.0: Verifying loaded RISC code…
qla2xxx 0000:0f:03.0: Allocated (412 KB) for firmware dump…
qla2xxx 0000:0f:03.0: LIP reset occured (f8f7).
qla2xxx 0000:0f:03.0: Waiting for LIP to complete…
qla2xxx 0000:0f:03.0: LIP occured (f8f7).
qla2xxx 0000:0f:03.0: LOOP UP detected (2 Gbps).
qla2xxx 0000:0f:03.0: LIP reset occured (f7f7).
qla2xxx 0000:0f:03.0: LIP occured (f7f7).
qla2xxx 0000:0f:03.0: Topology – (Loop), Host Loop address 0x0

参考文章

http://john.parnefjord.se/node/8

http://blog.sina.com.cn/u/544465b00100067v

bt的web版bt客户端torrentflux

今天查找l下的,结果偶然发现了这个东西。。
一个非常bt的 在多操作系统下的bt客户端。。
方式运行,用,可以用服务器来下载bt。。要做的仅仅是点几下链接。。。邪恶啊
主要特点:
  • Upload Torrents via URL or File Upload
  • Start, Stop, and Delete Torrents with a click
  • Advanced Torrent start options (ports, speeds, etc.)
  • Multi-user interface
  • RSS Feeds, download Torrents files with a click
  • View Download Progress of all torrents at a glance
  • View drive space at a glance
  • View Torrent file meta information
  • Built-in User management and Security
  • Private Messaging
  • Themes (selectable per user)
  • Upload History
  • Detailed User Administration
  • Admin Searchable Logs
  • Advanced Torrent Search (many major sites included)
  • Cookie support at the user level for private trackers
  • Queue Manager
  • Maketorrent — supports making torrents
  • Language Support
  • 注意,支持中文!!
    在debian下的安装异常简单,只需要:
    apt-get update
    apt-get install apache2 mysql-server mysql-client php4-mysql apache-common bittornado libapache2-mod-php4 libphp-adodb locales mysql-common php4-common pwgen
    apt-get install torrentflux
    就ok了。注意经过我测试,发现torrentflux,似乎只能用在Php4环境下,对php5环境,链接mysql会出问题。
    1.png
    2.png

    debian遗忘root密码的处理

    对于一些版本的OS(如redhat)来说,编辑,在后面加上“single”即可进入单用户模式。但是对于debian来说,这种方式是无效的,因为debian进入单用户模式也需要你输入root用户的密码。
     
    下面介绍一个在所有版本linux的grub上均可以使用的方法:
     
     
    1、在Grub的引导装载程序菜单上,选择你要进入的条目,键入 “e” 来进入编辑模式。
    2、在第二行(类似于kernel /vmlinuz-2.6.15 ro root=/dev/hda2 ),键入”e”进入编辑模式;
    3、在句末加上”init=/bin/bash”,回车;
    4、按“b”启动系统。
    这样我们即可获得一个bash的shell。
      
    进入shell后,根分区的挂载模式默认是只读,我们要将其改为可写,否则不能更改root密码:
      
    mount -no remount,rw /
    passwd root
    sync
    mount -no remount,ro /
    reboot
     
     
    这样即可成功更改t用户的