查看TCP类型的端口
netstat -ntpl
查看UDP类型的端口
netstat -nupl
升级openssl到最新版本
昨晚在安装freeradius 3.0 的时候提示以下错误
1 | “Security advisory CVE-2014-0160 (Heartbleed)”. FreeRadius 3.0.3 would not allow to start radius server if you have openssl version in range 1.0.1 – 1.0.1f installed. |
原因是openssl漏洞,需要升级openssl。首先检查openssl的版本
1 2 3 4 5 6 7 8 | [root@Pandora ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Wed Aug 13 19:13:02 UTC 2014 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/etc/pki/tls" engines: rdrand dynamic |
测试freeradius 2.x和freeradius 3.x连接出现错误
今天在安装freeradius 2.x和freeradius 3.x,测试连接都无法通过,错误如下
freeradius 2.x 提示的错误
1 2 | radclient:: Failed to find IP address for Excalibur radclient: Nothing to send. |
freeradius 3.x 提示的错误
1 | (0) Error parsing "-": ip_hton: Name or service not known |
解决方法很简单给/etc/hosts添加主机名解析就可以
(more…)
增加 Xen 虚拟硬盘的大小
stacklet提供的镜像太小了,只有10G,所以还要手动增加啊。
给镜像增加40G
1 2 3 4 | dd if=/dev/zero of=imcat.centos.img bs=1G conv=notrunc count=1 seek=40 1+0 records in 1+0 records out 1073741824 bytes (1.1 GB) copied, 51.9901 s, 20.7 MB/s |
Linux下的NAT配置
由于xen主机的IP不多,为了不浪费IP,虚拟一台测试机决定用NAT模式来共享网络。要求做到以下两点:
1.通过连接xen主机直接连接到测试机,这里需要到端口转发
2.测试机能通过xen主机上网,即能连接外网,这里就需要用NAT模式共享网络
首先,xen主机能正常连接外网,我的/etc/sysconfig/network-scripts/ifcfg-eth0 配置如下:
1 2 3 4 5 6 | DEVICE=eth0 BOOTPROTO=static IPADDR=外网IP NETMASK=255.255.255.0 ONBOOT=yes GATEWAY=网关 |
额外添加一个网卡设备,用来和测试机通信的。
(more…)
Apache 2.4.X 后端获取用户真实IP地址
如果你的后端是Apache 2.4.X,那么在编译mod_rpaf-0.6时,一定会出现下面这个错误的。
1 2 3 4 5 6 7 8 9 10 11 12 | mod_rpaf-2.0.c: In function 'rpaf_cleanup': mod_rpaf-2.0.c:150: error: 'conn_rec' has no member named 'remote_ip' mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_addr' mod_rpaf-2.0.c:151: warning: implicit declaration of function 'inet_addr' mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_ip' mod_rpaf-2.0.c: In function 'change_remote_ip': mod_rpaf-2.0.c:164: error: 'conn_rec' has no member named 'remote_ip' mod_rpaf-2.0.c:183: error: 'conn_rec' has no member named 'remote_ip' mod_rpaf-2.0.c:186: error: 'conn_rec' has no member named 'remote_ip' mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_addr' mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_ip' apxs:Error: Command failed with rc=65536 |