2008年7月27日星期日

Ubuntu 使用纪录( 更新 ubuntu 源 wget 代理 安装配置Vsftpd 安装 Domino 8.01)

代理http请求 (for win)
方法1:
set "http_proxy=http://[user]:[pass]@host:port/"
wget -Y on "http://baidu.com"

方法2:
wget -e "http_proxy=http://[user]:[pass]@host:port/" "http://baidu.com"

代理ftp请求和代理http请求的差不多,只需把上面两方法中的"http"换为"ftp"就可以了
网上看了很多VSFTPD配置虚拟用户的文章,照配置都不成功,好像不太适合UBUNTU,要不就是少
了点命令,今天做实验成功,分享给大家,与君共勉。
本人假设你知道SUDO(有点搞笑哈),还假设你知道#号后边的都是说明(更搞笑了)_
还有本人使用Ubuntu7.10 ubuntu.cn99.com/源
首先安装VSFTPD
代码:
apt-get install vsftpd #此版本好像有编码问题,在windwos下看FTP中中文为乱码(望高手解答)


实验目的:利用虚拟用户可实现不同用户拥有不同权限的要求

第一步:建立本地虚拟用户(Create the local virtual user)
代码:
useradd -d /opt/ftp-server virtual #新建virtual用户,指定主目录为/opt/ftp-server
mkdir /opt/ftp-server virtual


第二步:建立虚拟用户数据库(Create the virtual users database)
用户手工建立文本文件logins.txt (保存到/tmp中)
logins.txt文件内容
代码:

download
123
upload
234
admin
345

注:奇数行为用户名,偶数行为密码.

转换TXT文件为DB文件(DB应该是数据库文件吧*_*,反正我不知道)
代码:
apt-get install libdb3-util #没安装这个软件包,db3_load命令就不能使用。
db3_load -T -t hash -f /tmp/logins.txt /etc/vsftpd_login.db
chmod 600 /etc/vsftpd_login.db


第三步:建立基于vsftpd_login的PAM授权文件(Create a PAM file which uses your new database)[此处也可用mysql建立用户信息]
代码:
cp /etc/pam.d/vsftpd /etc/pam.d/ftp.vu #建立认证文件


#编辑文件将所有内容删除,将下面两句添加其中,保存。
代码:
gedit /etc/pam.d/ftp.vu


auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login[/code]

第四步: 修改vsftpd.conf文件内容如下:(Create your vsftpd.conf config file)
代码:

anonymous_enable=NO
local_enable=YES
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES #启用虚拟用户
guest_username=virtual #将虚拟用户转换成本地用户virtual
user_config_dir=/etc/vsftpd/ #虚拟用户的配置文件存放目录
listen=YES
secure_chroot_dir=/tmp #此句必要,很多网上教程没有加这句。
pam_service_name=ftp.vu #此句为指定认证文件
user_config_dir=/etc/vsftpd/ #指定虚拟用户配置文件存放的目录
listen=YES


第五步: 建立针对虚拟用户库中不同用户的权限文件(第四步中已指定存放位置)
(在主目录virtual主目录下创建三个文件夹:download,upload,admin)
代码:
mkdir /opt/ftp-server/download
mkdir /opt/ftp-server/upload
mkdir /opt/ftp-server/admin
#方法一、将这三个文件夹权限改为所有人完全控制
chmod 777 –R /opt/ftp-server
#方法二、还可以用chown virtual.virtual -R /opt/ftp-server命令改变属主
#然后使chmod 755 –R /opt/ftp-server这种方法更为安全。


代码:
gedit /etc/vsftpd/download #加下以下内容,保存。
download文件内容如下(只能下载权限)
=====================
local_root=/opt/ftp-server/download
anon_world_readable_only=NO


代码:
gedit /etc/vsftpd/upload #加下以下内容,保存。
upload文件内容如下(可上传权限)
=====================
local_root=/opt/ftp-server/upload
anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES


代码:
gedit /etc/vsftpd/admin #加下以下内容,保存。
admin文件内容如下(管理权限)
=====================
local_root=/opt/ftp-server/admin
anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anno_other_writer_enable=YES


第六步: 重新启动VSFTP
#检测一下配置文件有没有错误 ,如果有会提示你错误的option是多少。
/usr/sbin/vsftpd
#如果提示500 OOPS: vsftpd: must be started as root (see run_as_launching_user option)
#表示基本上成功了,再输入以下命令。
/etc/init.d/vsftpd restart

第七步: 测试(Test)

用vsftp建立个人ftp站点

首先是最基本的配置,请看我的/etc/vsftpd/vsftpd.conf

###############################################################################
#接受匿名用户
anonymous_enable=YES
#匿名用户login时不询问口令
no_anon_password=YES
#接受本地用户
local_enable=YES

#可以上传(全局控制).若想要匿名用户也可上传则需要设置anon_upload_enable=YES,若想要匿名用户可以建立目录则需要设置anon_mkdir_write_enable=YES.这里禁止匿名用户上传,所以不设置这两项.
write_enable=YES
#本地用户上传文件的umask
local_umask=022

#使用上传/下载日志,日志文件默认为/var/log/vsftpd.log,可以通过xferlog_file选项修改
xferlog_enable=YES
#日志使用标准xferlog格式
xferlog_std_format=YES

#login时的欢迎信息
ftpd_banner=Welcome to KingArthur's FTP service.
#设置的话将覆盖上面的ftpd_banner设置,用户login时将显示/etc/vsftpd/banner中的内容
banner_file=/etc/vsftpd/banner
#为YES则进入目录时显示此目录下由message_file选项指定的文本文件(,默认为.message)的内容
dirmessage_enable=YES
#本地用户login后所在目录,若没有设置此项,则本地用户login后将在他的home目录(/etc/passwd的第六个字段)中.匿名用户的对应选项是anon_root
local_root=/var/ftp

#设置为YES则下面的控制有效
chroot_list_enable=YES
#若为NO,则记录在chroot_list_file选项所指定的文件(默认是/etc/vsftpd.chroot_list)中的用户将被chroot在登录后所在目录中,无法离开.如果为YES,则所记录的用户将不被chroot.这里选择YES.
chroot_local_user=YES

#若设置为YES则记录在userlist_file选项指定文件(默认是/etc/vsftpd.user_list)中的用户将无法login,并且将检察下面的userlist_deny选项
userlist_enable=YES
#若为NO,则仅接受记录在userlist_file选项指定文件(默认是/etc/vsftpd.user_list)中的用户的login请求.若为YES则不接受这些用户的请求.
userlist_deny=NO
#注意!!!vsftpd还要检察/etc/vsftpd.ftpusers文件,记录在这个文件中的用户将无法login!!

#服务器以standalong模式运行,这样可以进行下面的控制
listen=YES
#匿名用户的传输比率(b/s)
anon_max_rate=51200
#本地用户的传输比率(b/s)
local_max_rate=512000
#可接受的最大client数目
max_clients=100
#每个ip的最大client数目
max_per_ip=5

connect_from_port_20=YES
tcp_wrappers=YES
pam_service_name=vsftpd

##############################################################################

下面是我的/etc/vsftpd.user_list
##############################################################################

ftpuser
anonymous

##############################################################################
/etc/vsftpd.ftpusers可以使用系统自带的文件
/etc/vsftpd.chroot_list内容为空
接着建立系统用户ftpuser,将他加入ftp组并将/etc/passwd中他的记录的最后一个字段改成/sbin/nologin(禁止本地登录).
设置/var/ftp的所有者和所有组为root,权限为755
设置/var/ftp/pub的所有者为root,所有组为ftp,权限为775

至 此vsftpd的基本配置就完成了.这里我们接受匿名用户anonymous和本地用户ftpuser的请求.anonymous只能下载, ftpuser可以下载和上传.他们登录后均在/var/ftp目录下且无法离开这个目录(被chroot了).ftpuser可以在 /var/ftp/pub目录中建立目录和上传文件,上传文件的权限为755(设置了local_umask=022).匿名用户的传输比率为 50kb/s,ftpuser的传输比率为500kb/s.可联接的最多客户数为100,每ip可联接的最多客户数为5.
如果需要使本地用户ftpput可以login,只需要将他加入/etc/vsftpd.user_list,要使他可以上传,只需将他加入ftp组.
接 着我们可以在/var/ftp下的各个目录(包括/var/ftp)下建立.message文件,这样用户进入这个目录时vsftpd将显示. message的内容,你可以在这里面写上欢迎信息或者注意事项等等.另外可以编辑/etc/vsftpd/banner,建立login时的欢迎信息, 让你的ftp更加个性化.

下面我们使用quota为ftpuser加入磁盘限额,避免恶意用户用垃圾数据塞满你的硬盘.
假设/var/ftp在根分区/(/dev/hda5)中,则将/etc/fstab中根分区的记录的第4个字段改成defaults,usrquota,这样这条记录看起来类似这样:
LABEL=/ / ext3 defaults,usrquota 1 1
接着重启系统后输入下列命令:
quotacheck -acu #检查启用了配额的文件系统,并为每个文件系统建立一个当前磁盘用来的表
quotacheck -avu #生成每个启用了配额的文件系统的当前磁盘用量表
edquota ftpuser #为用户ftpuser设置磁盘配额
这时系统会在默认文本编辑器(vi)中打开配额文件,显示类似这样:
Disk quotas for user ftpuser (uid 501):
Filesystem blocks soft hard inodes soft hard
/dev/hda5 0 0 0 0 0 0
第 一列是启用了配额的文件系统的名称。第二列显示了用户当前使用的块数。随后的两列用来设置用户在该文件系统上的软硬块限度。inodes 列显示了用户当前使用的i节点数量。最后两列用来设置用户在该文件系统上的软硬i节点限度.硬限是用户或组群可以使用的磁盘空间的绝对最大值。达到了该限 度后,磁盘空间就不能再被用户或组群使用了。软限定义可被使用的最大磁盘空间量。和硬限不同的是,软限可以在一段时期内被超过。这段时期被称为过渡期 (grace period)。过渡期可以用秒钟、分钟、小时、天数、周数、或月数表示。如果以上值中的任何一个被设置为 0,那个限度就不会被设置.按你的需要修改后存盘推出.
要校验用户的配额是否被设置,使用以下命令:
quota testuser
接着使用edquota -t来设置过渡期(grace period)
和另一个 edquota 命令相似,这个命令也会在文本编辑器中打开当前的文件系统配额:
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
Filesystem Block grace period Inode grace period
/dev/hda5 7days 7days
按你的需要修改后存盘退出
自己测试吧。
http://wiki.ubuntu.org.cn/index.php?title=%E5%BF%AB%E9%80%9F%E8%AE%BE%E7%BD%AE%E6%8C%87%E5%8D%97/GutsyGibbon&variant=zh-cn
修改源并更新你的(k/x/ed)ubuntu

* 不同的网络状况连接以下源的速度不同。建议在添加前手动验证以下源的连接速度(ping下就行)。比如说北京网通用户连接cn99就非常慢,而 ftp.sjtu.edu.cn是相对较快的源。选择最快的源可大大节省下载时间,请根据自己网络环境设置更新服务器,以达到最快的速度。
* 注意,你可以同时加入几个源。尽量选择一组官方的源(也就是下面的Archive.ubuntu.com的条目)直接加在文件的最后,以避免非官方源软件 包不全时出现 404 Not Found 文件未发现的错误。建议电信用户使用cn99和台湾大学的源,网通用户使用欧洲官方源或台湾大学的源,教育网用户使用教育网的源。


打开终端方法:

按下ALT+F2 -> gnome-terminal -> 运行 #(ed)ubuntu
按下ALT+F2 -> konsole -> 运行 #Kubuntu
按下ALT+F2 -> xfce4-terminal -> 运行 #xubuntu

在终端执行命令

备份当前的源列表,以便日后需要时恢复:

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

编辑源列表

Ubuntu 和 Edubuntu 中执行:
gksu gedit /etc/apt/sources.list

Kubuntu 中执行:
kdesu kate /etc/apt/sources.list

Xubuntu 中执行:
gksu mousepad /etc/apt/sources.list

适用于所有版本:
sudo vim /etc/apt/sources.list


从以下各服务器列表内容中选择一段替换文件中的所有内容,一般来说加入一至两组即可,加多了影响更新速度。为防止非官方源中软件包不全的问题,请在sources.list文件中尾部添加一组官方源。


Archive.ubuntu.com更新服务器(欧洲,此为官方源,电信网通用户使用):

deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

这个问题可以这样解决:

1. 去 http://sourceforge.net/project/showfiles.php?group_id=34153&release_id=105355 下载 the fonts final 里面的 andale32.exe arialb32.exe courie32.exe impact32.exe trebuc32.exe webdin32.exe arial32.exe comic32.exe georgi32.exe times32.exe verdan32.exe

2.将 /tmp/ 里面的 msttcorefonts.* 这些目录 rm -r 一下。现在开始 apt-get install msttcorefonts 。

3.在出现如下字符提示的时候:

You are free to download these fonts and use them for your own use,
but you may not redistribute them in modified form, including changes
to the file name or packaging format.
--22:44:46-- http://belnet.dl.sourceforge.net/sou...ts/andale32.ex e
=> `./andale32.exe'

迅速将刚才下载的12个 exe 文件 cp 到 /tmp/msttcorefonts.* 目录里面。注意这个 msttcorefonts.* 就是刚刚 apt 时生成的。

这样安装便可顺利完成。
开始安装:

在终端中:

1、进入 jre-6u1-linux-i586.bin 所在的目录:

cd /usr

2、设置jre-6u1-linux-i586.bin执行权限:

sudo chmod +x jre-6u1-linux-i586.bin

3、运行 jre-6u1-linux-i586.bin :

sudo ./jre-6u1-linux-i586.bin

出来几屏幕的英文,过,在提示时输入 yes 回车确认,一会儿 Done,出现提示符后,说明安装成功。

4、进入FireFox插件目录:

cd /usr/lib/firefox/plugins

执行下面的命令做一插件链接:

sudo ln -s /usr/jre1.6.0_01/plugin/i386/ns7/libjavaplugin_oji.so

5、打开FireFox浏览器,菜单-编辑-首选项-内容,勾选 启用java,关闭浏览器,重新启动浏览器,进入www.java.com,测试,如出现如下内容说明成功:

Howto: Install Domino 8.0.1 on Ubuntu
Howto: Install Domino 8.0.1 on Ubuntu
________________________________________
[UPDATE]
20.04.2008 - I've just tested this Configuration on a Ubuntu 8.04 Server. These Steps apply for 8.04 aswell.
[/Update]


Ok, i have been banging my Head against the wall for the past two weeks, but eventually i got it to work. And my mistake was so simple... now that i think of it

So others do not get hung up on mistakes i did, i will briefly explain how i got the domino 8.0.1 server (Package C18XSEN) working on an ubuntu 7.10 Server.

Get the System ready
Install the Ubuntu Server in minimal mode (no extra packages) until you have booted into the system the first time.
The only package you have to install to get the server working is gawk. Do this via
Quote:
sudo apt-get install gawk
Next is that you need to create a user the Domino server should run under. I used the default one (notes). create the user via
Quote:
sudo useradd -m notes
then check if the user really exists with
Quote:
id notes
this should give you something like
Quote:
# id notes
uid=1001(notes) gid=1001(notes) groups=1001(notes)
The next step is to copy the file (C18XSEN.tar) with the Domino server in it over to the server and unpack it
Quote:
tar -xf C18XSEN.tar
Installation of Domino
start the installation from the linux/domino subfolder with the install script
Quote:
cd linux/domino
./install -console
The -console tells it to run in textmode and not try to find a xserver

The install is pretty straight forward, i took the default for everything BUT the setup (switched that to remote setup) and everything worked quite nicely. Remember that this will ask you for the user the Domino server runs under. If you used something else than notes, please adjust the setup accordingly.

When the install is done, domino will ask you if you want to launch the remote server setup right away. Answer this one with yes.

Remote setup
For this step, you need a windows that has the Domino Administrator installed. With that one, select "remote server setup" and connect to the fresh install. Everything should work fine, and in the end tell it to stop the server aswell.

Manageing the Enviroment
In my installation, domino was not able to handle the UTF-8 coding of the language. So whenever i started it, it gave me cryptic numbers instead of messages. to fix this, go into the folder /opt/ibm/lotus/notes/latest/linux/res. once there, there should be a folder called en_EN.UTF-8 or de_DE.UTF-8. create a softlink in to this folder without the .UTF-8 bit append to it with this command (if your locale is english)
Quote:
cd /opt/ibm/lotus/notes/latest/linux/res
sudo ln -s en_EN.UTF-8 en_EN
The next quirk is that the domino server is not able to find it's libraries. To fix that, you will need to set the environment variable LD_LIBRARY_PATH. Best way (for me) do to that is to add it to the /etc/environment file. So, add this line to the end of the file
Quote:
LD_LIBRARY_PATH="/opt/ibm/lotus/notes/latest/linux"
starting the Domino Server
i have not yet found/written a start script for the domino Server so i still do it manually. Log in as the user notes and change into the data directory of your notes server (for me it is /local/notesdata)
once there, you can start the server with /opt/ibm/lotus/bin/server. It should boot up nicely and run as long as that console is open. I usually start it in a screen session so that i can close the terminal and the server keeps running.
Quote:
cd /local/notesdata
/opt/ibm/lotus/bin/server
NOTE: Here was my big problem. I used to start the server with the command /opt/ibm/lotus/notes/latest/linux/server and it also boot up, but the HTTP process (webserver) of the Domino crashes with the error "Unable to find VM - Aborting". Why that is the case, i don't know, but somehow this way of starting it works

we are done
that should have been it. The server is running smoothly and you can use your Client/Administrator to start configuring it.

Hope this helps people like me who get stuck on stupid errors nobody can explain
__________________
Calvin: I'm being educated against my will! My rights are being trampled!
Hobbes: Is it a right to remain ignorant?
Calvin: I don't know, but I refuse to find out!
________________________________________
Last edited by SpaceTeddy; May 20th, 2008 at 05:18 AM.
Re: Howto: Install Domino 8.0.1 on Ubuntu
________________________________________
Start/Stop Script for Domino 8.0.1 on Ubuntu Server 7.10

I found an old start script for a domino server on a debian etch install running notes 6.5. This script did not work with the ubuntu 7.10 server, so i heavily modified it to work again. I don't know yet if it fully works, but as far as i could test it, it did to the job.. more or less

The files are attached. if you want to use it, do the following
* copy the file domino into the folder /etc/init.d
* copy the file lotusdomino into the folder /etc/default
* make both files executable
* change owner on both files to be root
* add a softlink to gawk in /usr

once that is done, the script should work (or so it did for me)

PS: i used this way, because the script offered here for domino server does not seem to work on ubuntu... or i am too silly to get it to work
Attached Files

dominoscript.tar (10.0 KB, 37 views)__________________
Calvin: I'm being educated against my will! My rights are being trampled!
Hobbes: Is it a right to remain ignorant?
Calvin: I don't know, but I refuse to find out!
________________________________________
Last edited by SpaceTeddy; February 29th, 2008 at 08:18 AM.
#3 Manually starting Domino from remote window (via Putty)
________________________________________
Thanks for the great tips. It helped me get Domino installed.

The amazing thing is that I've got a 10 year old P2-450 MHz computer with 256 MB of RAM, yet Ubuntu steams right along, even with Samba, Lighttpd (web server) and Domino (web/Notes server) all running at the same time! What a welcome change from my previous (Redmond) environment!

I couldn't get the automatic thing to work (haven't figured out the whole services thing yet -- I'm an Ubuntunewbie) but since my environment is strictly for testing and training (I recently taught a university class in "Rapid App Dev with IBM Lotus Notes"), I'm not too worried.

However, I did struggle to figure out how to start the Domino server remotely from a Putty window, and without having to keep that window open. (I can't remember where I found this tip, unfortunately.)

Anyway, if I enter this as one line in the remote window, Domino will start and continue to run, while still returning control of the window to me for other server stuff. I believe it's the final '&' that makes that work.

cd /local/notesdata && /opt/ibm/lotus/bin/server &

Dang, this is cool stuff!
Re: Howto: Install Domino 8.0.1 on Ubuntu
________________________________________
there are acctually quite a number of way to start it. The thing is, i like to have to start automaticially on boot, so i do not have to worry about loging into the server if it reboots and start it manually.

Also, when you do it like that, you do not get the messages that are printed to the console. Of course, these are usually also found in the log.nsf (or something like that), but sometimes it is just handy having them in a textfile where you can grep quickly.

so, i would suggest to alter that command into
Quote:
cd /local/notesdata && /opt/ibm/lotus/bin/server &> /var/log/domino
to make sure that the logs are acctually being written properly.

The other alternative is to start domino in a screen session. This way, you can always reattach yourself to the session - even if you close your ssh session or the conection breaks - screen stays open !

nice to know that this howto acctually helped someone
__________________
Calvin: I'm being educated against my will! My rights are being trampled!
Hobbes: Is it a right to remain ignorant?
Calvin: I don't know, but I refuse to find out!
Re: Howto: Install Domino 8.0.1 on Ubuntu
________________________________________
I have followed your instructions but Domino C18XSEN fails to install for me. The ./install script tells me it is loading Java VM then drops back to the command line. Could you please explain which packages you have installed as I feel I must be missing something important. Have you set any other parameters to convince this installation script to behave itself?

This is my first experience with Ubuntu and I am hoping to have a minimal system to run Domino as cleanly as possible so I have only loaded the base Ubuntu 8.04 so far.
Re: Howto: Install Domino 8.0.1 on Ubuntu
________________________________________
let me think what i did... back when i installed the thing...
I know i had that problem with the crashing installer too, but i cannot remember how i fixed it...

have you started the installer as root ? i don't mean sudo ./install, i mean typing sudo su and becoming root all together ?

about the only thing i can possibly think of... really
__________________
Calvin: I'm being educated against my will! My rights are being trampled!
Hobbes: Is it a right to remain ignorant?
Calvin: I don't know, but I refuse to find out!



把用户shaoxc添加到组ryouka中


miFor 2004-9-22 10:42 AM
useradd -g ryouka shaoxc

if exist shaoxc,use
usermod -g ryouka shaoxc

get-apt install ubuntu-desktop 安装KDE桌面

apt-get autoremove kdelibs4 libarts1 卸载KDE桌面

没有评论: