Aug 29
分类:
apache相关,
项目案例 |
给我留言 | 点击量85次
在Apache中设置虚拟目录.
如:
<VirtualHost 192.168.18.4:80>
ServerAdmin admin@system.com
DocumentRoot D:\usr\webroot\tiffany
ServerName www.tiffany4.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
此时我们在D:\usr\webroot\tiffany\的根目录下放置了.htaccess文件来实现301.404重定向问题
如果出现这一情况:
没有报.htaccess文件的错误,感觉此文件好象无效,被过滤了.
怎么调试编写.htaccess文件也没有作用的情况,
那么可能的原因就是apache总没有识别此文件,
需要修改Apache中的httpd.conf文件如下:
<VirtualHost 192.168.18.4:80>
ServerAdmin admin@system
DocumentRoot D:\usr\webroot\tiffany
AccessFileName .htaccess
ServerName www.tiffany4.com
<Directory “D:/usr/webroot/tiffany”>
Options FollowSymLinks
AllowOverride All
Order deny,allow
allow from all
Satisfy all
</Directory>
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
Aug 27
/*
* 删除数据中的一个元素 ,并重建索引
* $arr:要删除元素的数组
* $offset:要删除元素的索引
*/
function array_remove(&$arr,$offset){
array_splice($arr,$offset,1);
}
Aug 15
分类:
八卦人生 |
给我留言(2 条留言) | 点击量152次
带着无比眷恋之情踏上了欢送英子的聚餐道路上

先来个主角”特写”,嘻嘻~~,摄影师”小/jump木同”人生一大失败,使小小的我挡在了主角的前面为她护航.

再来一张主角笑脸展示图. (阅读更多精彩内容…)
Aug 14
分类:
杂谈天地,
项目案例 |
给我留言 | 点击量120次
Affiliate Program它是联盟营销的载体
Affiliate program 的原理:
网站主A上列出许多广告连接,这些广告连接被其他网站主B放到自己的网站上展示出来,
当浏览的用户C点击网站主B上的这些展示的广告后,跳转到网站主A上面,那么这浏览的用户C
就算作是网站主B给牵引过来了.
按照联盟营销模式(CPA-Cost Per Action, 按效果付费;),网站主B应该能从网站主A这里
按照协议获得佣金.而这一切全建立在网站主A的一套后台程序Affiliate
(阅读更多精彩内容…)
Jul 25
分类:
seo技术专栏 |
给我留言 | 点击量146次
想想也是淘宝首页有两百多K还不包含JS和样式,但是我们打开却很快,到底是为什么呢,生成静态?缓存?……有很大的疑问,今天网上找了老半天才得到答案:CDN加速!
C:\Documents and Settings\Administrator>ping www.taobao.com
Pinging www.gslb.taobao.com [60.12.195.20] with 32 bytes of data:
Reply from 60.12.195.20: bytes=32 time=42ms TTL=239
Reply from 60.12.195.20: bytes=32 time=76ms TTL=239
Reply from 60.12.195.20: bytes=32 time=106ms TTL=239
你ping www.taobao.com 那么将被重定向到一个距离你最近的服务器..而不是真正的 www.taobao.com
我这里被重定向到 www.gslb.taobao.com
CDN的全称是Content Delivery Network,即内容分发网络。其目的是通过在现有的Internet中增加一层新的网络架构,将网站的内容发布到最接近用户的网络”边缘”,使用户可以就近取得所需的内容,解决Internet网络拥挤的状况,提高用户访问网 站的响应速度。从技术上全面解决由于网络带宽小、用户访问量大、网点分布不均等原因所造成的用户访问网站响应速度慢的问题。
Jul 25
分类:
php前沿 |
给我留言 | 点击量157次
今天在CSDN论坛上看一个主题,如何建立HTTP的长连接,下面好多人给出了回答,这里把实现方法粘下,大家讨论下:
服务端:
<?php
$filename = dirname(__FILE__).’/data.txt’;
// store new message in the file
$msg = isset($_GET['msg']) ? $_GET['msg'] : ”;
if ($msg != ”)
{
file_put_contents($filename,$msg);
die();
}
// infinite loop until the data file is not modified
$lastmodif = isset($_GET['timestamp']) ? $_GET['timestamp'] : 0;
$currentmodif = filemtime($filename);
while ($currentmodif <= $lastmodif) // check if the data file has been modified
{
usleep(10000); // sleep 10ms to unload the CPU
clearstatcache(); //清除文件状态缓存
$currentmodif = filemtime($filename);
}
// return a json array
$response = array();
$response['msg'] = file_get_contents($filename);
$response['timestamp'] = $currentmodif;
echo json_encode($response);
flush(); //刷新输出缓冲
?>
客户端用AJAX提交,主要用于在线聊天等实时系统~!