标签 ‘Linux’ 归档文章

解决 CentOS / Redhat /boot 文件系统满,清除旧的内核文件

yum install yum-utils

检查还安装着的所有的内核包:
rpm -q kernel

只保留最后两个:
package-cleanup --oldkernels --count=2

修改 /etc/yum.conf ,设置:
installonly_limit=2

				

为 AWS 上的 RHEL 7 添加 php-mbstring 模块

主机从 Godaddy 的虚拟主机,迁移到 AWS 的 EC2 虚拟机,使用 Free Tier 的 RHEL7 Image。 似乎 FreeTier 没有 CentOS 选项。只好选了我不喜欢的 7 版本。 在测试完邮件系统,无误后,把 Freelamp.com 的 DNS 切换到了 AWS 上。

 

登录后台添加文章一看,缺少 php-mbstring 模块。 直接 yum install php-mbstring 没有这个模块。

原来是要先 enable optional yum repo.

先查看一下有那些可用,可以 Enable 的 Repo:

# yum repolist all

然后 Enable 这个 Optional Repo:

# yum-config-manager –enable rhui-REGION-rhel-server-optional

然后就可以安装这个 php-mbstring 包:

# yum install php-mbstring

重启 Apache:

# service httpd restart

Server Migrated to GoDaddy

Bought a 7 USD per month hosting plan from GoDaddy, annual cost only 84 USD, compare with the local Chinese vendor charged me 4500 RMB, huge difference!

The migration is very easy. Just install the WordPress application on godaddy, then import the DBs on the old server, then copy the themes/plugins, That’s all.

The original latest LAMP software version RSS, need to fix though.   🙂

关于 remote message logging

Unix/Linux 操作系统的远程日志写入无非是定义 loghost ,然后 enable remote message logging。

在 Solaris 10 要检查 /lib/svc/method/system-log 文件,确保没有特别的参数传送给 /usr/sbin/syslogd。

可以强制加 -T 参数实现远程 UDP 日志写入,针对局域网内的交换机之类的设备把日志写入 Unix 主机,然后用脚本检查日志文件来达到监控交换机等设备的目的。在 Brocade 光纤交换机上可以用 syslogdipshow/syslogdipadd/syslogdipremove 来修改日志服务器的 IP 地址。

RFC5424 是一个很有意思的读物。

怎样让 Windows 跑得比 Linux 快?

看到这个标题我就知道一定是一篇逗乐的,打开一看,果然。

还蛮有道理的。? LOL

(更多…)

ZT: Ethernet Bonding (Linux)

Ethernet Bonding (Linux)

Bonding ethernet channels in Linux is easy. With the right configuration and hardware, it can be done in minutes.

In this example, I have a 4 port intel Gigabit card and I wanted to utilize this and my Network switches LACP/LAG?capability. Lets?assume?we have the Network switch part already configured to have its ports utilize LACP/LAG.
On the RHEL 4.3 server that is hosting my samba file server below are the steps outlined to configure ethernet channel bonding/teaming on the RHEL 4.3 server.
Edit the?/etc/modprobe.conf file and add the bonding kernel module and its mode.
# vi?/etc/modprobe.conf
#regular network card (built-in)
alias eth0 e1000
alias eth1 e1000
#the bond interface
alias bond0 bonding
#bond interface mode.?mode=4 (802.3ad/link aggregation)
options bond0 mode=4 miimon=100
#Intel 4 port Gigabit ethernet card
alias eth5 e1000
alias eth3 e1000
alias eth4 e1000
alias eth2 e1000
alias scsi_hostadapter ahci
alias usb-controller ehci-hcd
alias usb-controller1 uhci-hcd
Now make sure to edit the /etc/sysconfig/network-scripts/ifcfg-ethX (where X are the ethernet ports that will be part of the bond0 LACP interface)
# vi /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
TYPE=Ethernet
Now we don’t want to edit every single file as its a boring and error prone process
# for i in {3..5} ; do cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth$i ; done
#for i in {3..5} ; do sed -i “s/DEVICE=eth2/DEVICE=eth$i/g” /etc/sysconfig/network-scripts/ifcfg-eth$i ; done
Now create the bond0 interface configuration file.
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.30
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
Load the bonding kernel module.
#?modprobe bonding
Now bring up the bond0 interface
# ifup bond0
Verify the bond0 interface
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v2.6.1 (October 29, 2004)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: slow
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 1
Actor Key: 17
Partner Key: 1
Partner Mac Address: 00:00:00:00:00:00
Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:15:17:6a:c1:e4
Aggregator ID: 1
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:15:17:6a:c1:e5
Aggregator ID: 2
Slave Interface: eth4
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:15:17:6a:c1:e6
Aggregator ID: 3
Slave Interface: eth5
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:15:17:6a:c1:e7
Aggregator ID: 4
You can now try transferring files to/from the samba servers shared folders, once the transfer process is on-going, try unplugging the network cables that are part of the bond/LACP/LAG on the Network switch or on the configured 4 port Intel ethernet card.

被批驳的五点 *nix 神话

粗略的看一下作者的观点,就知道作者就如后面的点评所写,“不知所云”。

2000年学习 Linux 时的笔记

岁末年初,整理过去的岁月,“为学日益,为道日损”。

(更多…)

用 Linux 破解 Windows 管理员密码

全文转贴:

(更多…)

用 dmidecode 搜集主机信息

管理主机的序列号等其他资产信息不是一件容易的事,dmidecode 这个免费的工具完全可以搜集到大部分所需要的主机信息。

[root@freelamp dmidecode-2.10]# /usr/local/sbin/dmidecode -s ?

Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency

Reblog this post [with Zemanta]
Google+