Misago安装

Misago is fully featured forum application written in Python and ES6, powered by Django and React.js [http://misago-project.org](http://misago-project.org)

Documentation:  https://misago.gitbook.io/docs/

1. setup misago

pip install misago

misago-start.py misagoforumorg

2. install  PostgreSQL

2.1  download package

     from: https://ftp.postgresql.org/pub/source/

Note:这个网址有时候很快,有时候很慢

2.2 install postgresql

[root@localhost download]# tar xvf postgresql-9.4.9.tar.gz

[root@localhost download]# ls

postgresql-9.4.9  postgresql-9.4.9.tar.gz

[root@localhost postgresql-9.4.9]# ./configure --prefix=/usr/local/pgsql

[root@localhost postgresql-9.4.9]# gmake

[root@localhost postgresql-9.4.9]# gmake install

2.3 安装PG插件

[root@localhost contrib]# pwd

/root/download/postgresql-9.4.9/contrib

[root@localhost contrib]# gmake;gmake install

2.4 加载动态库

echo "/usr/local/pgsql/lib" >> /etc/ld.so.conf.d/pgsql.conf

ldconfig

2.5 创建用户postgres

[root@localhost contrib]# useradd postgres

[root@localhost contrib]# echo "postgres"|passwd --stdin postgres

Changing password for user postgres.

passwd: all authentication tokens updated successfully.

2.6 创建PG数据目录

[root@localhost contrib]# mkdir -p /data/pg/data

[root@localhost contrib]# chown -R postgres:postgres /data/pg

2.7 初始化数据库

[root@localhost contrib]# su postgres

[postgres@localhost contrib]$ /usr/local/pgsql/bin/initdb --no-locale -U postgres -E utf8 -D /data/pg/data -W

could not change directory to "/root/download/postgresql-9.4.9/contrib": Permission denied

The files belonging to this database system will be owned by user "postgres".

This user must also own the server process.

The database cluster will be initialized with locale "C".

The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /data/pg/data ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting dynamic shared memory implementation ... posix

creating configuration files ... ok

creating template1 database in /data/pg/data/base/1 ... ok

initializing pg_authid ... ok

Enter new superuser password:

Enter it again:

setting password ... ok

initializing dependencies ... ok

creating system views ... ok

loading system objects' descriptions ... ok

creating collations ... ok

creating conversions ... ok

creating dictionaries ... ok

setting privileges on built-in objects ... ok

creating information schema ... ok

loading PL/pgSQL server-side language ... ok

vacuuming database template1 ... ok

copying template1 to template0 ... ok

copying template1 to postgres ... ok

syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections

You can change this by editing pg_hba.conf or using the option -A, or

--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/local/pgsql/bin/postgres -D /data/pg/data

or

    /usr/local/pgsql/bin/pg_ctl -D /data/pg/data -l logfile start

备注

initdb [选项]... [DATADIR]

-A, --auth=METHOD 本地连接的默认认证方法

-D, --pgdata=DATADIR 当前数据库簇的位置

-E, --encoding=ENCODING 为新数据库设置默认编码

--locale=LOCALE 为新数据库设置默认语言环境

--lc-collate, --lc-ctype, --lc-messages=LOCALE

--lc-monetary, --lc-numeric, --lc-time=LOCALE

为新的数据库簇在各自的目录中分别

设定缺省语言环境(默认使用环境变

量)

--no-locale 等同于 --locale=C

--pwfile=文件名 对于新的超级用户从文件读取口令

-T, --text-search-config=CFG

缺省的文本搜索配置

-U, --username=NAME 数据库超级用户名

-W, --pwprompt 对于新的超级用户提示输入口令

-X, --xlogdir=XLOGDIR 当前事务日志目录的位置

非普通使用选项:

-d, --debug 产生大量的除错信息

-L DIRECTORY 输入文件的位置

-n, --noclean 出错后不清理

-s, --show 显示内部设置

其它选项:

-?, --help 显示此帮助, 然后退出

-V, --version 输出版本信息, 然后退出

如果没有指定数据目录, 将使用环境变量 PGDATA

2.8 配置运行环境变量(方便管理)

[postgres@localhost contrib]$ exit

exit

[root@localhost contrib]# vi /etc/profile

最后一行添加以下代码:

export PGDATA=/data/pg/data

export PATH=/usr/local/pgsql/bin:$PATH

2.9 执行生效

[root@localhost contrib]# source /etc/profile

2.10 postgresql服务管理

[root@localhost contrib]# su postgres

[postgres@localhost contrib]$ pg_ctl start -D /data/pg/data

could not change directory to "/root/download/postgresql-9.4.9/contrib": Permission denied

server starting

[postgres@localhost contrib]$ LOG:  database system was shut down at 2018-08-01 06:45:58 EDT

LOG:  MultiXact member wraparound protections are now enabled

LOG:  database system is ready to accept connections

LOG:  autovacuum launcher started

[postgres@localhost ~]$ ps -ef|grep postgres

root      31261  31181  0 06:48 pts/0    00:00:00 su postgres

postgres  31262  31261  0 06:48 pts/0    00:00:00 bash

postgres  31277      1  0 06:48 pts/0    00:00:00 /usr/local/pgsql/bin/postgres -D /data/pg/data

postgres  31279  31277  0 06:48 ?        00:00:00 postgres: checkpointer process 

postgres  31280  31277  0 06:48 ?        00:00:00 postgres: writer process 

postgres  31281  31277  0 06:48 ?        00:00:00 postgres: wal writer process 

postgres  31282  31277  0 06:48 ?        00:00:00 postgres: autovacuum launcher process 

postgres  31283  31277  0 06:48 ?        00:00:00 postgres: stats collector process 

postgres  31284  31262  0 06:49 pts/0    00:00:00 ps -ef

postgres  31285  31262  0 06:49 pts/0    00:00:00 grep --color=auto postgres

2.11 创建database misago

[postgres@localhost ~]$ psql -U postgres -w postgres

psql (9.4.9)

Type "help" for help.

postgres=# create database misago;

CREATE DATABASE

3 修改配置文件( DATABASES part)

/root/misagoforumorg/misagoforumorg/settings.py:

DATABASES = {

    'default': {

        # Misago requires PostgreSQL to run

        'ENGINE': 'django.db.backends.postgresql',

        'NAME': 'misago',

        'USER': 'postgres',

        'PASSWORD': 'postgres',

        'HOST': 'localhost',

        'PORT': 5432,

    }

}

4. migrate数据库

(my_env) [root@localhost misagoforumorg]# python manage.py migrate

Operations to perform:

  Apply all migrations: admin, auth, contenttypes, misago_acl, misago_categories, misago_conf, misago_core, misago_legal, misago_readtracker, misago_threads, misago_users, sessions, social_django

Running migrations:

  Applying misago_acl.0001_initial... OK

  Applying contenttypes.0001_initial... OK

  Applying auth.0001_initial... OK

  Applying misago_users.0001_initial... OK

  Applying admin.0001_initial... OK

  Applying admin.0002_logentry_remove_auto_add... OK

  Applying contenttypes.0002_remove_content_type_name... OK

  Applying auth.0002_alter_permission_name_max_length... OK

  Applying auth.0003_alter_user_email_max_length... OK

  Applying auth.0004_alter_user_username_opts... OK

  Applying auth.0005_alter_user_last_login_null... OK

  Applying auth.0006_require_contenttypes_0002... OK

  Applying auth.0007_alter_validators_add_error_messages... OK

  Applying auth.0008_alter_user_username_max_length... OK

  Applying misago_core.0001_initial... OK

  Applying misago_acl.0002_acl_version_tracker... OK

  Applying misago_acl.0003_default_roles... OK

  Applying misago_categories.0001_initial... OK

  Applying misago_threads.0001_initial... OK

  Applying misago_categories.0002_default_categories... OK

  Applying misago_categories.0003_categories_roles... OK

  Applying misago_categories.0004_category_last_thread... OK

  Applying misago_categories.0005_auto_20170303_2027... OK

  Applying misago_categories.0006_moderation_queue_roles... OK

  Applying misago_categories.0007_best_answers_roles... OK

  Applying misago_conf.0001_initial... OK

  Applying misago_core.0002_basic_settings... OK

  Applying misago_legal.0001_initial... OK

  Applying misago_threads.0002_threads_settings... OK

  Applying misago_threads.0003_attachment_types... OK

  Applying misago_threads.0004_update_settings... OK

  Applying misago_threads.0005_index_search_document... OK

  Applying misago_threads.0006_redo_partial_indexes... OK

  Applying misago_readtracker.0001_initial... OK

  Applying misago_readtracker.0002_postread... OK

  Applying misago_readtracker.0003_migrate_reads_to_posts... OK

  Applying misago_readtracker.0004_auto_20171015_2010... OK

  Applying misago_threads.0007_auto_20171008_0131... OK

  Applying misago_threads.0008_auto_20180310_2234... OK

  Applying misago_threads.0009_auto_20180326_0010... OK

  Applying misago_users.0002_users_settings... OK

  Applying misago_users.0003_bans_version_tracker... OK

  Applying misago_users.0004_default_ranks... OK

  Applying misago_users.0005_dj_19_update... OK

  Applying misago_users.0006_update_settings... OK

  Applying misago_users.0007_auto_20170219_1639... OK

  Applying misago_users.0008_ban_registration_only... OK

  Applying misago_users.0009_redo_partial_indexes... OK

  Applying misago_users.0010_user_profile_fields... OK

  Applying misago_users.0011_auto_20180331_2208... OK

  Applying sessions.0001_initial... OK

  Applying social_django.0001_initial... OK

  Applying social_django.0002_add_related_name... OK

  Applying social_django.0003_alter_email_max_length... OK

  Applying social_django.0004_auto_20160423_0400... OK

  Applying social_django.0005_auto_20160727_2333... OK

  Applying social_django.0006_partial... OK

  Applying social_django.0007_code_timestamp... OK

  Applying social_django.0008_partial_timestamp... OK

5 create a super admin in database:

(my_env) [root@localhost misagoforumorg]# python manage.py createsuperuser

Enter displayed username: admin

Enter E-mail address: ****8260@qq.com

Enter password:q******4

Repeat password:q******4

Superuser #1 has been created successfully.

6 start misago

(my_env) [root@localhost misagoforumorg]# python manage.py runserver 192.168.58.139:8000

Performing system checks...

System check identified no issues (0 silenced).

August 01, 2018 - 13:10:57

Django version 1.11.14, using settings 'misagoforumorg.settings'

Starting development server at http://192.168.58.139:8000/

Quit the server with CONTROL-C.


now from browser, you can browse the misago

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,569评论 4 363
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,499评论 1 294
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,271评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,087评论 0 209
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,474评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,670评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,911评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,636评论 0 202
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,397评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,607评论 2 246
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,093评论 1 261
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,418评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,074评论 3 237
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,092评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,865评论 0 196
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,726评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,627评论 2 270

推荐阅读更多精彩内容