2008年12月29日 星期一

There's something about PuTTY--pscp

(How to use scp between Windows and Linux?)

PuTTY, a powerful and useful telnet, ssh client for Windows. Besides the termial function, PuTTY also provides a couple of tools to use. Here, I'll briefly address the useage of pscp, a PuTTY version scp.

Again, this is served for my own knowledge base.

-----Begin of Environment Description-----

Windows XP as a local client.

Two Linux as remote servers.

One Linux server can use id/password to login.

Another Linux must use public key authentication to login.

-----End of Environment Description-----

Initiate a command mode.

Set the path to the PuTTY directory.

set PATH=C:\path\to\putty\directory;%PATH%

E.g: C:\tmp>set PATH=C:\Green Softwares\putty\putty-v0.60;%PATH%

So that, you can run pscp in command mode no matter which direcotry you currently in.

-----Bengin of Basic PSCP Operation-----

Linux before scp

[root@saint_linux ~]# pwd
/root
[root@saint_linux ~]# ls
anaconda-ks.cfg install.log list.txt
Desktop install.log.syslog scsrun.log
[root@saint_linux ~]#

To send a file to remote server:

Usage: pscp [options] source [source...] [user@]host:target

E.g. Send test.txt to saint_linux

C:\tmp>pscp test.txt root@saint_linux:/root
root@192.168.1.150's password: <== Enter password here
test.txt 0 kB 0.0 kB/s ETA: 00:00:00 100%

C:\tmp>

Check Linux:

[root@saint_linux ~]# ls
anaconda-ks.cfg install.log list.txt test.txt <== text.txt
Desktop install.log.syslog scsrun.log

To copy a file from the remote server:

Usage: pscp [options] [user@]host:source target

E.g. Copy list.txt from saint_linux

C:\tmp>pscp root@saint_linux:/root/list.txt c:\tmp
root@192.168.1.150's password:
list.txt 2 kB 2.2 kB/s ETA: 00:00:00 100%

Check local client:

C:\tmp>dir
磁碟區 C 中的磁碟沒有標籤。
磁碟區序號: 90BB-8087

C:\tmp 的目錄

2008/12/29 下午 06:26 <DIR> .
2008/12/29 下午 06:26 <DIR> ..
2008/12/29 下午 01:55 23,609 list-keys.txt
2008/12/29 下午 06:19 2,214 list.txt <== list.txt copied
2008/12/29 下午 12:04 8,401 pgpkeytool.txt
2008/08/22 下午 05:51 43,069,066 starcraft_II_fansite_kit.zip
2008/12/29 上午 11:20 19 test.txt
2008/12/19 上午 10:48 1,864,560 WindowsXP-KB960714-x86-CHT.exe
6 個檔案 44,967,869 位元組
2 個目錄 2,639,720,448 位元組可用

-----End of Basic PSCP Operation-----

-----Begin of PSCP with Public Key Authentication-----

First, setting up the session properly and then save it.

Set your private key to be loaded

image

Set Auto Login

image

When ready, click Save to save this session

image

To send a file to remote server:

C:\tmp>pscp test.txt PGP3:/root
test.txt 0 kB 0.0 kB/s ETA: 00:00:00 100%

To copy a file from the remote server:

C:\tmp>pscp PGP3:/root/pgpkeytool.txt c:\tmp
pgpkeytool.txt 8 kB 8.2 kB/s ETA: 00:00:00 100%

-----End of PSCP with Public Key Authentication-----

2008年12月25日 星期四

Apache: How to make an Installation-Free Apache? (Green Version Apache)

The original article is from http://blog.xuite.net/coke750101/networkprogramming/19554723

I just want to make my own knowledge base so I can read it later in case I forgot. It's mostly I'll forget. (>_<)

After you have install Apache on your system and you want o build another Apache web server on another system with the same or similar settings. Do the following step:

Copy the the Apache to your new system, better with the same path as the original system so you won't need to modify the http.conf. E.g. C:\Program Files\Apache Group\Apache2 <== This is the path of original sytem

copy the directory Apache Group from original system into new system.

In command mode:

Go to the bin directory of Apache

I.e. C:\Program Files\Apache Group\Apache2\bin>

Run Apache -k install <==This will install Apache as a service.

Then run Apache -k start <== This will start Apache web service

To stop, run Apache -k stop

To uninstall the service, run Apache -k uninstall