<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LinuxByte &#187; Centos</title>
	<atom:link href="http://www.linuxbyte.org/tag/centos/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxbyte.org</link>
	<description>一个Linux Blog</description>
	<lastBuildDate>Thu, 26 Jan 2012 08:13:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>centos5 下配置 DHCP 服务器</title>
		<link>http://www.linuxbyte.org/centos5-peizh-dhcp.html</link>
		<comments>http://www.linuxbyte.org/centos5-peizh-dhcp.html#comments</comments>
		<pubDate>Wed, 11 Feb 2009 11:55:51 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[dhcp]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/?p=379</guid>
		<description><![CDATA[DHCP 作为常用的网络服务，Linux 下的支持一向很好，安装和配置都非常简单。 1. 安装DHCP 服务端 # yum install dhcp 如你所见安装非常的简单，一条命令就搞定。当然如果你是极度最求性能的用户，... ]]></description>
			<content:encoded><![CDATA[<p>DHCP 作为常用的网络服务，Linux 下的支持一向很好，安装和配置都非常简单。</p>
<p>1. 安装DHCP 服务端</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install dhcp</span></pre></div></div>

<p>如你所见安装非常的简单，一条命令就搞定。当然如果你是极度最求性能的用户，当然可以自己编译，加上你的编译参数，编译去吧这个我可不介绍。<br />
<span id="more-379"></span><br />
2.配置DHCP 服务<br />
DHCP 默认配置文件是/etc/dhcpd.conf,默认是空的你可以在/usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample 找到一个简单的范本。下面是我的dhcpd.conf</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">ddns-update-style none;<span style="color: #666666; font-style: italic;">#DNS更新方法？说实话这个参数不理解其含义。</span>
subnet 192.168.0.0 netmask 255.255.255.0 <span style="color: #7a0874; font-weight: bold;">&#123;</span>
option routers 192.168.0.254;<span style="color: #666666; font-style: italic;">#网关</span>
option subnet-mask 255.255.255.0;<span style="color: #666666; font-style: italic;">#子网掩码</span>
option domain-name <span style="color: #ff0000;">&quot;linuxbyte.org&quot;</span>;<span style="color: #666666; font-style: italic;">#域名</span>
option domain-name-servers 192.168.0.254,202.101.172.47;<span style="color: #666666; font-style: italic;">#域名服务器地址</span>
range 192.168.0.1 192.168.0.254;<span style="color: #666666; font-style: italic;">#提供的IP 地址段</span>
default-lease-time <span style="color: #000000;">21600</span>;<span style="color: #666666; font-style: italic;">#最小租期（单位秒）</span>
max-lease-time <span style="color: #000000;">43200</span>;<span style="color: #666666; font-style: italic;">#最大租期</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;">#为特定机器保留的IP</span>
host game  <span style="color: #7a0874; font-weight: bold;">&#123;</span>
   hardware ethernet 00:1D:<span style="color: #000000;">60</span>:<span style="color: #000000;">95</span>:9E:A5;
   fixed-address 192.168.0.234;
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>

<p>编辑 /etc/sysconfig/dhcpd</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Command line options here</span>
<span style="color: #007800;">DHCPDARGS</span>=eth0</pre></div></div>

<p>因为服务器上有多张网卡所以要指定一下监听设备为eth0。</p>
<h2  class="related_post_title">与本文关系暧昧的文字</h2><ul class="related_post"><li><a href="http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk.html" title="Centos5+Apache2.2.6+PHP5+tomcat6.0.14+jdk1.6整合安装 ">Centos5+Apache2.2.6+PHP5+tomcat6.0.14+jdk1.6整合安装 </a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2009<br />
Source: <a href="http://www.linuxbyte.org/centos5-peizh-dhcp.html">centos5 下配置 DHCP 服务器</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/centos" rel="tag">Centos</a>, <a href="http://www.linuxbyte.org/tag/dhcp" rel="tag">dhcp</a><br/>
</small></p>
	<p style="margin:3px 0 0 0;">标签：<a href="http://www.linuxbyte.org/tag/centos" title="Centos" rel="tag">Centos</a>, <a href="http://www.linuxbyte.org/tag/dhcp" title="dhcp" rel="tag">dhcp</a></p>

<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/centos5-peizh-dhcp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centos5+Apache2.2.6+PHP5+tomcat6.0.14+jdk1.6整合安装</title>
		<link>http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk.html</link>
		<comments>http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk.html#comments</comments>
		<pubDate>Sat, 08 Mar 2008 04:34:06 +0000</pubDate>
		<dc:creator>xiao H</dc:creator>
				<category><![CDATA[服务器应用]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk</guid>
		<description><![CDATA[ 安装步骤: jdk-6u3-linux-i586.bin #chmod u+x jdk-6u3-linux-i586.bin #./jdk-6u3-linux-i586.bin ln -s /usr/local/jdk1.6.0_03 /usr/local/jdk ln -s /usr/local/jdk1.6.0_03 /jre /usr/local/jre #vi /etc/profile 加入以下几行 export JAVA_HOME=/usr/loca... ]]></description>
			<content:encoded><![CDATA[<p> 安装步骤:<br />
jdk-6u3-linux-i586.bin</p>
<p>#chmod u+x jdk-6u3-linux-i586.bin<br />
#./jdk-6u3-linux-i586.bin<br />
<span id="more-69"></span><br />
ln -s /usr/local/jdk1.6.0_03 /usr/local/jdk<br />
ln -s /usr/local/jdk1.6.0_03 /jre /usr/local/jre<br />
#vi /etc/profile<br />
加入以下几行<br />
export JAVA_HOME=/usr/local/jdk<br />
export CLASSPATH=$JAVA_HOME/lib<br />
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH<br />
export CATALINA_HOME=/usr/local/tomcat<br />
保存退出。<br />
#source /etc/profile<br />
java –version 查看jdk是否安装成功<br />
httpd-2.2.6.tar.gz<br />
#cp httpd-2.2.6.tar.gz /usr/local<br />
#cd /usr/local<br />
#tar zxvf httpd-2.2.6.tar.gz<br />
#cd httpd-2.2.6<br />
#./configure –prefix=/usr/local/apache &#8211;enable-module=so<br />
#make<br />
#make install<br />
启动Apache，并测试。<br />
# cd /usr/local/apache/bin<br />
# ./apachectl start<br />
打开浏览器，并在地址栏中输入主机的IP地址<br />
apache-tomcat-6.0.14.tar.gz<br />
#tar zxvf apache-tomcat-6.0.14.tar.gz<br />
#cp –r apache-tomcat-6.0.14 /usr/local/tomcat<br />
#/usr/local/tomcat/bin/startup.sh<br />
打开<br />
<a target="_blank" href="http://localhost:8080/"><font color="#0000ff">http://localhost:8080</font></a><br />
验证tomcat可以启动<br />
整和apache和tomcat<br />
tomcat-connectors-1.2.25-src.tar.gz<br />
#tar zxvf tomcat-connectors-1.2.25-src.tar.gz<br />
进行编译配置。大家一定要注意这几个参数中前三个是很重要的，必要时可以去相应的目录看看相关的文件是否存在。<br />
#cd tomcat-connectors-1.2.25-src/native<br />
# ./ buildconf.sh<br />
#./configure &#8211;with-apxs=/usr/local/apache/bin/apxs  &#8211;with-tomcat=/usr/local/tomcat &#8211;with-java-home=/usr/java/jdk &#8211;with-jni<br />
# make<br />
# make install<br />
#ll /usr/local/apache/modules/mod_jk.so<br />
-rwxr-xr-x  1 root root 487769  8月 14 20:40 /usr/local/apache/modules/mod_jk.so<br />
mod_jk.so生成成功了。<br />
编辑apache的配置文件：<br />
#vi /usr/local/apache/conf/httpd.conf<br />
在末尾添加以下几行<br />
# Load mod_jk module<br />
  LoadModule jk_module modules/mod_jk.so<br />
# Where to find workers.properties<br />
  JkWorkersFile     /usr/local/apache/conf/workers.properties<br />
# Where to put jk logs<br />
  JkLogFile     /usr/local/apache/logs/mod_jk.log</p>
<p># Set the jk log level [debug/error/info]<br />
JkLogLevel    info</p>
<p># Select the timestamp log format<br />
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”</p>
<p># JkRequestLogFormat set the request format<br />
JkRequestLogFormat “%w %V %T”</p>
<p># JkOptions indicate to send SSL KEY SIZE,<br />
JkOptions  +ForwardKeySize +ForwardURICompat -ForwardDirectories</p>
<p># Send servlet for context /examples to worker named worker1<br />
#JkMount  /examples/*.jsp worker1<br />
  JkMount  /servlet/* worker1</p>
<p># Send JSPs  for context /examples to worker named worker1<br />
  JkMount  /*.jsp worker1</p>
<p>创建文件workers.proferties<br />
#vi /usr/local/apache/conf/workers.porperties<br />
添加如下内容：<br />
    workers.tomcat_home=/usr/local/tomcat<br />
    workers.java_home=/usr/local/jdk<br />
    ps=/<br />
    worker.list=worker1<br />
    worker.worker1.port=8009<br />
    worker.worker1.host=localhost<br />
    worker.worker1.type=ajp13<br />
    worker.worker1.connection_pool_timeout=600<br />
    worker.worker1.socket_keepalive=1<br />
    worker.worker1.lbfactor=1<br />
    worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout<br />
    worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr<br />
5)   配置apache和tomcat的虚拟主机<br />
首先APACHE的虚拟主机设置如下：<br />
修改 conf/httpd.conf找到<br />
# Virtual hosts<br />
#Include conf/extra/httpd-vhosts.conf<br />
修改为<br />
# Virtual hosts<br />
Include conf/extra/httpd-vhosts.conf<br />
然后编辑<br />
conf/extra/httpd-vhosts.conf<br />
加入下面的代码<br />
    ServerAdmin oasis.yan@intermobiz.com<br />
    DocumentRoot /data/www/test1<br />
    ServerName test1.ydjxc.com<br />
    DirectoryIndex  index.jsp   <br />
    ErrorLog logs/web_error_log<br />
    CustomLog logs/web_access_log common<br />
  Options -Indexes FollowSymLinks<br />
  AllowOverride None<br />
  Order allow,deny<br />
  Allow from all</p>
<p>    ServerAdmin oasis.yan@intermobiz.com<br />
    DocumentRoot /data/www/test2<br />
    ServerName test2.ydjxc.com<br />
    ServerAlias localhost<br />
    DirectoryIndex  index.jsp<br />
    ErrorLog logs/wap_error_log<br />
    CustomLog logs/wap_access_log common<br />
  Options -Indexes FollowSymLinks<br />
  AllowOverride None<br />
  Order allow,deny<br />
  Allow from all<br />
备注：test1/index.jsp的内容如下：</p>
<p>同理为test2/index.jsp<br />
注意：丢掉下面这段代码会提示403错误<br />
  Options -Indexes FollowSymLinks<br />
  AllowOverride None<br />
  Order allow,deny<br />
  Allow from all</p>
<p>其次Tomcat设置虚拟主机<br />
编辑tomcat的配置文件server.xml<br />
在后面添加如下代码</p>
<p>备注：其中这是两段虚拟主机的代码，红色部分为虚拟目录的配置，这样就可以访问<br />
<a target="_blank" href="http://test1.ydjxc.com:8080/test2"><font color="#0000ff">http://test1.ydjxc.com:8080/test2</font></a><br />
<a target="_blank" href="http://test2.ydjxc.com:8080/test1"><font color="#0000ff">http://test2.ydjxc.com:8080/test1</font></a><br />
特别注意的地方:<br />
在配置文件中找到：<br />
讲其改为：<br />
如果不改的话，输入：<br />
<a target="_blank" href="http://ip:8080/"><font color="#0000ff">http://ip:8080</font></a><br />
就可以直接进入tomcat的管理界面了。<br />
最后重新启动tomcat和apache，我们的安装就完成了<br />
#/usr/local/tomcat/bin/shutdown.sh    //关闭tomcat<br />
#/usr/local/tomcat/bin/startup.sh     //启动tomcat<br />
#/usr/local/apache/bin/apachectl restart    //重启apache<br />
参考地址<br />
<a target="_blank" href="http://www.rssday.com/article/id-477.html"><font color="#0000ff">http://www.rssday.com/article/id-477.html</font></a></p>
<h2  class="related_post_title">与本文关系暧昧的文字</h2><ul class="related_post"><li><a href="http://www.linuxbyte.org/tips-for-apache-php-security.html" title="apache,php安全小技巧">apache,php安全小技巧</a></li><li><a href="http://www.linuxbyte.org/centos-yum-an-zhuang-nginx-php-fpm-eaccelerator-mysql.html" title="Centos yum 安装nginx+PHP-FPM+eAccelerator+mysql">Centos yum 安装nginx+PHP-FPM+eAccelerator+mysql</a></li><li><a href="http://www.linuxbyte.org/php-5-3-4-fa-bu.html" title="PHP 5.3.4 发布 ">PHP 5.3.4 发布 </a></li><li><a href="http://www.linuxbyte.org/tui-jian-ge-php-bian-ji-qi-gphpedit.html" title="推荐个PHP 编辑器 Gphpedit">推荐个PHP 编辑器 Gphpedit</a></li><li><a href="http://www.linuxbyte.org/centos5-peizh-dhcp.html" title="centos5 下配置 DHCP 服务器">centos5 下配置 DHCP 服务器</a></li><li><a href="http://www.linuxbyte.org/apache-license-version-2.html" title="Apache License Version 2.0">Apache License Version 2.0</a></li><li><a href="http://www.linuxbyte.org/config-apache-mod_limitipconn.html" title="apache 下限制单个IP 的并发连接数">apache 下限制单个IP 的并发连接数</a></li><li><a href="http://www.linuxbyte.org/apache-url-rewrite.html" title="Apache Url Rewrite(mod_rewrite)">Apache Url Rewrite(mod_rewrite)</a></li></ul><hr />
<p><small>© xiao H for <a href="http://www.linuxbyte.org">LinuxByte</a>, 2008<br />
Source: <a href="http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk.html">Centos5+Apache2.2.6+PHP5+tomcat6.0.14+jdk1.6整合安装</a><br />
Post tags: <a href="http://www.linuxbyte.org/tag/apache" rel="tag">apache</a>, <a href="http://www.linuxbyte.org/tag/centos" rel="tag">Centos</a>, <a href="http://www.linuxbyte.org/tag/jdk" rel="tag">jdk</a>, <a href="http://www.linuxbyte.org/tag/php" rel="tag">php</a>, <a href="http://www.linuxbyte.org/tag/tomcat" rel="tag">tomcat</a><br/>
</small></p>
	<p style="margin:3px 0 0 0;">标签：<a href="http://www.linuxbyte.org/tag/apache" title="apache" rel="tag">apache</a>, <a href="http://www.linuxbyte.org/tag/centos" title="Centos" rel="tag">Centos</a>, <a href="http://www.linuxbyte.org/tag/jdk" title="jdk" rel="tag">jdk</a>, <a href="http://www.linuxbyte.org/tag/php" title="php" rel="tag">php</a>, <a href="http://www.linuxbyte.org/tag/tomcat" title="tomcat" rel="tag">tomcat</a></p>

<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxbyte.org/centos5-apache2-php5-tomcat6-jdk.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

