軟體的配置來自 http://arithboy.org/wiki/gnu/arch/Soft.html
Contents<dl></dl>
<dt> squid </dt>
<dt> ssh </dt>
<dd> <dl><dt> ssh 無密碼配置 </dt></dl> </dd>
<dt> SFS 伺服器配置 </dt>
<dt> Alsa </dt>
<dt> Mplayer 字幕配置 </dt>
<dt> 在apache 使用utf-8 </dt>
<dt> .serverauth.????問題的解決 </dt>
<dt> fcitx </dt>
<dt> 普通使用者使用ntfs </dt>
<dt> rsync 的@ERROR: chdir failed錯誤 </dt>
<dt> DNS 伺服器配置 </dt>
topsquid配置如下:
http_port 59.64.5.62:3128
cache_mem 100 MB
acl wang src "/home/arch/.proxy"#儲存代理伺服器使用者的IP
http_access allow wangtopssh出錯提示如下:
# sshd
Could not load host key: /etc/ssh/ssh_host_key
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 1. Could not load host key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.解決方法ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""sshd 使用/etc/hosts.allow和hosts.deny.要注意配置topssh 無密碼配置
假設S為遠端伺服器,C為本地用戶端,兩台機器都有使用者wang.
在C裡運作
ssh-keygen -t rsa一路回車即可.scp ~/.ssh/id_rsa.pub S:/tmp
ssh S
cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
rm /tmp/id_rsa.pub以後 ssh S時則直接以wang登入不需要密碼了.
注意S上~/.ssh權限為 755.
topSFS 伺服器配置pacman -S sfs
mkdir /etc/sfs
sfskey gen -P /etc/sfs/sfs_host_key
mkdir -p /var/sfs/root/usr1
mkdir -p /var/sfs/root/usr2
echo "Export /var/sfs/root /" >>/etc/sfs/sfsrwsd_config
echo "Export /mnt/pp/fs2 /usr2" >>/etc/sfs/sfsrwsd_config
echo "Export /mnt/skate/fs1 /usr1" >>/etc/sfs/sfsrwsd_config
echo "/var/sfs/root localhost(rw)" >> /etc/exports
echo "/mnt/pp/fs2 localhost(rw)" >> /etc/exports
echo "/mnt/skate/fs1 localhost(rw)" >> /etc/exports
#配置完成~topAlsaalsactl restoretopMplayer 字幕配置關鍵是字型沒有可讀權限,搞了半天.font=/usr/share/texmf-local/fonts/truetype/simsun.ttf
subcp=cp936
subfont-text-scale=5top在apache 使用utf-8在apache配置檔案中
AddDefaultCharset ISO-8859-1 -> AddDefaultCharset offtop.serverauth.????問題的解決使用startx啟動X,主目錄下有.serverauth.????檔案, 詳細見http://www.shallowsky.com/blog/index.cgi/linux/serverauth.html編輯/usr/bin/startx
将
xserverauthfile=$HOME/.serverauth.$$
替換為
xserverauthfile=$XAUTHORITYtopfcitxexport LC_ALL=zh_CN.gbk
export LANG=zh_CN.gbk
export XMODIFIERS=@im=fcitx應設定在fcitx啟動之前.top普通使用者使用ntfs在fstab中/dev/sda6 /mnt/e ntfs ro,user,noauto,umask=222,iocharset=utf8 0 0toprsync 的@ERROR: chdir failed錯誤配置檔案從網頁上直接拷貝,要删除額外的符号和空格,使用TAB來對齊,即可解決.topDNS 伺服器配置啟動時 提示named: capset failed: Operation not permitted: please ensure that the capset kernel module is loaded. see insmod(8)加載capset子產品時發現不存在,在mailist上看到應該加載子產品capability,應該是子產品改名了modprobe capabilityArch linux 備份系統注意事項
1.首先備份/home分區.
2.備份全局設定,主要是修改過的系統/軟體配置檔案 下面是我的配置,檔案名sysfile
/etc/X11/xorg.conf /etc/abs/abs.conf /etc/acpi/actions /etc/fonts/local.conf /etc/gtk-2.0/gtk.immodules /etc/hosts /etc/hosts.allow /etc/hosts.deny /etc/inputrc /etc/laptop-mode/ /etc/locale.gen /etc/makepkg.conf /etc/mkinitrd.conf /etc/network-profiles /etc/pacman.conf /etc/profile /etc/rc.conf /etc/udev/rules.d/10-network.rules /etc/httpd/conf/httpd.conf /etc/squid/squid.conf /etc/rsyncd.conf /etc/proftpd.conf 2.恢複以後重新運作的指令 locale-gen visudo pppoe-setup
3.PKGBUILD的備份.
建議平時使用時就設立本地軟體庫, 在makepkg.conf中修改
export PKGDEST=/var/mypkgs 使每次運作makepkg時會将軟體包生成到/var/mypkgs中,然後運作 sudo gensync /var/abs/local /var/mypkgs/custom.db.tar.gz 在pacman.conf中添加 [custom] Server = file:///var/mypkgs 備份軟體的PKGBUILD,*.install,*.patch等 find /var/abs/local -maxdepth 2 -type f ! -name "filelist" >mypkgs 上面将local下子目錄中的檔案(不包括目錄和filelist)路徑輸入到mypkgs
使用
tar -cjvf mypkgs.tar.bz2 -T mypkgs tar -cjvf sysfile.tar.bz2 -T sysfile
備份已經安裝軟體清單
pacman -Q|sed -e 's/ .*[0-9]$/ /g' -e '1 i\pacman -S '|tr -d "\012" >soft chmod +x soft 生成soft檔案格式為"pacman -S soft1 soft2 ... softn" 下次運作該腳本即可.
這樣會改變軟體包的"Reason",可能将"installed as a dependency for another package"改變為"explicitly installed".
Linux下常用指令Contents<dl></dl>
<dt> lftp </dt>
<dt> 選擇字型 </dt>
<dt> 更改網卡位址 </dt>
<dt> 擷取網卡位址 </dt>
<dt> 檢視目錄所占空間 </dt>
<dt> 将檔案名從gbk轉換為utf8 </dt>
<dt> Xorg </dt>
檢視檔案格式
file lftp 下載下傳整個目錄 mirror -c --parallel=number remotedir localdirtop選擇字型xfontseltop更改網卡位址修改 /etc/network/interfaces 加一行 hwaddress ether ##:##:##:##:##:## 然後 # /etc/init.d/networking restarttop擷取網卡位址arp -a 59.64.5.1top檢視目錄所占空間du -sh dir/top将檔案名從gbk轉換為utf8convmv -f cp936 -t utf8 --notest -r dir/topXorg工具 gtf xdpyinfo 用于修改顯示器的各種屬性等,調整老機器的花屏現象. 還有 xvidtune
Arch啟動速度的優化
最近lsmod一下,發現列出的子產品N多,好幾個螢幕才顯示完,故查了一下,找到篇文章解決這個問題 http://bbs.archlinux.org/viewtopic.php?t=19097
1. 重新制作initrd.首先備份/boot/initrd26.img,修改 /etc/mkinitrd.conf. 這裡的子產品隻是用來支援arch的啟動,是以usb,cd的子產品可以禁用掉,啟動以後需要時再加載. 例如我的硬碟是sata的:
REMOVE_IDE=1
REMOVE_SCSI=
REMOVE_SATA=
REMOVE_CDROM=1
REMOVE_USB=1
REMOVE_FW=1
REMOVE_RAID=1
REMOVE_DM=1
REMOVE_FS=然後[arch@Archlinux ~]$ hwdetect --sata
HOSTCONTROLLER_SATA: ata_piix
[arch@Archlinux ~]$ hwdetect --scsi
HOSTCONTROLLER_SCSI: sd_mod把上面檢測的兩個子產品添加到下面HOSTCONTROLLER_IDE=
HOSTCONTROLLER_SCSI="sd_mod"
HOSTCONTROLLER_SATA="ata_piix"
HOSTCONTROLLER_USB=
FILESYSTEMS="reiserfs"然後sudo mkinitrd auto --show如果你的是ide硬碟,将REMOVE_SCSI= REMOVE_SATA=都設為1[arch@Archlinux ~]$ hwdetect --ide将顯示的子產品加入HOSTCONTROLLER_IDE= 即可. 現在initrd26.img體積小多了.-rw-r--r-- 1 root root 3576874 2006-02-21 19:21 initrd26-full.img
-rw-r--r-- 1 root root 3079937 2006-02-23 08:54 initrd26.bak.img
-rw-r--r-- 1 root root 808558 2006-02-23 10:01 initrd26.img後兩個大家都很熟悉了. 2. 編輯 /etc/rc.conf,将不需要的子產品加入 BLACKLIST.
3. 編譯 /etc/rc.conf 在某些daemons前加上@,使之在背景運作.加快啟動速度. 例如我的
DAEMONS=(syslog-ng network @crond @sshd @squid !alsa)