顯示具有 煩人的設定 標籤的文章。 顯示所有文章
顯示具有 煩人的設定 標籤的文章。 顯示所有文章

2008年6月20日 星期五

apt / yum

#
# Install apt server
#

Step 1, install apt rpm (*install httpd for using web access on apt)
- from Redhat disc
i.e. rpm -Uvh apt-0.5.5cnc6-fr1

Step 2, setup RPM folders for os and updates
i.e. mkdir -p /var/www/html/apt/redhat
mkdir /var/www/html/apt/redhat/9
mkdir /var/www/html/apt/redhat/9/RPMS.os
mkdir /var/www/html/apt/redhat/9/RPMS.updates
copy redhat disc RPMS to RPMS.os
copy patch updates to RPMS.updates

Step 3, generate base folder for apt
i.e. genbasedir /var/www/html/apt/redhat/9 os updates

Step 4, start web server

Step 5, [Client side] EDIT /etc/apt/source.list
(ADD) rpm http:///apt/redhat/9 os updates

Usage :
Update rpm package list : apt-get update
Install package : apt-get install
Upgrade all package to newest version : apt-get upgrade

=======================================================
#
# Yum install (* under FC4)
#
Step 1 : install yum rpm
- from FC4 disc
i.e. rpm -Uvh yum-2.3.2-7.rpm

Step 2 : install createrepo
- from FC4 disc
i.e. rpm -Uvh createrepo-0.4.2-2.noarch.rpm

Step 3 : setup RPM folders for base and update
i.e. mkdir -p /var/www/html/yum/fc4
mkdir /var/www/html/yum/fc4/base
mkdir /var/www/html/yum/fc4/update
cp fc4 disc RPMS to base
cp fc4 patch updates to update

Step 4 : import GPG key (both server and client)
i.e. rpm --import /usr/share/rhn/RPM-GPG-KEY
rpm --import /usr/share/rhn/BETA-RPM-GPG-KEY
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora-test

Step 5 : generate rpms header folder
i.e. yum-arch /var/www/html/yum/fc4/base
yum-arch /var/www/html/yum/fc4/update

Step 4 : setup repositories
i.e. createrepo /var/www/html/yum/base
createrepo /var/www/html/yum/update

Step 5 : setup repositories entry (both server and client side)
clear old .repo files(rm /etc/yum.repos.d/*.repo)
ADD new file for yum server -
/etc/yum.repos.d/fc4.repo
---------------------------------------------
[fc4-base]
name=fc4 - base
baseurl=http://YUM_SERVER/yum/fc4/base
enabled=1
[fc4-update]
name=fc4 - update
baseurl=http://YUM_SERVER/yum/fc4/update
enabled=1
---------------------------------------------

Step 6 : start web server

Usage :
Install package : yum install
Update package : yum update
Upgrade all package to newest version : yum -y update
Clean downloaded packages : yum clean packages

2008年6月19日 星期四

Network boot server


#
# Network boot server setting
#

# require package
dhcp
tftp-server
syslinux

# Setup dhcp server
EDIT /etc/dhcpd.conf
#-----------------------------------------------
ddns-update-style none;

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.11 192.168.0.20;
default-lease-time 3600;
max-lease-time 4800;
option routers 0.0.0.0;
option subnet-mask 255.255.255.0;
filename "pxelinux.0";
}
#-----------------------------------------------

** option - filename : this is the file for pxe client download and execute

# Setup tftp server
EDIT /etc/xinet.d/tftp
#-----------------------------------------------
server_args = -v -s /tftpboot
disable = no
#-----------------------------------------------
restart xinetd
/etc/rc.d/init.d/xinetd restart

# Setup kernel for remote client
- Fedora Core
get from FC source
copy FC source : /isolinux/vmlinuz to /tftpboot/fc
copy FC source : /isolinux/initrd.img to /tftpboot/fc-initrd

# Setup pxelinux file for boot
mkdir /tftpboot (if not exists)
cp -a /usr/lib/syslinux/pxelinux.0 /tftpboot/
mkdir /tftpboot/pxelinux.cfg
EDIT /tftpboot/pxelinux.cfg/default
#-----------------------------------------------
prompt 1
default fc
timeout 150

label fc
kernel fc
append initrd=fc-initrd ramdisk_size=8192
#-----------------------------------------------

# Usage
# start dhcp server
1) /etc/rc.d/init.d/dhcpd start
2) start client machine use network boot
** default is boot from fc, press enter would continue

# nfs install for linux (optional, u may not want to install throung nfs)
EDIT /etc/exports
#-----------------------------------------------
/data/FC (ro)
#-----------------------------------------------
/etc/rc.d/init.d/nfs start

2008年6月18日 星期三

disable browser : checkloaduri

為了讓 browser 可以call local program來行, 要disable 一些安全設定.

Firefox 1.0.x 或較早版本流覽器
在地址欄中鍵入 "about:config". 找到 "security.checkloaduri"一項 (你可以在過濾中鍵入 "security.check" 以快速尋找) 當前這個值顯示為 "true". 雙擊這一行內容. 這個值會轉變為 "false". 現在本機上的檔可以被正常讀取.

Firefox 1.5.x 或更新版本流覽器
尋找 Firefox 在硬碟中的使用者設定, 這是一個包含8個字的隨機字串目錄 (下例中[12341234]是隨機的8位元字串):
· Windows : "C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles[12341234].default\"
· Linux : "/home/username/.mozilla/firefox/[12341234].default/"
· Mac : /username/Library/Application Support/Firefox/Profiles/[12341234].default/
在這個目錄中建立一個名為 "user.js" 的文字檔案, 然後把下面幾條 rule 放進去:
user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites", "http://www.abc.com http://www.def.com");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
如此, 便可讓 www.abc.com 及 www.def.com 經網頁呼叫 user 本機的檔案.