Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
兔耳日记2.0测试版 http://www.tuer.me
branch: master

This branch is 411 commits behind xiaojue:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
model
public
routes
views
.gitignore
README.md
app.js
help.sh
package.json
routes.js
wapRoutes.js

README.md

tuer.me

配置说明:

git clone https://github.com/xiaojue/tuer.me.git

sudo npm install -d把依赖模块全部安装好,或者用root用户,因为有些是需要比较高的权限的

确认本机有安装redis-server,mongodb,nginx,nginx concat这几个东西并且已经启动.

nginx的配置如下,本地路径记得自行修改,并把hosts修改,把tuer.me这几个域名指向本地127.0.0.1

    server {
        listen       80;
        server_name  img.tuer.me css.tuer.me js.tuer.me assest.tuer.me;

        charset utf-8;

        location / {
            concat on;
            concat_unique on;
            concat_max_files 50;
            root   /home/fuqiang/dev/tuer.me/public;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            root   /home/fuqiang/dev/tuer.me/public;
            valid_referers none blocked tuer.me *.tuer.me;
            expires 30d;
            if ($invalid_referer) {
                  return 403;
            }
        }

        location ~ /images/(.*)/(.*)$ {
            default_type image/png;
            alias /home/fuqiang/dev/tuer.me/public/images/$1/$2;
        }
    }

    server {
        listen 80;
        server_name tuer.me www.tuer.me;

        charset utf-8;

        location / { 
            if ( $http_user_agent ~* "(MSIE)|(MIDP)|(WAP)|(UP.Browser)|(Smartphone)|(Obigo)|(Mobile)|(AU.Browser)|(wxd.Mms)|(WxdB.Browser)|(CLDC)|(UP.Link)|(KM.Browser)|(UCWEB)|(SEMC\-Browser)|(Mini)|(Symbian)|(Palm)|(Nokia)|(Panasonic)|(MOT\-)|(SonyEricsson)|(NEC\-)|(Alcatel)|(Ericsson)|(BENQ)|(BenQ)|(Amoisonic)|(Amoi\-)|(Capitel)|(PHILIPS)|(SAMSUNG)|(Lenovo)|(Mitsu)|(Motorola)|(SHARP)|(WAPPER)|(LG\-)|(LG/)|(EG900)|(CECT)|(Compal)|(kejian)|(Bird)|(BIRD)|(G900/V1.0)|(Arima)|(CTL)|(TDG)|(Daxian)|(DAXIAN)|(DBTEL)|(Eastcom)|(EASTCOM)|(PANTECH)|(Dopod)|(Haier)|(HAIER)|(KONKA)|(KEJIAN)|(LENOVO)|(Soutec)|(SOUTEC)|(SAGEM)|(SEC\-)|(SED\-)|(EMOL\-)|(INNO55)|(ZTE)|(Windows CE)|(Wget)|(Java)|(curl)|(Opera)" ) {
                 rewrite . http://m.tuer.me/ 
                 break; 
            }
            proxy_set_header Host $host:80;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://localhost:3000;
        }

        location ~ /avatar/(.*)$ {
            proxy_set_header Host $host:80;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://localhost:3000/user/avatar/$1;
        }
        location ~ /art/(.*)$ {
            proxy_set_header Host $host:80;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://localhost:3000/user/art/$1;
        }
    }

    server {
        listen 80;
        server_name m.tuer.me;

        charset utf-8;
        location / {
            proxy_set_header Host $host:80;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_pass http://localhost:3030;
        }
    }

./nginx -s reload 重新加载配置文件,无报错则成功。

配置mongodb,打开model目录,./mongo 127.0.0.1:10001/node-mongo-tuer init.js执行命令进行数据库初始化

请确保mongo在10001端口可访问,也可以根据配置自行修改model/base.js最后一行的ip和端口号

然后node app.js 看到服务正常启动,访问tuer.me就可以进行调试开发了。

数据库开始为空,注册需要依赖本地的sendMail,如果本机不安装sendMail,则注册,找回密码,删回复等功能会报错

可以自行注释相关代码,并在数据库中手动增加用户即可。

默认会有一个测试账户,在init.js中被添加 用户名admintest@tuer.me 密码1234qwer

配置成功之后截图如下:

成功登陆之后的样子

Something went wrong with that request. Please try again.