SSH Secure Shell的web方面的使用
Posted on 2010-10-20 16:14 幻海藍(lán)夢 閱讀(896) 評論(0) 編輯 收藏 所屬分類: Linux 、版本管理1.通常情況下開發(fā)的web系統(tǒng)在apache + tomcat Linux環(huán)境中測試,使用客戶端操作工具:SSH Secure Shell
首先是安裝:SSHSecureShellClient-3.2.9.exe
安裝完成后,打開Secure Shell Client -> Quick Connect
Host Name: 192.168.0.23
User Name: root
Port 22
Authentication <Profile Settings> 默認(rèn)值
Connect -> Enter your Password -> OK
命令行界面定位到:[root@localhost root]#
同理打開:Secure File Transfer Client,用于文件傳輸。
2.目錄結(jié)構(gòu)(圖形界面)
- /
- ...
- usr
- apache2
- ...
- conf
- ...
- httpd.conf
- bin
- ...
- apachectl
- tomcat5
- ...
- conf
- ...
- server.xml
- bin
- ...
- shutdown.sh
- startup.sh
- webapps
- ...
- eWebEditor
3.命令界面
cd /usr/tomcat5/bin 轉(zhuǎn)入到tomcat5 bin文件夾
./shutdown.sh 關(guān)閉tomcat服務(wù)
./startup.sh 啟動tomcat服務(wù)
cd /usr/apache2/bin 轉(zhuǎn)入到apache2 bin文件夾
./apachectl start|stop|restart|graceful 啟動|關(guān)閉|重啟|優(yōu)化apache服務(wù)
ls 查看目錄文件命令
move 文件夾 .. 移動文件夾到上一目錄
rm -rf eWebEditor/ 刪除文件夾eWebEditor
ps -ef|grep java 查看tomcat啟動進(jìn)程信息,進(jìn)程ID
kill -9 進(jìn)程ID 強(qiáng)制關(guān)閉tomcat服務(wù)進(jìn)程
緩存清理
/usr/tomcat5/work/Catalina/eWebEditor 直接刪掉eWebEditor文件夾清理緩存
4.配置文件
1./usr/tomcat5/conf 修改server.xml
增加一個(gè)Host節(jié)點(diǎn) 如下:
- <Host name="eWebEditor.7234.com.cn"
- debug="0"
- appBase=""
- unpackWARs="true"
- autoDeploy="true">
- <Context path=""
- docBase="/usr/webapps/eWebEditor/"
- debug="0"
- privileged="true"
- reloadable="true"/>
- </Host>
2./usr/apache2/conf 修改httpd.conf
增加一個(gè)VirtualHost節(jié)點(diǎn) 如下:
- <VirtualHost *>
- <LocationMatch "/WEB-INF/">
- AllowOverride None
- deny from all
- </LocationMatch>
- <LocationMatch "/META-INF/">
- AllowOverride None
- deny from all
- </LocationMatch>
- RewriteEngine on
- RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
- Rewriterule .* - [F]
- ServerAdmin aaa@7234.com
- DocumentRoot /usr/webapps/eWebEditor/
- ServerName eWebEditor.7234.com.cn
- ErrorLog logs/eWebEditor.7234.com.cn-error_log
- CustomLog "|/usr/local/sbin/cronolog /usr/logs/apache_logs/eWebEditor.7234.com.cn_access_log.%Y%m%d" combined
- </VirtualHost>
5.本地hosts配置:C:\WINDOWS\system32\drivers\etc\hosts
192.168.0.23 eWebEditor.7234.com.cn
6.拼是否成功:開始->運(yùn)行->cmd
ping eWebEditor.7234.com.cn
#查看域名對應(yīng)的IP地址:是內(nèi)網(wǎng)還是外網(wǎng)的方法或是否連接成功。
7.最后在瀏覽器中輸入:http://ewebeditor.7234.com.cn/ 請求頁面,查看頁面顯示效果。
備注:eWebEditor或eWebEditor.7234.com.cn或紅色字體部分為變量,在實(shí)際使用過程中修改過來,本文以eWebEditor工程為例。
原文:http://simpledev.javaeye.com/blog/353642