顯示具有 CentOS 標籤的文章。 顯示所有文章
顯示具有 CentOS 標籤的文章。 顯示所有文章

2014年11月9日 星期日

build freeipmi rpm on centos

1. install packages
#yum install rpm-build make gcc libgcrypt-devel texinfo

2. build rpms
#rpmbuild -ta freeipmi-X.Y.Z.tar.gz

Build ipmitool 1.8.18 rpm
# bunzip2 -c ipmitool-1.8.18.tar.bz2 | gzip -c > ipmitool-1.8.18.tar.gz
# rpmbuild -ta ipmitool-1.8.18.tar.gz

The ipmitool 1.8.18 rpm file is put on ~/rpmbuild/RPMS

2014年1月10日 星期五

Install wxPython on CentOS

http://pkgs.org/centos-6/epel-x86_64/wxPython-2.8.12.0-1.el6.x86_64.rpm.html

Install Howto

  1. Download the latest epel-release rpm from
    http://dl.fedoraproject.org/pub/epel/6/x86_64/
  2. Install epel-release rpm:
    # rpm -Uvh epel-release*rpm
  3. Install wxPython rpm package:
    # yum install wxPython

2013年11月28日 星期四

dhcpd6.conf & radvd.conf & ip6tables

1. On CentOS 6.4 or RHEL 6.4. install dhcp and radvd
>yum install dhcp radvd

2. Edit NIC config to add IPv6 address. /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6ADDR=3ffe:501:ffff:1::1/64

3. edit /etc/dhcp/dhcpd6.conf to assign address pool
subnet6 3ffe:501:ffff:1::/64 {
    range6 3ffe:501:ffff:1::2 3ffe:501:ffff:1::1000
}

4. edit /etc/radvd.conf
interface eth0
{
    AdvSendAdvert on;
    MinRtrAdvInterval 30;
    MaxRtrAdvInterval 100;
    AdvHomeAgentFlag off;
    AdvManagedFlag off; #M bit = 0
    AdvOtherConfigFlag on; #O bit = 1
    prefix fc00:1234:5678:9abc::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr off;
    };
};

5. add rule in /etc/sysconfig/ip6tables (before -j REJECT line)
-A INPUT -p udp -m udp -m multiport --ports 546 -j ACCEPT
-A INPUT -p udp -m udp -m multiport --ports 547 -j ACCEPT

6. set dhcpd6 radvd start when system up
>chkconfig radvd on
>chkconfig dhcpd6 on

Reference:
http://www.lijyyh.com/2012/05/dhcpv6ip-ciscolinux-isc-dhcpwindows.html
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s1-dhcp_for_ipv6_dhcpv6.html

2013年6月14日 星期五

開啟NetworkManager可自動註冊hostname進公司windows domain

CentOS 6預設安裝桌面時才會安裝Network Manger,只安裝純文字介面預設不會安裝NetworkManager但可在手動安裝。
用Webmin改hostname之後重開機hostname就可ping的到了

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年2月7日 星期二

Install freeradius2 on CentOS

1. using yum install freeradius2 and freeradius2-utils (CentOS 5.X)
#yum install freeradius2 freeradius2-utils
CentOS 6.X:
package name is freeradius and freeradius-utils

2. start radiusd with debug mode
#radiusd -X
or, start radiusd service
#service radiusd start

3. add a user. add following line at the top of /etc/raddb/users

testing Cleartext-Password := "password"


4. add a accept client rule in /etc/raddb/client.conf:
client 192.168.0.0/24 {
     secret    = testing123
     shortname = private-network
}

5. restart the radiusd
#service radiusd restart

6. try the user testing is acceptable

$ radtest testing password 127.0.0.1 0 testing123

(If show Access-Accept, It success.
If show "radclient:: Failed to find IP address for XXX", That mean radclient can't resolve XXX, add a line to /etc/hosts likes "127.0.0.1 XXX" or setup DNS correctly)

7. try the user testing from remote client

$ radtest testing password 192.168.1.1 0 testing123


reference:
http://freeradius.org/doc/
http://tec1021.pixnet.net/blog/post/28639573-%E8%BC%95%E9%AC%86%E6%9E%B6%E5%A5%BDradius%E4%BC%BA%E6%9C%8D%E5%99%A8~

2011年12月21日 星期三

解決yum update perl conflict問題

若yum update perl發生
conflicts with file from package perl.x.x.x
用rpm -e移除perl.i386 (若妳的CentOS是x64)
rpm -e perl.i386
在執行yum update perl應該就不會發生conflicts了

參考資料:
http://slash4.de/tutorials/CentOS_5.4_perl_update_problem

2011年11月30日 星期三

vsftpd ipv6 setup

讓vsftpd service 可用ipv6 address連線 (環境: CentOS 5.X)

1. 編輯 /etc/vsftpd/vsftpd.conf
listen=NO #關掉ipv4-only sockets
listen_ipv6=YES #打開ipv4 ipv6相容的模式

2. restart vsftpd
# service vsftpd restart

2011年3月29日 星期二

ip route add

指令:
ip route add 10.6.0.0/16 via 10.3.23.254 dev eth0

若要每次interface起來就自動設定好:
在/etc/sysconfig/network-scripts/ 新增檔案 route-eth0
內容:
10.6.0.0/16 via 10.3.23.254 dev eth0

2011年3月4日 星期五

Install TestLink

1. yum install mysql
yum install mysql-server

2. Add CentOS-Testing repo
cd /etc/yum.repos.d/
wget http://dev.centos.org/centos/5/CentOS-Testing.repo
( edit .repo file, enabled=1)

3. yum install php php-mysql php-gd php-ldap

4. service mysqld start
chkconfig mysqld on
$ mysqladmin -u root password NEWPASSWORD

5. service httpd start
chkconfig httpd on

6. cp testlink-1.9.1.tar.gz /var/www/html/
cd /var/www/html/
tar zxvf testlink-1.9.1.tar.gz
mv testlink-1.9.1 testlink
rm testlink-1.9.1.ta.gz
chown -R apache:apache testlink
mkdir  /var/testlink
mkdir /var/testlink/logs
mkdir /var/testlink/upload_area
chown apache:apache /var/testlink/logs
chown apache:apache /var/testlink/upload_area

7. edit /etc/php.ini
session.gc_maxlifetime = 2400
max_execution_time = 120
memory_limit = 64M

8. service httpd restart

9. go to "http://localhost/testlink/

10. step by step install

11.To have a fully functional installation You need to configure mail server settings, following this steps

  • copy from config.inc.php, [SMTP] Section into custom_config.inc.php.
  • complete correct data regarding email addresses and mail server.


12. after installation, remove /install directory

Reference:
http://www.cyberciti.biz/faq/mysql-change-root-password/

2011年3月1日 星期二

CentOS tftp setup

1. yum install xinetd

2. chkconfig xinetd on

3. yum install tftp-server

4. chkconfig tftp on

5. edit /etc/xinetd.d/tftp
disable = no

6. service xinetd restart

http://www.syntaxtechnology.com/2010/06/setting-up-a-pxe-boot-server-on-centos-5-5/
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch16_:_Telnet,_TFTP,_and_xinetd

2011年2月24日 星期四

eth0連線Internet, eth1連線內部網路

1. install DHCP
yum install dhcp

2. edit /etc/dhcpd.conf
option domain-name-servers x.x.x.x, x.x.x.x #domain name server of ISP
option routers x.x.x.x #ip address of this dhcp server

3.設定iptables (注意:會把iptables設定改掉)
iptables-save > iptables_original
iptables -F (清除規則)
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
service iptables save

4. edit /etc/sysctl.conf
net.ipv4.ip_forward = 1
apply /etc/sysctl.conf
# sysctl -p /etc/sysctl.conf

4. restart dhcpd service
#service dhcpd restart

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-fw.html#s1-firewall-ipt-fwd

autofs自動mount nfs

1. 編輯 /etc/auto.misc
2. 加上
nfs -fstype=nfs 10.3.23.111:/root/Desktop/XXX

3. service autofs restart

4. 進入資料夾 (要進入資料夾才會真的mount)
/misc/nfs

參考資料:
http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-nfs-client-config-autofs.html
http://www.centos.org/docs/4/4.5/System_Administration_Guide/Mounting_NFS_File_Systems-Mounting_NFS_File_Systems_using_autofs.html
http://blog.lefthander.tw/2010/03/blog-post.html

2011年2月22日 星期二

安裝DHCP Server

1. 安裝dhcpd
yum dhcp install

2. 更改設定檔 /etc/dhcpd.conf

3. 更改設定檔 /etc/sysconfig/dhcpd
DHCPDAGRS=eth0 #在哪個interface提供dhcpd service

CentOS /etc/sysconfig/network-script/ifcfg-ethx

PERSISTENT_DHCLIENT=yes|no
預設no, 若yes會一直發DHCPDESCOVER (dhclient無-1參數)
但是若在interface initail時網路線沒接, 也不會執行dhclient

DHCPRELEASE=yes|no
預設no, 若yes則當interface down時會發DHCPRELEASE給DHCP server