存档

‘server & system’ 分类的存档

Cygwin下使用公钥登录SSH

2009年12月2日 Killman 没有评论

为了直接使用公钥登录SSH,而不使用密码登录Cygwin,费了老大劲,很长时间以来一直没有成功。此前,一直是按照网络上流传的方法,主要是生成key,然后设置到 authorized_keys中。遵照官方的命令,修改sshd_config, ssh_config, 但是一直没有奏效(不过遵照这些方法,在Ubuntu等系统上配置成功)。

昨天偶然在这个页面上看到 ssh-user-config 命令,试了试,就成功了!各位设置不成功的同学,考虑使用下这个命令,然后一路回车确认即可。

另一篇重要的参考文章:这里

顺便记录下在探索 SSH使用公钥登录过程中学到的几个sshd相关的命令:

# debug more information 
ssh  -vvv  localhost
 
#start services
net start sshd
#or
cygrunsrv  --start  sshd
 
#login command for user name that has space
ssh  Mickey\  mouse@127.0.0.1
 
#copy publickey to remote host
king@king:~$ cat .ssh/id_dsa.pub | ssh master "cat - >> ~/.ssh/authorized_keys"
#copy publickey from remote host
king@king:~$  ssh master "cat .ssh/id_dsa.pub" | cat - >> ~/.ssh/authorized_keys"

在某些情况下,必须使用代理登录SSH服务器。connect.c is the simple relaying command to make network connection via SOCKS and https proxy. It is mainly intended to be used as proxy command of OpenSSH. You can make SSH session beyond the firewall with this command.

在Windows下,只需要下载connect.exe到c:/windows,然后在 ~/.ssh/config中添加如下配置:

ProxyCommand connect -S x.x.x.x:x %h %p

connect.c 还支持 https 代理,真不赖。

分类: server & system 标签:

Weblogic 81Sp3

2009年5月14日 Killman 没有评论

Weblogic 81Sp3 发布时遇到如下错误:

<2009-5-14 下午05时2920秒 CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating Deploy task for application receive.>
<2009-5-14 下午05时2920秒 CST> <Error> <Deployer> <BEA-149201> <Failed to complete the deployment task with ID 0 for the application receive.
weblogic.management.ApplicationException:
Exception:weblogic.management.ApplicationException: prepare failed for receive
Module: receive Error: Could not load receive: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2398)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2310)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.management.ManagementException:  - with nested exception:
[weblogic.management.ApplicationException:
Exception:weblogic.management.ApplicationException: prepare failed for receive
Module: receive Error: Could not load receive: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
]
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2327)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

错误原因是Spring 2.5.5 与Weblogic 81之间不兼容造成的。
详细看这里

Doc: Deployment error on Weblogic 8.1 SP1/SP2 due to manifest issues – upgrade to SP6 required

分类: server & system 标签:

在 Vista 上安装 Apache 2.2, PHP 5.2.6

2008年10月12日 Killman 没有评论

今天,在Vista上安装了 Apache 2.2, PHP 5.2.6,花费了三四个小时。 Apache 和 PHP 的新版本,在相互兼容性方面似乎是越来越差了!

Apache 2.2  下载完后安装,倒是很顺利,最后 http://localhost, 显示 It works.

一开始,打算以 Module 形式安装 PHP,安装后显示 缺少不少库,并且不能显示 phpinfo.php。

于是改成以 CGI 形式重新安装,配置如下:
ScriptAlias /php/ "D:/software/PHP/"
AddType application/x-httpd-php .php
# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"

打开网址,什么也访问不了:
You don’t have permission to access / on this server.
通过如下设置解决:
DocumentRoot “D:/programdata/Apachehtdocs”

Options FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
Satisfy all

然后就一直显示:
You don’t have permission to access /php/php-cgi.exe/phpinfo.php on this server.
在后台 error.log:
[error] [client 127.0.0.1] client denied by server configuration: D:/software/PHP/php-cgi.exe

最后,增加如下设置,解决了问题:

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

解决了问题。但是,后台又出现了一个问题:
[Sun Oct 12 22:36:57 2008] [error] [client 127.0.0.1] PHP Fatal error: require_once() [function.require]: Failed opening required ‘SAM/php_sam.php’ (include_path=’.;C:\\php5\\pear’) in sam_factory on line 1

这个问题的解决,参考 [RESOLVED] PHP Install Problem – SAM Error   我只是简单地安装PHP时,只选择 MySQL扩展。

Ubuntu 上安装buildix,PHP5, Apache2

2008年10月12日 Killman 没有评论

一开始,我在计算机上安装了buildix,发现 Buildix的各项功能也能正确运行。但是,一旦我安装并启用了 php5和mod-php5,就会导致buildix被卸载。如下:

liuzhr@suowan-master:/etc/apache2/sites-enabled$ sudo apt-get install php5 libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5 is already the newest version.
The following packages were automatically installed and are no longer required:
python-libxslt1 libapache2-svn libapache2-mod-python sun-java5-jdk python-libxml2 python-svn libapache2-mod-fastcgi cruisecontrol sun-java5-demo
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
apache2-mpm-prefork
The following packages will be REMOVED:
apache2-mpm-worker buildix
The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php5
0 upgraded, 2 newly installed, 2 to remove and 60 not upgraded.
Need to get 0B/2978kB of archives.
After unpacking 5747kB of additional disk space will be used.
Do you want to continue [Y/n]?

如果选择继续,安装了php5和libapache2-mod-php5,则会导致buildix卸载,如果重新安装 buildix,安装过程中会出现下面的错误,原因大概是libapache-mod-php5被buildix自动卸载了。

liuzhr@suowan-master:/etc/apache2/sites-enabled$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2
* We failed to correctly shutdown apache, so we're now killing all running apache processes. This is almost certainly suboptimal, so please make sure your system is working as you'd expect now!
apache2: Syntax error on line 183 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory。

原因应该是 buildix 依赖于  apache2-mpm-worker, 而目前的 php5只能运行单线程的apache2,这样就必须使用  apache2-mpm-prefork。
使用  apt-cache show buildix 一看,果然buildix依赖于 apache2-mpm-worker。看来必须放弃将 buildix与目前的 php5(Module方式) 在一起安装的方法。

于是只能选择使用 cgi 的方式来安装。参考这篇文章:Installing Apache2 and PHP5 using mod_fcgid 。配置的过程中发生了一些错误(you don’t have permission to access ‘/index.php’),似乎是因为下面的配置中,AllowOverride ,FCGIWrapper ,AddHandler 或者 Options +ExecCGI 的顺序导致的。没有时间仔细研究这个问题,高手看到请指教。

<directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
FCGIWrapper /usr/lib/cgi-bin/php5 .php
AddHandler fcgid-script .php
Options +ExecCGI
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</directory>

php5 目前不能使用 apache2-mpm-worker 模块是因为不支持多线程的apache2。 PHP如此说:Why shouldn’t I use Apache2 with a threaded MPM in a production environment? 

有关 apt-get 的命令,参考这里:https://help.ubuntu.com/community/AptGet/Howto

有关 Ubuntu上的LAMP,参考:ApacheMySQLPHP

分类: server & system 标签: , ,