1. 確認vnc-server已安裝
2. 用vncpasswd產生/root/.vnc/passwd
3. 編輯/etc/X11/xorg.conf
增加Section "Module"
Section "Module"
Load "vnc"
EndSection
在Section "Screen"增加此行
Option "passwordFile" "/root/.vnc/passwd"
4. 把port 5900打開
==================
xrdp安裝設定 (可用Windows遠端桌面連線)
1. 安裝EPEL repositories (以下link search EPEL)
http://wiki.centos.org/AdditionalResources/Repositories
a. download rpm
>wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
b. install rpm
> rpm -ivh epel-release-5-4.noarch.rpm
2. install xrdp
>yum install xrdp
3. 設定/etc/xrdp/xrdp.ini, 新增此session
[xrdp2]
name=Desktop
lib=libvnc.so
ip=127.0.0.1
port=5900
username=
password=ask
4. 把Firewall port 3389打開
5. restart xrdp & vncserver
>service vncserver restart
>service xrdp restart
6. 在Remote windows測試
開啟"Winodws遠端桌面連線" mstsc.exe
IP:remtoe端的IP
7.連進去後Module欄, 下拉選"Desktop"
keyin密碼就OK了!
參考資料:
1. http://it-specialists.org/pages/posts/howto-installation-of-xrdp-under-centos-5.5-10.php
2. http://blog.yam.com/linkatzelda/article/27398655
3. http://www.vixual.net/blog/archives/tag/xrdp
個人在學習Linux過程當中的個人筆記,提供個人及有需要的人查閱,若有錯誤歡迎提供指正,謝謝。 This Blog recorded notes about my learning Linux and provides myself and others reference. If there are any incorrect information, welcome to leave a message to correct me, Thanks.
2011年1月20日 星期四
2011年1月13日 星期四
解壓tar.gz
shell> gunzip zabbix-1.8.tar.gz && tar -xvf zabbix-1.8.tar
解tar.bz2
$tar -xjvf example.tar.bz2
reference:
http://kenno.wordpress.com/2006/04/18/how-to-decompress-tarbz2-file/
解tar.bz2
$tar -xjvf example.tar.bz2
reference:
http://kenno.wordpress.com/2006/04/18/how-to-decompress-tarbz2-file/
2010年12月1日 星期三
customize LiveCD
1. put LiveCD iso to home directory
3. make a temporal directory for mount ISO
# mkdir /tmp/LiveCD/
4. mount LiveCD ISO
# mount -o loop ~/CentOS-5.5-x86_64-LiveCD.iso /tmp/LiveCD/
5. make a tempral directory for custom LiveCD (for pack back into ISO)
# mkdir -p ~/livecd/cd
6. copy all file except squashfs.img
# rsync --exclude=/LiveOS/squashfs.img -a /tmp/LiveCD/ ~/livecd/cd/
7. make a temporal directory for mounting squashfs.img
# mkdir /tmp/squashfs/
8. mount squashfs.img
# mount -t squashfs -o loop /tmp/LiveCD/LiveOS/squashfs.img /tmp/squashfs/
9. make a temporal directory for ext3fs
# mkdir ~/livecd/ext3fs/
10. copy all file of squashfs.img to ext3fs (there is an ext3fs.img)
# rsync -a /tmp/squashfs/ ~/livecd/ext3fs/
11. make a temporal directory for custom LiveCD's /
# mkdir ~/livecd/custom/
12. mount ext3fs.img
# mount -t ext3 -o loop ~/livecd/ext3fs/LiveOS/ext3fs.img ~/livecd/custom/
13. chroot to ~/livecd/custom
# chroot ~/livecd/custom
14. mount /proc and /sys
# mount -t proc none /proc/
# mount -t sysfs none /sys/
15. you can customize your new LiveCD Now!!
16. umount /proc and /sys and exit
# umount /proc/
# umount /sys/
# exit
17. create a new empty ext3fs file and import all files in custom/
# dd if=/dev/zero of=~/livecd/ext3fs.img bs=1M count=4096
# mkfs.ext3 ~/livecd/ext3fs.img
# mkdir ~/livecd/newfs
# mount -o loop ~/livecd/ext3fs.img ~/livecd/newfs
cp -dpR ~/livecd/custom/* ~/livecd/newfs
18. umount ext3fs and newfs
# umount ~/livecd/custom
# umount ~/livecd/newfs
19. replace original ext3fs to new ext3fs file
# cp -f ~/livecd/ext3fs.img ~/livecd/ext3fs/LiveOS/ext3fs.img
20. umount squashfs
# umount /tmp/squashfs
21. umount ISO
# umount /tmp/LiveCD/
22. pack squashfs.img
# mksquashfs ~/livecd/ext3fs ~/livecd/cd/LiveOS/squashfs.img
23. pack iso
# cd ~/livecd/cd
# mkisofs -r -V "CentOS-5.5-x86_64-LiveCD-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/CentOS-5.5-x86_64-LiveCD-Custom.iso .
Congratulation! you did it.
參考資料:
http://osdir.com/ml/linux.redhat.fedora.livecd/2008-07/msg00003.html
http://jeffreywt.com/open-source/linux/modifying-a-livecd-with-squashfs-tools
3. make a temporal directory for mount ISO
# mkdir /tmp/LiveCD/
4. mount LiveCD ISO
# mount -o loop ~/CentOS-5.5-x86_64-LiveCD.iso /tmp/LiveCD/
5. make a tempral directory for custom LiveCD (for pack back into ISO)
# mkdir -p ~/livecd/cd
6. copy all file except squashfs.img
# rsync --exclude=/LiveOS/squashfs.img -a /tmp/LiveCD/ ~/livecd/cd/
7. make a temporal directory for mounting squashfs.img
# mkdir /tmp/squashfs/
8. mount squashfs.img
# mount -t squashfs -o loop /tmp/LiveCD/LiveOS/squashfs.img /tmp/squashfs/
9. make a temporal directory for ext3fs
# mkdir ~/livecd/ext3fs/
10. copy all file of squashfs.img to ext3fs (there is an ext3fs.img)
# rsync -a /tmp/squashfs/ ~/livecd/ext3fs/
11. make a temporal directory for custom LiveCD's /
# mkdir ~/livecd/custom/
12. mount ext3fs.img
# mount -t ext3 -o loop ~/livecd/ext3fs/LiveOS/ext3fs.img ~/livecd/custom/
13. chroot to ~/livecd/custom
# chroot ~/livecd/custom
14. mount /proc and /sys
# mount -t proc none /proc/
# mount -t sysfs none /sys/
15. you can customize your new LiveCD Now!!
16. umount /proc and /sys and exit
# umount /proc/
# umount /sys/
# exit
17. create a new empty ext3fs file and import all files in custom/
# dd if=/dev/zero of=~/livecd/ext3fs.img bs=1M count=4096
# mkfs.ext3 ~/livecd/ext3fs.img
# mkdir ~/livecd/newfs
# mount -o loop ~/livecd/ext3fs.img ~/livecd/newfs
cp -dpR ~/livecd/custom/* ~/livecd/newfs
18. umount ext3fs and newfs
# umount ~/livecd/custom
# umount ~/livecd/newfs
19. replace original ext3fs to new ext3fs file
# cp -f ~/livecd/ext3fs.img ~/livecd/ext3fs/LiveOS/ext3fs.img
20. umount squashfs
# umount /tmp/squashfs
21. umount ISO
# umount /tmp/LiveCD/
22. pack squashfs.img
# mksquashfs ~/livecd/ext3fs ~/livecd/cd/LiveOS/squashfs.img
23. pack iso
# cd ~/livecd/cd
# mkisofs -r -V "CentOS-5.5-x86_64-LiveCD-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/CentOS-5.5-x86_64-LiveCD-Custom.iso .
Congratulation! you did it.
參考資料:
http://osdir.com/ml/linux.redhat.fedora.livecd/2008-07/msg00003.html
http://jeffreywt.com/open-source/linux/modifying-a-livecd-with-squashfs-tools
2010年11月11日 星期四
2010年10月12日 星期二
進入single user mode
在開機選單grub裡,
kernel那行最後加上 -s開進去就是single user mode了, 可以passwd改密碼之類的
1. 當grub倒數時, 讓他停在選單
2. 按e, 編輯
3. 選到kernel那行 按e 編輯
4. 最後面加上-s, 然後Enter
5. 選到kernel那行 按b
kernel那行最後加上 -s開進去就是single user mode了, 可以passwd改密碼之類的
1. 當grub倒數時, 讓他停在選單
2. 按e, 編輯
3. 選到kernel那行 按e 編輯
4. 最後面加上-s, 然後Enter
5. 選到kernel那行 按b
2010年10月1日 星期五
在RHEL 建立 postgreSQL database
在RHEL5.4下 postgreSQL要先安裝好並啟動
service postgresql start
1. 不能直接用root來建立資料庫, 所以另外create一個OS的user
adduser jack
passwd jack
2. 建立/更改 OS user "postgres"的密碼
passwd postgres
3. 建立role (postgreSQL的)
su - postgres
4. 建立資料庫 createdb
createdb jack
http://blog.vinceliu.com/2008/02/looking-for-postgres-configurations.html
service postgresql start
1. 不能直接用root來建立資料庫, 所以另外create一個OS的user
adduser jack
passwd jack
2. 建立/更改 OS user "postgres"的密碼
passwd postgres
3. 建立role (postgreSQL的)
su - postgres
createuser -d -a -P jeofflogout
4. 建立資料庫 createdb
createdb jack
http://blog.vinceliu.com/2008/02/looking-for-postgres-configurations.html
2010年4月15日 星期四
安裝phpMyAdmin
OS: CentOS 5.4
解壓縮, 放到 /var/www/html/
開browser, http://localhost/phpMyAdmin
出現須要PHP5.2+
用php -v只到5.1.x
用yum install php還是5.1.x
google找到http://blog.lilujun.com/post/1208/首先在/etc/yum.repos.d/CentOS-Base.repo 文件末尾添加以下代碼:
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
保存此文件,執行yum --disablerepo=\* --enablerepo=c5-testing install php
後, php到5.2.10
照http://wiki.phpmyadmin.net/pma/Setup
安裝完 phpMyAdmin後, 進http://localhost/phpMyAdmin
出現沒load mcrypt的錯誤
用yum install php-mcrypt後還是一樣 (已重開httpd)
用php -v發現load mcrypt失敗 (應該是mcrypt和php版本不相容)
用yum --disablerepo=\* --enablerepo=c5-testing install php-mcrypt 即可解決
訂閱:
文章 (Atom)