<?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>曾华水的博客 &#187; IP</title>
	<atom:link href="http://www.mrzeng.com/tag/ip/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mrzeng.com</link>
	<description>NO.1 or Nothing</description>
	<lastBuildDate>Wed, 07 Sep 2011 12:47:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Linux中修改ip的办法</title>
		<link>http://www.mrzeng.com/post/linux-change-ip-solution.html</link>
		<comments>http://www.mrzeng.com/post/linux-change-ip-solution.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 07:30:27 +0000</pubDate>
		<dc:creator>zenghuashui</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[IP]]></category>

		<guid isPermaLink="false">http://www.mrzeng.com/?p=215</guid>
		<description><![CDATA[切换到root账户下 切换到/etc/sysconfig/network-scripts/目录下； 编辑网卡编码：vi ifcfg-ethX X为第X-1个网卡。 DEVICE=ethX 设备名称 ONBOOT=yes 计算机启动时是否激活网卡 BOOTPROTO=static 获取ip地址的方式， IPADDR=192.168.2.111 ip地址 NETMASK=255.255.255.0 子网掩码 GATEWAY=192.168.0.1 网关 重启网络 /etc/init.d/network restart 相关日志Centos的vsftp搭建方法公司要架一台新的图片服务器，对比了centos下的几款ftp，最后还是继续选择vsftp。 搭建的方法如下： 一、下载安装 1、安装Vsftpd yum -y install vsftpd* 2、安装PAM yum -y install pam* 3、安装db4 yum -y install db4* 二、配置vsf...Centos/RedHat下安装gcc的方法许多人安装centos和redhat的时候没有将开发工具包和开发库给打钩，从而在安装后要编译一些程序出现错误。 此时，安装方法有以下几种：fdc5f25c 1、直接执行（命令行执行这个方法最省事） yum -y install gcc yum -y install gcc-c++ 下载后安装 2、在光盘的centos目录下找到以下包 　　comp...linux下的文件的压缩和解压缩SSH常用SecureCRT 5.5进行连接，使用sz和rz命令来上传下去。但这个命令只支持单文件传输，多文件就比较麻烦。但是如果使用压缩包的方式就省事很多。我们来看看在liux下压缩包的压缩和解压方法. tar -c: [...]]]></description>
			<content:encoded><![CDATA[<p>切换到root账户下<br />
<span id="more-215"></span><br />
切换到/etc/sysconfig/network-scripts/目录下；</p>
<p>编辑网卡编码：vi ifcfg-eth<strong>X</strong> <strong>X</strong>为第<strong>X</strong>-1个网卡。</p>
<p>DEVICE=eth<strong>X</strong>                                        设备名称<br />
ONBOOT=yes                                        计算机启动时是否激活网卡<br />
BOOTPROTO=static                                获取ip地址的方式，<br />
IPADDR=192.168.2.111                         ip地址<br />
NETMASK=255.255.255.0                      子网掩码<br />
GATEWAY=192.168.0.1                   网关</p>
<p>重启网络<br />
/etc/init.d/network restart</p>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li><a href="http://www.mrzeng.com/post/centos-vsftpd.html" title="Centos的vsftp搭建方法">Centos的vsftp搭建方法</a><br /><small>公司要架一台新的图片服务器，对比了centos下的几款ftp，最后还是继续选择vsftp。
搭建的方法如下：
一、下载安装
   1、安装Vsftpd

yum -y install vsftpd*
  
   2、安装PAM

yum -y install pam*
   
   3、安装db4
 
yum -y install db4*
 


二、配置vsf...</small></li><li><a href="http://www.mrzeng.com/post/centosredhat-gcc.html" title="Centos/RedHat下安装gcc的方法">Centos/RedHat下安装gcc的方法</a><br /><small>许多人安装centos和redhat的时候没有将开发工具包和开发库给打钩，从而在安装后要编译一些程序出现错误。
此时，安装方法有以下几种：fdc5f25c


1、直接执行（命令行执行这个方法最省事）

     yum -y install gcc
     yum -y install gcc-c++

 下载后安装
2、在光盘的centos目录下找到以下包
　　comp...</small></li><li><a href="http://www.mrzeng.com/post/linux-tar-zip-gz.html" title="linux下的文件的压缩和解压缩">linux下的文件的压缩和解压缩</a><br /><small>SSH常用SecureCRT 5.5进行连接，使用sz和rz命令来上传下去。但这个命令只支持单文件传输，多文件就比较麻烦。但是如果使用压缩包的方式就省事很多。我们来看看在liux下压缩包的压缩和解压方法.


tar

-c: 建立压缩档案
-x：解压
-t：查看内容
-r：向压缩归档文件末尾追加文件
-u：更新原压缩包中的文件

这五个是独立的命令，压缩解压都要用到其中一个...</small></li><li><a href="http://www.mrzeng.com/post/vista-localhost-ip.html" title="Vista中无法使用localhost访问本机的解决方法">Vista中无法使用localhost访问本机的解决方法</a><br /><small>最近，买了个笔记本，装的是vista，奇怪的是，装上服务器套件后，死活不能用localhost访问，但127.0.0.1可以。搜索了一下，解决办法如下：

找到WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS 文件。HOSTS是文件名，这个文件没有扩展名。

用记事本打开它，发现多了一个

::1             localhost

删了它，保存。问题...</small></li><li><a href="http://www.mrzeng.com/post/php-get-client-ip.html" title="PHP获取客户端IP的几种方法">PHP获取客户端IP的几种方法</a><br /><small>PHP获取客户端IP有几个函数，下面介绍下三种常用的写法。

第一种：

< ?php
function GetIP() { //获取IP 
    if ($_SERVER["HTTP_X_FORWARDED_FOR"]) 
        $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; 
    else if ($_SERVER["HTTP_C...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mrzeng.com/post/linux-change-ip-solution.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vista中无法使用localhost访问本机的解决方法</title>
		<link>http://www.mrzeng.com/post/vista-localhost-ip.html</link>
		<comments>http://www.mrzeng.com/post/vista-localhost-ip.html#comments</comments>
		<pubDate>Mon, 01 Mar 2010 02:57:02 +0000</pubDate>
		<dc:creator>zenghuashui</dc:creator>
				<category><![CDATA[Share]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://www.mrzeng.com/?p=198</guid>
		<description><![CDATA[最近，买了个笔记本，装的是vista，奇怪的是，装上服务器套件后，死活不能用localhost访问，但127.0.0.1可以。搜索了一下，解决办法如下： 找到WINDOWSSYSTEM32DRIVERSETCHOSTS 文件。HOSTS是文件名，这个文件没有扩展名。 用记事本打开它，发现多了一个 ::1 localhost 删了它，保存。问题解决。 相关日志Linux中修改ip的办法切换到root账户下 切换到/etc/sysconfig/network-scripts/目录下； 编辑网卡编码：vi ifcfg-ethX X为第X-1个网卡。 DEVICE=ethX 设备名称 ONBOOT=yes 计算...PHP获取客户端IP的几种方法PHP获取客户端IP有几个函数，下面介绍下三种常用的写法。 第一种： < ?php function GetIP() { //获取IP if ($_SERVER["HTTP_X_FORWARDED_FOR"]) $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; else if ($_SERVER["HTTP_C...]]></description>
			<content:encoded><![CDATA[<p>最近，买了个笔记本，装的是vista，奇怪的是，装上服务器套件后，死活不能用localhost访问，但127.0.0.1可以。搜索了一下，解决办法如下：<br />
<span id="more-198"></span></p>
<pre class=prettyprint>找到WINDOWSSYSTEM32DRIVERSETCHOSTS 文件。HOSTS是文件名，这个文件没有扩展名。

用记事本打开它，发现多了一个

::1             localhost

删了它，保存。问题解决。</pre>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li><a href="http://www.mrzeng.com/post/linux-change-ip-solution.html" title="Linux中修改ip的办法">Linux中修改ip的办法</a><br /><small>切换到root账户下

切换到/etc/sysconfig/network-scripts/目录下；

编辑网卡编码：vi ifcfg-ethX X为第X-1个网卡。

DEVICE=ethX                                        设备名称
ONBOOT=yes                                        计算...</small></li><li><a href="http://www.mrzeng.com/post/php-get-client-ip.html" title="PHP获取客户端IP的几种方法">PHP获取客户端IP的几种方法</a><br /><small>PHP获取客户端IP有几个函数，下面介绍下三种常用的写法。

第一种：

< ?php
function GetIP() { //获取IP 
    if ($_SERVER["HTTP_X_FORWARDED_FOR"]) 
        $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; 
    else if ($_SERVER["HTTP_C...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mrzeng.com/post/vista-localhost-ip.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP获取客户端IP的几种方法</title>
		<link>http://www.mrzeng.com/post/php-get-client-ip.html</link>
		<comments>http://www.mrzeng.com/post/php-get-client-ip.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:38:32 +0000</pubDate>
		<dc:creator>zenghuashui</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IP]]></category>

		<guid isPermaLink="false">http://www.mrzeng.com/?p=185</guid>
		<description><![CDATA[PHP获取客户端IP有几个函数，下面介绍下三种常用的写法。 第一种： &#60; ?php function GetIP() { //获取IP if ($_SERVER["HTTP_X_FORWARDED_FOR"]) $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; else if ($_SERVER["HTTP_CLIENT_IP"]) $ip = $_SERVER["HTTP_CLIENT_IP"]; else if ($_SERVER["REMOTE_ADDR"]) $ip = $_SERVER["REMOTE_ADDR"]; else if (getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); else if (getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); else $ip = "Unknown"; return $ip; } ?&#62; 第二种： function getip() { [...]]]></description>
			<content:encoded><![CDATA[<p>PHP获取客户端IP有几个函数，下面介绍下三种常用的写法。<br />
<span id="more-185"></span><br />
第一种：</p>
<pre class=prettyprint>
&lt; ?php
function GetIP() { //获取IP
    if ($_SERVER["HTTP_X_FORWARDED_FOR"])
        $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
    else if ($_SERVER["HTTP_CLIENT_IP"])
        $ip = $_SERVER["HTTP_CLIENT_IP"];
    else if ($_SERVER["REMOTE_ADDR"])
        $ip = $_SERVER["REMOTE_ADDR"];
    else if (getenv("HTTP_X_FORWARDED_FOR"))
        $ip = getenv("HTTP_X_FORWARDED_FOR");
    else if (getenv("HTTP_CLIENT_IP"))
        $ip = getenv("HTTP_CLIENT_IP");
    else if (getenv("REMOTE_ADDR"))
        $ip = getenv("REMOTE_ADDR");
    else
        $ip = "Unknown";
    return $ip;
}
?&gt; 
</pre>
<p>第二种：</p>
<pre class=prettyprint>
function getip() {
 if (isset($_SERVER)) {
  if (isset($_SERVER[HTTP_X_FORWARDED_FOR])) {
   $realip = $_SERVER[HTTP_X_FORWARDED_FOR];
  } elseif (isset($_SERVER[HTTP_CLIENT_IP])) {
   $realip = $_SERVER[HTTP_CLIENT_IP];
  } else {
   $realip = $_SERVER[REMOTE_ADDR];
  }
 } else {
  if (getenv("HTTP_X_FORWARDED_FOR")) {
   $realip = getenv( "HTTP_X_FORWARDED_FOR");
  } elseif (getenv("HTTP_CLIENT_IP")) {
   $realip = getenv("HTTP_CLIENT_IP");
  } else {
   $realip = getenv("REMOTE_ADDR");
  }
 }
 $iphide=explode(".",$realip);
 $realip="$iphide[0].$iphide[1].$iphide[2].xxx";
 return $realip;
}
</pre>
<p>第三中</p>
<pre class=prettyprint>
function iptype1 () {
if (getenv("HTTP_CLIENT_IP")) {
   return getenv("HTTP_CLIENT_IP");
}
else {
   return "none";
}
}
function iptype2 () {
if (getenv("HTTP_X_FORWARDED_FOR")) {
   return getenv("HTTP_X_FORWARDED_FOR");
}
else {
   return "none";
}
}
function iptype3 () {
if (getenv("REMOTE_ADDR")) {
   return getenv("REMOTE_ADDR");
}
else {
   return "none";
}
}
function ip() {
$ip1 = iptype1();
$ip2 = iptype2();
$ip3 = iptype3();
if (isset($ip1) &#038;&#038; $ip1 != "none" &#038;&#038; $ip1 != "unknown") {
   return $ip1;
}
elseif (isset($ip2) &#038;&#038; $ip2 != "none" &#038;&#038; $ip2 != "unknown") {
   return $ip2;
}
elseif (isset($ip3) &#038;&#038; $ip3 != "none" &#038;&#038; $ip3 != "unknown") {
   return $ip3;
}
  else {
  return "none"; 
</pre>
<h3  class="related_post_title">相关日志</h3><ul class="related_post"><li><a href="http://www.mrzeng.com/post/linux-change-ip-solution.html" title="Linux中修改ip的办法">Linux中修改ip的办法</a><br /><small>切换到root账户下

切换到/etc/sysconfig/network-scripts/目录下；

编辑网卡编码：vi ifcfg-ethX X为第X-1个网卡。

DEVICE=ethX                                        设备名称
ONBOOT=yes                                        计算...</small></li><li><a href="http://www.mrzeng.com/post/vista-localhost-ip.html" title="Vista中无法使用localhost访问本机的解决方法">Vista中无法使用localhost访问本机的解决方法</a><br /><small>最近，买了个笔记本，装的是vista，奇怪的是，装上服务器套件后，死活不能用localhost访问，但127.0.0.1可以。搜索了一下，解决办法如下：

找到WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS 文件。HOSTS是文件名，这个文件没有扩展名。

用记事本打开它，发现多了一个

::1             localhost

删了它，保存。问题...</small></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.mrzeng.com/post/php-get-client-ip.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

