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

2012年4月11日 星期三

yum repo setting

若出現cannot find a valid baseurl for repo的訊息
請編輯/etc/yum.repo.d/裡面的.repo檔案
把baseurl前面的#去掉

2012年4月10日 星期二

ntlmaps

1. Download ntlmaps
http://ntlmaps.sourceforge.net/

2. extract
tar xvfz ntlmaps-0.9.9.0.1.tar.gz -C /usr/local/bin

3. create soft symbolic link
ln -s /usr/local/bin/ntlmaps-0.9.9.0.1 /usr/local/bin/ntlmaps

4. Edit server.cfg
vi /usr/local/bin/ntlmaps/server.cfg


5. Run!
/usr/local/bin/ntlmaps/main.py -c /usr/local/bin/ntlmaps/server.cfg


6. Optional: Add run command into /etc/rc.local

Reference:
[1]

2012年3月14日 星期三

Eclipse設定SVN以及Mercurial

1. install EclipseMercurial
Update Site: http://cbes.javaforge.com/update

2. install SVN Connector:
Update Site: http://download.eclipse.org/technology/subversive/0.7/update-site/
(the site address might be duplicated)

(under Ubuntu)
1. install mercurial
>sudo apt-get install mercurial

2. install subversion
>sudo apt-get install subversion

2012年3月8日 星期四

Mercurial: push source code on bitbucket.org

1. Register an account on bitbucket.org and create a repository named sample-repo

2. yum install mercurial

3. configure https certificate authorities. create file /etc/mercurial/hgrc contain

[web]
cacerts = /etc/pki/tls/certs/ca-bundle.crt


4. enter the path of source code, initial hg repository
> cd /path/of/source
>hg init

5. create a file .hg/hgrc contain

[ui]
username = FirstName LastName 


6. add file into repository
>hg add

7. commit repository
>hg commit
edit the file to remove some HG: prefix

8. push the repository
>hg push https://your-account@bitbucket.org/your-account/sample-repo

9. Congratulation! You can browse your code on bitbucket.org now.

Reference:
http://mercurial.selenic.com/wiki/Mercurial
http://mercurial.selenic.com/wiki/CACertificates
http://mercurial.selenic.com/wiki/QuickStart