﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Kyle's Space-随笔分类-Environment Setup</title><link>http://www.blogjava.net/xiaodong0417/category/51479.html</link><description>Java Study</description><language>zh-cn</language><lastBuildDate>Thu, 17 Jan 2013 12:01:13 GMT</lastBuildDate><pubDate>Thu, 17 Jan 2013 12:01:13 GMT</pubDate><ttl>60</ttl><item><title>Linux 上服务的安装以及示例：Apache服务的安装（转）</title><link>http://www.blogjava.net/xiaodong0417/archive/2013/01/17/394342.html</link><dc:creator>王树东</dc:creator><author>王树东</author><pubDate>Thu, 17 Jan 2013 02:23:00 GMT</pubDate><guid>http://www.blogjava.net/xiaodong0417/archive/2013/01/17/394342.html</guid><wfw:comment>http://www.blogjava.net/xiaodong0417/comments/394342.html</wfw:comment><comments>http://www.blogjava.net/xiaodong0417/archive/2013/01/17/394342.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaodong0417/comments/commentRss/394342.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaodong0417/services/trackbacks/394342.html</trackback:ping><description><![CDATA[<div>1. chkconfig脚本格式：</div> <div>#!/bin/sh <br />#chkconfig 2345 55 45  <br />#上面为固定格式：2345 表示运行级别，55表示开机执行顺序，45为关机顺序 <br />#description：this is just a demo  of chkconfig script <br />case &#8220;$1&#8221; in <br />start)</div> <div>&lt;start-script&gt;</div> <div>;;</div> <div>Stop)</div> <div>&lt;stop-script&gt;</div> <div>;;</div> <div>Status)</div> <div>Echo &lt;the information you want to display&gt;</div> <div>;;</div> <div>*)</div> <div>Echo &#8220;the usage of the script&#8221;</div> <div>Case</div> <div>2. 然后将脚本保存,并赋予执行权限,再复制到/etc/init.d目录 <br />#chmod a+x &lt;myscript&gt;  <br />#copy &lt;myscript&gt; /etc/init.d</div> <div>3. 使用chkconfig命令添加成服务 <br />#chkconfig --add &lt;myscript&gt; <br />#chkconfig  --level 35 &lt;myscript &gt; on <br />#chkconfig --list &lt;myscript&gt;</div> <div>4. 然后就可以通过service命令管理了 <br />#service &lt;myscript&gt; start | stop |  status</div> <div>5. 下面是我写的一个实例脚本，大家可以参考一些格式：</div> <div>#!/bin/sh</div> <div>#chkconfig: 2345 99 99</div> <div>#description:the script to set the network at run level 2345</div> <div>IN=eth0</div> <div>OUT=eth1</div> <div>HOST_NAME=cluster1.yang.com</div> <div>INIP=192.168.10.10</div> <div>OUTIP=192.168.136.10</div> <div>MASK=255.255.255.0</div> <div>IP=/sbin/ip</div> <div>IFC=/sbin/ifconfig</div> <div>ROUTE=/sbin/route</div> <div>#flush the address</div> <div>case "$1" in</div> <div>start)</div> <div>#echo "flush the address..."</div> <div>#$IP addr flush dev eth0</div> <div>#$IP addr flush dev eth1</div> <div>echo "set the address..."</div> <div>$IFC $IN $INIP netmask $MASK up</div> <div>$IFC $OUT $OUTIP netmask $MASK up</div> <div>echo "set the hostname..."</div> <div>hostname $HOST_NAME</div> <div>echo "set the default gateway..."</div> <div>$IP route flush all</div> <div>$ROUTE add default gw 192.168.136.2</div> <div>echo "finshed!!!"</div> <div>;;</div> <div>stop)</div> <div>echo "flush the network setting..."</div> <div>$IP addr flush dev eth0</div> <div>$IP addr flush dev eth1</div> <div>echo "flush finshed!!!"</div> <div>;;</div> <div>status)</div> <div>echo "hostname is $HOST_NAME"</div> <div>$IFC eth0</div> <div>$IFC eth1</div> <div>;;</div> <div>*)</div> <div>echo "requires start,stop or status"</div> <div>;;</div> <div>esac</div> <div>--------------------------------------------------------------------------------------------</div> <div>--------------------------------------------------------------------------------------------</div> <div> <p>在Linux中chkconfighttpd任务添加，Apache服务器的最新稳定发布版本是httpd-2.2..0,官方下载地址是：http://httpd.apache.org/download.cgi。我们通过下面的步骤来快速的搭建一个web服务器。</p> <p>1、下载源码文件httpd-2.2.0.tar.gz 到linux服务器的某个目录。<br />2、解压文件 # tar zxvf  httpd-2.2.0.tar.gz .<br />3、配置 # ./configure &#8211;refix=/usr/local/apache  //指定安装目录，以后要删除安装就只需删除这个目录。<br />4、编译和安装。 # make ; make install  .<br />5、编写启动脚本，把它放到目录 /etc/rc.d/init.d/里，这里取名为httpd,其内容如下：<br />&nbsp;</p><pre><ol><li>#!/bin/bash &nbsp;</li><li>#description:http&nbsp;server &nbsp;</li><li>#chkconfig:&nbsp;235&nbsp;98&nbsp;98 &nbsp;</li><li>case&nbsp;"$1"&nbsp;in &nbsp;</li><li>start) &nbsp;</li><li>echo&nbsp;"Starting&nbsp;Apache&nbsp;daemon..." &nbsp;</li><li>/usr/local/apache2/bin/apachectl&nbsp;-k&nbsp;start &nbsp;</li><li>;; &nbsp;</li><li>stop) &nbsp;</li><li>echo&nbsp;"Stopping&nbsp;Apache&nbsp;daemon..." &nbsp;</li><li>/usr/local/apache2/bin/apachectl&nbsp;-k&nbsp;stop &nbsp;</li><li>;; &nbsp;</li><li>restart) &nbsp;</li><li>echo&nbsp;"Restarting&nbsp;Apache&nbsp;daemon..." &nbsp;</li><li>/usr/local/apache2/bin/apachectl&nbsp;-k&nbsp;restart &nbsp;</li><li>;; &nbsp;</li><li>status) &nbsp;</li><li>statusproc&nbsp;/usr/local/apache2/bin/httpd &nbsp;</li><li>;; &nbsp;</li><li>*) &nbsp;</li><li>echo&nbsp;"Usage:&nbsp;$0&nbsp;{start|stop|restart|status}" &nbsp;</li><li>exit&nbsp;1 &nbsp;</li><li>;; &nbsp;</li><li>Esac &nbsp;</li></ol></pre> <p>&nbsp;</p> <p><strong>注意：#description:http server  这一行必须加上</strong>，否则在执行命令</p> <p>&nbsp;# chkconfig &#8211;add httpd </p> <p>时会出现&#8220;service apache does not support chkconfig&#8221;的错误报告。</p> <p>#chkconfig: 2345 98 98 表示在执行命令</p> <p>&nbsp;# chkconfig &#8211;add httpd 时会在目录 /etc/rc2.d/ 、/etc/rc3.d/ /etc/rc5.d 分别生成文件  S98httpd和 K98httpd。这个数字可以是别的。</p> <p>6、执行命令 # chkconfig &#8211;add httpd ，进入目录/etc/rc3.d/检查是否生成文件  S98httpd及K98httpd.<br />7、启动服务 # service httpd start .</p></div><img src ="http://www.blogjava.net/xiaodong0417/aggbug/394342.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaodong0417/" target="_blank">王树东</a> 2013-01-17 10:23 <a href="http://www.blogjava.net/xiaodong0417/archive/2013/01/17/394342.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Groovy Eclipse 插件安装失败</title><link>http://www.blogjava.net/xiaodong0417/archive/2011/11/20/364373.html</link><dc:creator>王树东</dc:creator><author>王树东</author><pubDate>Sun, 20 Nov 2011 13:33:00 GMT</pubDate><guid>http://www.blogjava.net/xiaodong0417/archive/2011/11/20/364373.html</guid><wfw:comment>http://www.blogjava.net/xiaodong0417/comments/364373.html</wfw:comment><comments>http://www.blogjava.net/xiaodong0417/archive/2011/11/20/364373.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaodong0417/comments/commentRss/364373.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaodong0417/services/trackbacks/364373.html</trackback:ping><description><![CDATA[@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
最近不知道Groovy在搞什么鬼， Eclipse在线插件的安装总是有问题。<br />
然后只能在网上找到插件的压缩包，下载后再安装就好了。步骤如下：<br />
1.&nbsp;&nbsp;&nbsp;&nbsp;下载groovy 插件的安装包，链接：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For Eclipse 3.7: <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://dist.springsource.org/release/GRECLIPSE/e3.7/archive-2.5.1.xx-20110628-1600-e37.zip" target="_blank"><font color="#006699">http://dist.springsource.org/release/GRECLIPSE/e3.7/archive-2.5.1.xx-20110628-1600-e37.zip</font></a>&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For Eclipse 3.6:&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://dist.springsource.org/release/GRECLIPSE/e3.6/archive-2.5.1.xx-20110627-1300-e36.zip" target="_blank"><font color="#006699">http://dist.springsource.org/release/GRECLIPSE/e3.6/archive-2.5.1.xx-20110627-1300-e36.zip</font></a> <br />
<br />
2.&nbsp;&nbsp;&nbsp;&nbsp;进入eclipse安装插件的页面，点击Add 添加新的插件，在弹出的对话框中选择Archieve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;然后选择下载的压缩文件，安装就可以了。<img src ="http://www.blogjava.net/xiaodong0417/aggbug/364373.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaodong0417/" target="_blank">王树东</a> 2011-11-20 21:33 <a href="http://www.blogjava.net/xiaodong0417/archive/2011/11/20/364373.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>