Hunter的大杂烩 技术学习笔记

2013-05-26

OpenSSH公钥授权方式

Filed under: 技术话题 — hunter @ 12:35 pm

from:http://hi.baidu.com/wuxicn/item/9a77ed2064111b8e6e2cc385

用公钥授权(Public key Authentication)的方式可以实现ssh服务器与本机之间的配对,实现不用输入密码联入SSH服务器。

具体做法:

1) 在本机(ssh客户机)生成密钥文件:client$ cd ~/.ssh
client$ ssh-keygen -q -f id_rsa -t rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:在提示输入密码阶段时(Enter passphrase…),直接Enter,这样以后在本机就不用输入密码了。
这样,在.ssh/目录下就会生产2个文件:id_rsa 和 id_rsa.pub .
注意:保密好这两个文件!

2) 分发公钥文件:将你的公钥文件 (id_rsa.pub) 分发到你的SSH服务器上:

# Step 1: 将你的id_rsa.pub文件上传到服务器上
client$ scp ~/.ssh/id_rsa.pub user@your.ssh.server:~/.ssh/

# Step 2: 在服务器上安装公钥文件
server$ chmod 700 ~/.ssh
server$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/.ssh/id_rsa.pub注意:这个地方要用>>追加到authorized_keys文件末尾,以免冲到以前的一些公钥授权。

好了,现在大功告成了,enjoy!
PS: 以上方法只保证在OpenSSH服务器上有效,其他SSH服务器不知道。

2013-04-11

用mod_proxy_ajp来整合apache和tomcat服务

Filed under: 技术话题 — hunter @ 6:22 pm

http://blog.chinaunix.net/uid-10900999-id-2920778.html

pache在2.0以上版本已经支持了mod_proxy的模板支持,使tomcat和apache的整合可以不用通过配置复杂的mod_jk来实现,
httpd -M查看,当前版本是否支持mod_proxy,mod_proxy_ajp,如果没有,可以通过
/usr/local/apache/bin/apxs -i -a -c mod_proxy.c proxy_util.c
/usr/local/apache/bin/apxs -i -a -c mod_proxy_ajp.c ajp*.c
(mod_proxy,mod_proxy_ajp)方法来增加模块


ServerAdmin test@test.com
DocumentRoot /usr/local/$path
ServerName localhost
ServerAlias servername(网站域名)
ProxyPass / ajp://127.0.0.1:8004/
ProxyPassReverse / ajp://127.0.0.1:8004/
ErrorLog logs/tomcatD.gdstcmd-error_log
CustomLog logs/tomcatD.gdstcmd-access_log common

2013-04-08

安装subversion

Filed under: 技术话题 — hunter @ 3:19 pm

1. 安装neon
XML2_CONFIG=”/usr/local/libxml2/bin/xml2-config” ./configure –with-libxml2
2. subversion 配置参数
./configure –enable-static –prefix=/usr/local/svn –enable-static –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr –with-sqlite=/usr/local/sqlite –with-zlib=/usr/local/zlib125 –with-neon

运行时会出现 ./svn: /lib64/libz.so.1: no version information available (required by /usr/local/svn/lib/libsvn_delta-1.so.0)
这是因为 zlib125的版本跟系统自带zlib冲突,可以在运行 svn前面加上 LD_LIBRARY_PATH,如
LD_LIBRARY_PATH=/usr/local/zlib125/lib ./svn –help

极端点可以把zlib125下的.so拷贝到/lib64下面 (前提是要确保.so是64bit的,且对未来其他软件出现冲突有心理准备)

2012-11-23

ganglia编译(草稿)

Filed under: 技术话题 — hunter @ 7:18 pm

干了两天终于把 ganglia以及依赖项(主要是rrdtool)搞定,先放一个草稿,下周再整理

主要收获是 学会用PKG_CONFIG_PATH环境变量来处理非标准路径程序包,以前都是直接修改Makefile或者源文件,比较低级 ^_^

wget http://downloads.sourceforge.net/project/pnp4nagios/PNP/pnp-0.4.14/pnp-0.4.14.tar.gz?r=http%3A%2F%2Fdocs.pnp4nagios.org%2Fpnp-0.4%2Fdwnld&ts=1339554075&use_mirror=nchc
tar zxvf pnp-0.4.14.tar.gz
cd pnp-0.4.14/
./configure

(more…)

2012-11-22

squid3编译参数

Filed under: 技术话题 — hunter @ 8:18 pm

–enable-delay-pools  –enable-linux-netfilter –enable-linux-tproxy  –disable-ident-lookups  –with-pthreads

其中tpproxy需要 libpcap支持

//2013-11-24
编译 squid 3.3
./configure –prefix=/usr/local/squid –enable-icmp –enable-delay-pools –enable-gnuregex –enable-linux-netfilter –disable-ident-lookups –disable-translation –disable-auto-locale –with-large-files –with-filedescriptors=65536 –enable-kill-parent-hack –with-swapdir=/data/squid –with-aufs-threads=40 –enable-dlmalloc –enable-cache-digests –disable-strict-error-checking

–disable-strict-error-checking 用于解决auto_ptr 过期的问题:
Inquirer.cc:90: error: ‘auto_ptr’ is deprecated (declared at /usr/include/c++/4.3/backward/auto_ptr.h:91)

« Newer PostsOlder Posts »

Powered by WordPress