2012年8月29日 星期三

Install mongodb on Ubuntu

1. import public key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
2. create /etc/apt/sources.list.d/10gen.list
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
3.
sudo apt-get update
4.
sudo apt-get install mongodb-10gen

Reference: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian-or-ubuntu-linux/

tsocks

1. install epel first
http://fedoraproject.org/wiki/EPEL
1. insatll tsocks
yum install tsocks
2. add file /etc/tsocks.conf
server = 127.0.0.1
server_type = 5
server_port = 1234
3. establish ssh tunnel
ssh -D 1234 user@xxx.remote.host
4. wget with socks proxy
tsocks wget http://get.something
5. you might want to unset the http_proxy variable
unset http_proxy

2012年7月23日 星期一

Install MediaWiki

1. Install mysql, mysql-server, httpd
#yum install mysql mysql-server httpd

2. start mysql server
#service mysqld start

3. change mysql root password
#mysqladmin ping -u root password 'newpassword'
Enter password: (just press Enter)
mysqld is alive
(The mysql root password was changed to newpassword)


4. Download MediaWiki
http://www.mediawiki.org/wiki/Download

5. Extract to /var/www/html/wiki
#cd /var/www/html
#mkdir wiki
#copy all files intol wiki foler

6. using browser open http://127.0.0.1/wiki
follow the instruction step by step to install MediaWiki

(Note. If install on CentOS 5, must install php53-common and php53-mysql)

7. Backup, using the script
http://www.mediawiki.org/wiki/User:Megam0rf/WikiBackup
schedule the script on crontab weekly

http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki
http://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup

2012年6月6日 星期三

install OpenLDAP on CentOS6

1. 使用yum安裝openldap-servers(slapd)和openldap-client(ldap)
yum install openldap-servers openldap-clients

2. 編輯or產生/etc/openldap/ldap.conf
vi /etc/openldap/ldap.conf
URI ldap://127.0.0.1
BASE dc=my-domain,dc=com

3. 複製slapd.conf和DB_CONFIG

cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

4. slappasswd
打上欲設定的ldap server密碼,將最後一行{SSHA}xxxxxxxxx複製起來

5.編輯/etc/openldap/slapd.conf
把裡面的dc=my-domain,dc=com改成自己要的
在rootpw的地方把剛剛複製的{SSHA}xxxxx貼上去

6.建立一root.ldif檔,內容
#root
dn: dc=my-domain,dc=com
dc: my-domain
objectClass: dcObject
objectClass: organizationalUnit
ou: my-domain.com
7. 先把slapd.d裡的資料移除
rm -rf /etc/openldap/slapd.d/*

8. 使用slaptest將slpad.conf轉成slapd.d/
slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

9. 改變檔案權限及擁有者
chown -R ldap:ldap /var/lib/ldap
chown -R ldap:ldap /etc/openldap/slapd.d

10.將slapd設為system boot up自動啟動
chkconfig slapd on

11.啟動slapd
service slapd start

12. 登入Webmin的LDAP Users and Groups (config要設好)
LDAP server uses encryption? -> Yes SSL
Bind to LDAP server as -> cn=Manager,dc=my-domain,dc=com
Credential for bind name above -> Set to "ldap server password"

13. Open port 389 TCP in firewall

Reference:
http://jamyy.dyndns.org/blog/2012/01/3506.html

2012年6月4日 星期一

nsupdate出現SERVFAIL

查看/var/log/message,因為權限的問題,所以
chown -R named:named /var/named
or
chown -R named:named /var/named/chroot/var/named
還有SELINUX預設也會擋,要關掉bind的部分 named_write_master_zones
setsebool -P named_write_master_zones 1

http://en.wikipedia.org/wiki/Nsupdate
http://fedoraproject.org/wiki/SELinux/named