坚信 Linux 必将占领业界的每个角落!围场县先任学校微机室

ubuntu linux 通过 SAMBA 共享 CUPS 的HP_LASER_1020打印机

一、samba cupsys

shell>sudo apt-get install samba cupsys

如果缺少什么包,你可以到下面的这个网址里面查询包的名称
http://packages.ubuntu.com/

二、安装HP 1020 linux 打印机驱动
其实在ubuntu的packages里,HP的打印机驱动包(hplip)也可以找到,但我使用的是hplip.sourceforge.net中的驱动,安装过程见以下地址
http://hplip.sourceforge.net/install/manual/distros/ubuntu.html
然后通过hp-setup来添加打印机

shell>sudo hp-setup

三、配置cupsys

shell>sudo vim /etc/cups/cupsd.conf
Listen 631
# Restrict access to the server...

Order allow,deny
Allow all

# Restrict access to the admin pages...

Linux RIS

参考资料
http://oss.netfarm.it/guides/
http://oss.netfarm.it/guides/ris-linux.pdf
http://www.wenzk.net/bbs/viewthread.php?tid=834
http://coolerfeng.blog.51cto.com/133059/55945
重点参考资料
http://oss.netfarm.it/guides/ris-linux.pdf
在实验的过程中,可以使用wireshark进程监听,或者查看各进程的日志,用来分析文件请求及出错位置。

配置服务器
TFTP 服务器 (tftpd_hpa)
ftp://ftp.kernel.org/pub/software/network/tftp/
man in.tftpd 中的文件名映射

FILENAME REMAPPING
The -m option specifies a file which contains filename remapping rules.
Each non-comment line (comments begin with hash marks, #) contains an

使用apt-mirror建立局域网内的ubuntu源镜像

首先声明的我的服务器系统是基于ubuntu hardy的,因此,如果你的系统不一样,请自行修改,若不是ubuntu系列,请掠过。
安装apt-mirror

shell>sudo apt-get install apt-mirror

配置apt-mirror
shell>sudo vim /etc/apt/mirror.list
set base_path /mirror
set nthreads 20
set _tilde 0
deb http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu

这里,我们只镜像最基本的部分,至于更新和安全,到网上更新的话会更好,源代码则太大,舍之。base_path下一定要有skel等目录,具体参见你的配置文件。
获得源镜像
shell>sudo apt-mirror

清理
shell>/bin/bash /mirror/var/clean.sh

VIM使用技巧

windows 下 gvim 使用utf8 中文乱码
X:\Program Files\_vimrc

set encoding=utf8
set fileencodings=utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
set tabstop=2
set shiftwidth=2

将module识别成php,从而进行语法加亮
mkdir ~/.vim
vim ~/.vim/filetype.vim
augroup filetypedetect
au BufRead,BufNewfile *.module setfiletype php
augroup END

如果你不想使用上面的方法,也可以在打开文件后使用命令设置
:set filetype=php

自动格式化
:gg=G

Vsftpd虚拟用户配置的实现

Vsftpd是在UNIX/Linux中非常安全且快速的FTP服务器,vsftpd的官方网站:http://vsftpd.beasts.org/上说:Probably the most secure and fastest FTP server for UNIX-like systems。相对于本地(local_user)用户而言,虚拟用户只是相对于FTP服务器而言才有的用户,虚拟用户只能访问FTP服务器所提供的资源,这大大增强系统本身的安全性。相对于匿名用户而言,虚拟用户需要用户名和密码才能获取FTP服务器中的文件,增加了对用户和下载的可管理性。对于考虑到主机安全和管理方便的FTP站点来说,虚拟用户是一种极好的解决方案。对于局域网来说,开放匿名用户也不会对安全影响过大,所以我们提供一种匿名用户和虚拟用户两种并存的解决方案。

本文档基于SuSE Linux 10.1和vsftpd-2.0.4测试成功,如果平台不同或者版本有异,可能稍有出入。本文参考了vsftpd官方的文档(英文)以及 www.chinaunix.net上的文章,感谢这些人的付出,因本人英文水平太低,所以如果有译文不当之处敬请指正,我的 EMAIL:zhangyingda@163.com,也可到网站论坛上讨论:http://freeedu.kmip.net。

一、安装
下载软件包,解压后,

FREEBSD 使用记录

从我这样一个懒人的角度看来,FREEBSD比UBUNTU好的地方在于不用输入那个sudo,方便多了。FREEBSD的ports系统也是个方便的东西,比起LFS的手工下载安装要方便多了。然而,有很多地方FREEBSD不如UBUNTU方便,让我们更改它,以适应linuxer的习惯。
更改shell,因为我们经常使用的是bash,所以更改为bash

# cd /usr/ports/shell/bash
# make install clean
# chsh -s /usr/local/bin/bash

设置 ls 颜色
# vim /etc/profile
alias ls="ls -G"
alias dir="ls"
# source /etc/profile

vim 配置解决编辑键不正常的问题
#cd /usr/local/share/vim/vim71
#cp vimrc_example.vim ../vimrc

Ports系统的更新

# cd /usr/ports/net/cvsup
# make install clean

服务器由 lighttpd 换成 apache

由于lighttpd对于重写模块的支持不好,所以还是换回了apache。然而lighttpd的强大高效快速,让我印象深刻。本想要把编译的PHP用于lighttpd的,重新编译了PHP,为它加上了fastcgi,然而,我发现这个东西远比我想像的困难。目前还是先用apache吧。
APACHE 配置参数,可以查看目录下的config.log或者config.nice

shell> ./configure --enable-modules=all --enable-mods-shared=all --enable-so --enable-example --enable-charset-lite --enable-ssl --with-ssl=/usr/local/ssl --enable-cgi --enable-cgid --enable-speling --enable-rewrite --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-balancer --enable-deflate

PHP 配置参数,可以由phpinfo()函数输出

Syndicate content