discuz7.2论坛修改内容
[
2010/01/23 22:28 | by suibing ]
2010/01/23 22:28 | by suibing ]
1.解决右侧广告环绕问题:
查找
<!--{if $admode && !empty($advlist['thread3'][$post['count']])}--><div class="ad_pip" id="ad_thread3_$post[count]">$advlist[thread3][$post[count]]</div><!--{else}--><div id="ad_thread3_$post[count]"></div><!--{/if}--><div id="ad_thread4_$post[count]"></div>
把这段代码代码移动到
$post[message]
的前面即可。
也就是说,在删除上面的代码后,查找
<td class="t_msgfont" id="postmessage_$post[pid]">$post[message]</td>
复制代码修改为
<td class="t_msgfont" id="postmessage_$post[pid]"><!--{if $admode && !empty($advlist['thread3'][$post['count']])}--><div class="ad_pip" id="ad_thread3_$post[count]">$advlist[thread3][$post[count]]</div><!--{else}--><div id="ad_thread3_$post[count]"></div><!--{/if}--><div id="ad_thread4_$post[count]"></div>$post[message]
同时需要到模板那里把阅读区域宽度 {CONTENTWIDTH}: 改成99%或者100%
查找
<!--{if $admode && !empty($advlist['thread3'][$post['count']])}--><div class="ad_pip" id="ad_thread3_$post[count]">$advlist[thread3][$post[count]]</div><!--{else}--><div id="ad_thread3_$post[count]"></div><!--{/if}--><div id="ad_thread4_$post[count]"></div>
把这段代码代码移动到
$post[message]
的前面即可。
也就是说,在删除上面的代码后,查找
<td class="t_msgfont" id="postmessage_$post[pid]">$post[message]</td>
复制代码修改为
<td class="t_msgfont" id="postmessage_$post[pid]"><!--{if $admode && !empty($advlist['thread3'][$post['count']])}--><div class="ad_pip" id="ad_thread3_$post[count]">$advlist[thread3][$post[count]]</div><!--{else}--><div id="ad_thread3_$post[count]"></div><!--{/if}--><div id="ad_thread4_$post[count]"></div>$post[message]
同时需要到模板那里把阅读区域宽度 {CONTENTWIDTH}: 改成99%或者100%
快速建立 ipv6 安全管道访问 ipv6 网站
[
2010/01/23 00:15 | by suibing ]
2010/01/23 00:15 | by suibing ]
目前有很多网站支持 ipv6 连接,比如
http://ipv6.google.com
但对大部分人来说,这个网址是不能访问的,因为没有设置好 ipv6 。目前 ISP 很少提供 ipv6 连接,用户一般需要使用 ipv6 tunnel broker 来建立管道来访问 ipv6 站点。
在 Linux 下这个工作很简单,以 Debian 为例,安装 miredo 包(包的名字是”多来咪”反过来):
# sudo apt-get install miredo
后输入
# /sbin/ifconfig
看到 teredo 这个虚拟网卡就可以用它访问 ipv6 了:
# ping6 ipv6.google.com
PING ipv6.google.com(2001:4860:b002::68) 56 data bytes
64 bytes from 2001:4860:b002::68: icmp_seq=1 ttl=56 time=874 ms
64 bytes from 2001:4860:b002::68: icmp_seq=2 ttl=56 time=322 ms
现在应该可以访问 http://ipv6.google.com 了,如果成功访问的话,你会看到在 ipv4 下面熟悉的 Google 搜索界面,但 Google Logo 是动画的。
使用 sixxs.org 提供的 ipv4/ipv6 交换门,可以实现在 ipv4 环境下访问 ipv6 站点,或者在 ipv6 环境下访问 ipv4 站点,方法是:
. ipv4 环境下,在 ipv6 网站后面添加 .ipv4.sixxs.org:
http://ipv6.google.com/ —> http://ipv6.google.com.ipv4.sixxs.org/
而在 ipv6 环境下,在 ipv4 网站后面添加 sixxs.org 或者 .ipv6.sixxs.org:
http://wikipedia.org/ —> http://wikipedia.org.sixxs.org/
从理论上来说,所有正常使用 80 端口的 ipv4 网站均可以在 ipv6 环境下使用 ipv6交换门来访问。
这台安装并能正确访问 ipv6 的 Linux 机器,可以安装 polipo (支持 ipv6 的代理)后让不支持 ipv6 的 Windows 系统访问 ipv6 站点:
# sudo apt-get install polipo
# vi /etc/polipo/config
找到 proxyAddress 改成允许 Windows 系统访问即可:
proxyAddress=”0.0.0.0″
#sudo /etc/init.d/polipo restart
polipo 的默认端口是 8123,把 Windows 系统的代理改成 LinuxIP:8123 就可以访问 ipv6 站点了。
http://ipv6.google.com
但对大部分人来说,这个网址是不能访问的,因为没有设置好 ipv6 。目前 ISP 很少提供 ipv6 连接,用户一般需要使用 ipv6 tunnel broker 来建立管道来访问 ipv6 站点。
在 Linux 下这个工作很简单,以 Debian 为例,安装 miredo 包(包的名字是”多来咪”反过来):
# sudo apt-get install miredo
后输入
# /sbin/ifconfig
看到 teredo 这个虚拟网卡就可以用它访问 ipv6 了:
# ping6 ipv6.google.com
PING ipv6.google.com(2001:4860:b002::68) 56 data bytes
64 bytes from 2001:4860:b002::68: icmp_seq=1 ttl=56 time=874 ms
64 bytes from 2001:4860:b002::68: icmp_seq=2 ttl=56 time=322 ms
现在应该可以访问 http://ipv6.google.com 了,如果成功访问的话,你会看到在 ipv4 下面熟悉的 Google 搜索界面,但 Google Logo 是动画的。
使用 sixxs.org 提供的 ipv4/ipv6 交换门,可以实现在 ipv4 环境下访问 ipv6 站点,或者在 ipv6 环境下访问 ipv4 站点,方法是:
. ipv4 环境下,在 ipv6 网站后面添加 .ipv4.sixxs.org:
http://ipv6.google.com/ —> http://ipv6.google.com.ipv4.sixxs.org/
而在 ipv6 环境下,在 ipv4 网站后面添加 sixxs.org 或者 .ipv6.sixxs.org:
http://wikipedia.org/ —> http://wikipedia.org.sixxs.org/
从理论上来说,所有正常使用 80 端口的 ipv4 网站均可以在 ipv6 环境下使用 ipv6交换门来访问。
这台安装并能正确访问 ipv6 的 Linux 机器,可以安装 polipo (支持 ipv6 的代理)后让不支持 ipv6 的 Windows 系统访问 ipv6 站点:
# sudo apt-get install polipo
# vi /etc/polipo/config
找到 proxyAddress 改成允许 Windows 系统访问即可:
proxyAddress=”0.0.0.0″
#sudo /etc/init.d/polipo restart
polipo 的默认端口是 8123,把 Windows 系统的代理改成 LinuxIP:8123 就可以访问 ipv6 站点了。
linode vps增加ipv6地址
[
2010/01/22 18:06 | by suibing ]
2010/01/22 18:06 | by suibing ]
CentOS
/etc/sysconfig/network
NETWORKING_IPV6=yes
IPV6_DEFAULTDEV="tun6to4"
/etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT="yes"
IPV6TO4INIT="yes"
IPV6TO4_RELAY="192.88.99.1"
Restart your networking (/etc/init.d/network restart) and then take a look at your ifconfig. You can then try "ping6 ipv6.chat.freenode.net" (or another host of choice) to test your connectivity.
来自:http://www.linode.com/wiki/index.php/IPv6#CentOS
/etc/sysconfig/network
NETWORKING_IPV6=yes
IPV6_DEFAULTDEV="tun6to4"
/etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT="yes"
IPV6TO4INIT="yes"
IPV6TO4_RELAY="192.88.99.1"
Restart your networking (/etc/init.d/network restart) and then take a look at your ifconfig. You can then try "ping6 ipv6.chat.freenode.net" (or another host of choice) to test your connectivity.
来自:http://www.linode.com/wiki/index.php/IPv6#CentOS
为VPS增加ipv6地址
[
2010/01/22 18:04 | by suibing ]
2010/01/22 18:04 | by suibing ]
本文写给在用VPS的同学,即使你的VPS提供商并不支持IPv6,你可以将你网站做成IPv6 Ready!如果你的读者中的不少在教育网,做下这个就十分值得了,因为教育网没有国际连线,但是有免费的IPv6。如果你的VPS服务商支持IPv6那你可以直接从第5步看起,如果不支持,那就请从头看起。准备好了吗,Let’s begin!
1. 基本原理
虽然你的VPS不支持IPv6,但是我们可以通过IPv6 Tunnel来解决,也就是平时说的IPv6 Over IPv4,可以理解成在IPv4上建立的IPv6的小管道。我们使用的是HE(Hurricane Electronics)提供的免费的IPv6 Tunnel Broker,HE拥有世界是最大的IPv6骨干网,在世界各地都有提供IPv6 Tunnel Broker的服务。
2. 注册免费的HE IPv6 Tunnel Broker
注册地址:http://tunnelbroker.net/,点击“Register”即可注册,注册流程很简单,就不多讲了。
3. 添加Tunnel
点击左侧“Create Regular Tunnel”:
在“IPv4 endpoint”填入你VPS的IP地址,HE会根据你的浏览器的IP地址帮你选择服务器,但并不一定是最好的,你要根据你的VPS的地理位置,选择服务器的地址,我的是美国西部的VPS,于是我选择了Fremont, CA, US的服务器,点击“Override”可选择服务器。
再点击“Submit”,即可建立Tunnel成功。
4. VPS上的设置
回到HE IPv6 Tunnel Broker的首页,点击刚刚建立的Tunnel,会有这个Tunnel的详细信息:
可以看到,HE给你分配了/64的IPv6地址,也就是你有2的64次方个地址,这辈子都用不完,哈哈。在详细信息的下面,有一个设置你VPS的方法,点击“Show Config”就会出来设置方法:
把这些命令在你的VPS上执行下。测试下看设置成功没,ping6 he.net,如果跟下图差不多,就说明配置成功:
行啦,你的VPS也支持IPv6啦!
5. 让的网站IPv6 Ready
做完这些还不行,还得让你的HTTP服务器支持IPv6。Apache 2.0版本开始支持IPv6,Nginx从0.7.36之后开始支持IPv6。我们只讲Nginx的配置方法,其他可以自己摸索。
我的VPS上装的是lnmp一键安装包:http://lnmp.org/ ,下面讲解中安装路径就以lnmp中安装路径为准。
重新编译Nginx使之支持IPv6。不详细说了,晒下命令:
?[Copy to clipboard]View Code BASH
wget http://nginx.org/download/nginx-0.8.32.tar.gz
tar –xvzf nginx-0.8.32.tar.gz
cd nginx-0.8.32
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-ipv6
make && make install
在终端执行ifconfig,可以看到你的IPv6地址:

把你虚拟机配置文件中listen 80;全部替换为listen ip:80;的形式,否则启动不了。再在你想支持IPv6的虚拟机里加一句listen [ipv6]:80,配置好之后,大体如下图所示:
?[Copy to clipboard]View Code BASH
server {
listen 216.45.55.20:80;
listen [2001:470:1f04:873::2]:80;
server_name kangzj.net;
………………
}
安装配置完毕。停掉旧nginx,启动新编译的nginx:
?[Copy to clipboard]View Code BASH
killall nginx
/usr/local/nginx/sbin/nginx
6. 增加IPv6地址的DNS AAAA记录
这个需要你的DNS支持AAAA记录,也就是IPv6记录。现在基本所有的域名注册商的DNS都支持了,如果不支持,你可以使用dnspod的服务,是免费的,而且支持AAAA记录。
我的是Name.com的域名,本身就支持,就不麻烦了。加好之后,域名会有两条记录,一条A的,一条AAAA的:
搞掂,等生效吧。生效之后,如果用户网络支持IPv6的话,就会访问IPv6地址。如果只有IPv4网络就会访问IPv4的地址啦!
7. 后记
原来以为只有Native的IPv6才能提供网络服务,我错了,走Tunnel的也可以。这下子VPS商支不支持IPv6无所谓了,我们可以自己解决,DIY万岁!
总结一下我开只允许用来登录的SSH账号的方法
[
2010/01/22 10:16 | by suibing ]
2010/01/22 10:16 | by suibing ]
这个方法的副作用就是只有root才能使用sftp!
创建用户组,创建用户,设置密码:
复制内容到剪贴板代码:
groupadd SSHTunnel
useradd -g SSHTunnel -s /bin/bash -d /home/tunnel TunnelUser1
passwd TunnelUser1
设置sftp权限:
复制内容到剪贴板代码:
chmod 700 /usr/lib/openssh/sftp-server
在/etc/ssh/sshd_config内添加:
复制内容到剪贴板代码:
Match Group SSHTunnel
AllowTcpForwarding yes
ForceCommand sh /home/tunnel/tunnelshell.sh
下载设置登陆脚本:
复制内容到剪贴板代码:
wget https://chencp.info/tunnelshell.sh --no-check-certificate -O /home/tunnel/tunnelshell.sh
ln -s /home/tunnel/tunnelshell.sh /home/tunnel/.profile
最后重启sshd:
复制内容到剪贴板代码:
/etc/init.d/ssh restart
这样就可以了,同时用户登陆后还支持passwd命令修改密码。
再添加用户则:
复制内容到剪贴板代码:
useradd -g SSHTunnel -s /bin/bash -d /home/tunnel <用户名>
passwd <用户名>
创建用户组,创建用户,设置密码:
复制内容到剪贴板代码:
groupadd SSHTunnel
useradd -g SSHTunnel -s /bin/bash -d /home/tunnel TunnelUser1
passwd TunnelUser1
设置sftp权限:
复制内容到剪贴板代码:
chmod 700 /usr/lib/openssh/sftp-server
在/etc/ssh/sshd_config内添加:
复制内容到剪贴板代码:
Match Group SSHTunnel
AllowTcpForwarding yes
ForceCommand sh /home/tunnel/tunnelshell.sh
下载设置登陆脚本:
复制内容到剪贴板代码:
wget https://chencp.info/tunnelshell.sh --no-check-certificate -O /home/tunnel/tunnelshell.sh
ln -s /home/tunnel/tunnelshell.sh /home/tunnel/.profile
最后重启sshd:
复制内容到剪贴板代码:
/etc/init.d/ssh restart
这样就可以了,同时用户登陆后还支持passwd命令修改密码。
再添加用户则:
复制内容到剪贴板代码:
useradd -g SSHTunnel -s /bin/bash -d /home/tunnel <用户名>
passwd <用户名>





