手动安装图度注意事项

图度主页

https://www.tudu.im/

https://github.com/OrayDev/tudu-web

 

#Cookie及端口问题:

Setcookie 函数第5个参数域名部份。不能加入端口号,加入端口号cookie设置会失败。

Setcookie(“name”, “value”, time()+3600, ‘/’, ‘127.0.0.1:80’); //5个参数加上端口号后无法设置cookie

Setcookie(“name”, “value”, time()+3600, ‘/’, ‘127.0.0.1’); //不加端口号才能成功设置cookie

设置成功的cookie所有端口都通用。如 127.0.0.1:8080 可以访问到所有127.0.0.1设置的cookie

因此在图度的安装说明中特别说明了只支持80端口的安装。如果所绑定的端口非80端口或显式设置了端口号,可能会出现无法设置cookie并导置无法保存session的问题(session需要依靠cookie)。

解决方法为:/htdocs/www.tudu.com/application/configs/application.ini 配置文件中配置项

resources.session.cookie_domain = HOST

改为空字符串:

resources.session.cookie_domain = “”

/admin.tudu.com/ 和 /api.tudu.com/ 目录的相应配置文件也作同样修改,令setcookie5个参数为空即可正常保存cookiesession

 

另外,在chrome浏览器下,第5个参数至少要有2个“.”才能正常保存cookie,因此,

setcookie(“name”,”value”,time()+3600,’/’,’localhost’); //无法保存cookie

5个参数使用没有“.”的localhost也无法正常在chrome下保存cookie,其它浏览器未进行测试。

 

PHP setcookie() Chrome失效。。

http://lekho.diandian.com/post/2011-06-01/1515852

为何在localhost下执行setcookie('localhost',520,3600+time(),'/','localhost')无法设置cookie?

http://www.zhihu.com/question/21385366

 

#站点配置及访问路径问题

图度使用了Zend框架,Zend框架必须使用rewrite(伪静态)功能。同时,图度使用了两个站点(前台与后台)(从其自动安装脚本中得知),前台站点使用80端口,后台站点使用另一个端口(默认是8888),通过服务器反向代理设置进行访问,令浏览器通过80端口即可访问另一个端口的后台站点。

 

使用Apache配置站点的注意事项(基于WAMPServerApache):

需要开启rewriteproxyproxy_http模块。

配置站点及反向代理(放到vhosts目录中,也可以直接写入httpd.conf中):

#前台站点

<VirtualHost *:80>

ServerName 127.0.0.1

DocumentRoot "E:\wamp\www\tudu\htdocs\www.tudu.com\public"

<IfModule mod_proxy.c>

#Reverse Proxy(反向代理)

<Proxy *>

Order Deny,Allow

Deny from all

Allow from 127.0.0.1

</Proxy>

ProxyRequests Off

#反向代理到后台站点

ProxyPass      /admin http://127.0.0.1:8091/admin

ProxyPassReverse /admin http://127.0.0.1:8091/admin

</IfModule>

 

<Directory "E:\wamp\www\tudu\htdocs\www.tudu.com\public">

    Options FollowSymLinks

    AllowOverride ALL #允许站点使用 .htaccess 文件

</Directory>

</VirtualHost>

 

#后台站点

Listen 8091

<VirtualHost *:8091>

ServerName 127.0.0.1

DocumentRoot "E:\wamp\www\tudu\htdocs\admin.tudu.com"

 

<Directory "E:\wamp\www\tudu\htdocs\admin.tudu.com\public">

    Options FollowSymLinks

    AllowOverride ALL

</Directory>

</VirtualHost>

/admin.tudu.com/public//www.tudu.com/public/两个目录下建立.htaccess文件,添加rewrite规则:

<IfModule mod_rewrite.c>

    RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond $1 !^(index\.php|robots\.txt|views|plugins|backup|upload|image|runtime|install)

RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

 

WAMPhttpd-vhosts虚拟主机设置(单IP多域名)

http://iecspace.ecjtu.org/posts/vhosts-set-one-ip-several-websites

Apache代理配置小试

http://sjsky.iteye.com/blog/1067119

Windows下自由创建.htaccess文件的N种方法

http://www.zendstudio.net/archives/create-htaccess-file-in-windows/

 

#Windows下安装的注意事项

(注:在Windows未能完全成功安装,主要在于httpsqs

 

windows 32bit下安装memcache资料较多,在windows 64bit下安装,从以下地址下载memcache 64位版:

http://www.urielkatz.com/projects/memcached-win64/memcached-win64.zip

 

win下安装httpsqs需要借助cygwin,但在win7 64bit上编译tokyocabinet出现源代码报错,无法通过编译。

 

php_memcache-2.2.27-5.4-VC9-x64

http://www.mediafire.com/download/txefo1qihwg94o1/php_memcache-2.2.27-5.4-VC9-x64.zip

很多PHPWindows下的扩展dll文件

http://www.mediafire.com/php-win64-extensions#75bansbee0tme

PHP 5.3.13 memcache win 64 配置和安装

http://xintudou.blog.51cto.com/6235626/1242933

Windows下的Memcache安装

http://www.ccvita.com/258.html

Windows Memcache安装配置(For PHP5.3)

http://blog.fity.cn/post/394/

memcache32位系统和64位系统的安装文件以及各版本配置的php_memcache.dll文件

http://download.csdn.net/detail/u011002948/6205541

php_memcache.dll php5.2 php5.3 php5.4

http://download.csdn.net/detail/xiaohei_ning/5877057

httpsqs学习笔记

http://zhangcs053.iteye.com/blog/1155162

 

最后,安装完图度后,登录入去后页面加载很慢,因为页面发起http请求查询IM在线数但查询地址错误总是会超时(30秒),修改源代码文件:

/library/oray/im/client.php

把方法改为:

    public function getUserStatus($email)

    {

    //此方法发起的http请求响应过慢,影响执行速度,暂时禁用

    return array();


#调整上传文件大小限制

修改php.ini对上传文件的限制

修改 www.tudu.com/application/configs/application.ini

upload.sizelimit 配置项值。


<div class="post-text" itemprop="text"> <p>This has been asked a thousand times, but not exactly how I want it. I have tried combining different solutions, but my .htaccess doesn't seem to do what it is supposed to.</p> <pre><code># Not sure what this does? Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On # To externally redirect /dir/foo.php to /dir/foo RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC] RewriteRule ^ %1 [R,L] # To internally forward /dir/foo to /dir/foo.php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*?)/?$ $1.php [L] # Redirect index in any directory to root of that directory RewriteCond %{THE_REQUEST} ^[A-Z](3,9)\ /([^/]+/)*index\.[^\ ]*\ HTTP/ RewriteRule ^(([^/]+/)*)index(\.[a-z0-9]+)?$ http://www.example.com/$1? [R=301,L] </code></pre> <p>Now my pages correctly change from <code>domain.com/page1.php</code> to <code>domain.com/page1</code>, however something goes wrong with <code>domain.com/index.php</code>.</p> <p>I am testing this locally and when going to <code>localhost/project</code> everything works fine (the <code>index.php</code> opens, but you don't see that in the url) but when you explicitly navigate to <code>localhost/project/index.php</code> you are returned to the very root, i.e. <code>localhost</code> (which hen returns to <code>http://localhost/xampp/splash.php</code>). Of course, this is not what I want. I want <code>localhost/project/index.php</code> to return to `localhost/project/´.</p> <p>An additional question, though: how do rewrite rules influence search engines. Will the pages (ie contact.php, about-us.php and so on) still be indexed?</p> <p><em>Extra +1 and kudos for he or she who gives a detailed breakdown of what each line/rule in the htaccess in their answer does. I am still learning .htaccess, so every detail is important and relevant to me!</em></p> </div>
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页