如何安装opam并安装静态博客程序

如何安装opam并安装静态博客程序,第1张

$ wget http://www.ocamlpro.com/pub/opam_installer.sh

$ sh opam_installer.sh /usr/local/bin

最后提示:

During this initialisation, you can allow OPAM to add information to two

other files for best results. You can also make theseadditions manually

if you wish.

If you agree, OPAM will modify:

– ~/.bashrc (or a file you specify) to set the right environment

variables and to load the auto-completion scripts for your shell (bash)

on startup. Specifically, it checks for and appends the following line:

. ~/.opam/opam-init/init.sh >/dev/null 2>/dev/null || true

– ~/.ocamlinit to ensure that non-system installations of `ocamlfind`

(i.e. those installed by OPAM) will work correctly when running the

OCaml toplevel. It does this by adding $OCAML_TOPLEVEL_PATH to the list

of include directories.

If you choose to not configure your system now, you can either configure

OPAM manually (instructions will be displayed) or launch the automatic setup

later by running:

`opam config setup -a`.

Do you want OPAM to modify ~/.bashrc and ~/.ocamlinit?

(default is ‘no’, use ‘f’ to name a file other than ~/.bashrc)

[N/y/f] f /etc/profile

1. To configure OPAM in the current shell session, you need to run:

eval `opam config env`

2. To correctly configure OPAM for subsequent use, add the following

line to your profile file (for instance ~/.bashrc):

. /root/.opam/opam-init/init.sh >/dev/null 2>/dev/null || true

3. To avoid issues related to non-system installations of `ocamlfind`

add the following lines to ~/.ocamlinit (create it if necessary):

let () =

try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")

with Not_found ->()

To use OCaml installed by OPAM, use

eval `opam config env`

as3:~#

as3:~# ocaml -version

The OCaml toplevel, version 4.01.0

as3:~#

as3:~# opam –version

1.1.0

装完opam后,

opam update

opam install stog (这样就装好了stog)

(具体为:

as3:~# opam update

defaultDownloading https://opam.ocaml.org/urls.txt

defaultDownloading https://opam.ocaml.org/index.tar.gz

Updating ~/.opam/repo/compiler-index …

Updating ~/.opam/compilers/ …

Updating ~/.opam/repo/package-index …

Updating ~/.opam/packages/ …

Updating the cache of metadata (~/.opam/state.cache) …

Everything is up-to-date.

as3:~# opam install stog

The following actions will be performed:

– install ocamlfind.1.4.0 [required by stog]

– install config-file.1.1 [required by stog]

– install ocamlnet.3.7.3 [required by stog]

– install xmlm.1.2.0 [required by stog]

– install ocamlrss.2.2.2 [required by stog]

– install xtmpl.0.7 [required by stog]

– install stog.0.9.0

7 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

Do you want to continue ? [Y/n] y

=-=-= Installing ocamlfind.1.4.0 =-=-=

ocamlfind.1.4.0 Downloading http://pkgs.fedoraproject.org/lookaside/extras/ocaml-findlib/findlib

-1.4.tar.gz/5d1f8238c53964fdd14387b87b48b5d9/findlib-1.4.tar.gz

Copying ~/.opam/repo/default/packages//ocamlfind/ocamlfind.1.4.0/files/ocamlfind.install to

~/.opam/4.01.0/build/ocamlfind.1.4.0/

Building ocamlfind.1.4.0:

./configure -bindir /root/.opam/4.01.0/bin -sitelib /root/.opam/4.01.0/lib -mandir

/root/.opam/4.01.0/man -config /root/.opam/4.01.0/lib/findlib.conf

make all

make opt

make install

Installing ocamlfind.1.4.0.

=-=-= Installing config-file.1.1 =-=-=

config-file.1.1 Downloading https://forge.ocamlcore.org/frs/download.php/845/config-file-

1.1.tar.gz

Building config-file.1.1:

./configure –prefix /root/.opam/4.01.0

make all

make install

Installing config-file.1.1.

=-=-= Installing ocamlnet.3.7.3 =-=-=

ocamlnet.3.7.3 Downloading http://download.camlcity.org/download/ocamlnet-3.7.3.tar.gz

Copying ~/.opam/repo/default/packages//ocamlnet/ocamlnet.3.7.3/files/ocamlnet.install to

~/.opam/4.01.0/build/ocamlnet.3.7.3/

Building ocamlnet.3.7.3:

./configure -bindir /root/.opam/4.01.0/bin -disable-pcre -disable-gtk2 -disable-ssl -disable-

zip -disable-crypto -with-nethttpd

make all

make opt

make install

Installing ocamlnet.3.7.3.

=-=-= Installing xmlm.1.2.0 =-=-=

xmlm.1.2.0 Downloading http://erratique.ch/software/xmlm/releases/xmlm-1.2.0.tbz

Building xmlm.1.2.0:

./pkg/pkg-git

./pkg/build true

Installing xmlm.1.2.0.

[WARNING] unknown fields in /root/.opam/4.01.0/build/xmlm.1.2.0/xmlm.install: is your OPAM up-to

-date ?

=-=-= Installing ocamlrss.2.2.2 =-=-=

ocamlrss.2.2.2 Downloading http://zoggy.github.io/ocamlrss/ocamlrss-2.2.2.tar.gz

Building ocamlrss.2.2.2:

make

make install

Installing ocamlrss.2.2.2.

=-=-= Installing xtmpl.0.7 =-=-=

xtmpl.0.7 Downloading http://zoggy.github.com/xtmpl/xtmpl-0.7.tar.gz

Building xtmpl.0.7:

make all

make install

Installing xtmpl.0.7.

=-=-= Installing stog.0.9.0 =-=-=

stog.0.9.0 Downloading http://zoggy.github.com/stog/stog-0.9.0.tar.gz

Copying ~/.opam/repo/default/packages//stog/stog.0.9.0/files/stog.install to

~/.opam/4.01.0/build/stog.0.9.0/

Building stog.0.9.0:

make all

make install-lib

Installing stog.0.9.0.

as3:~#)

项目地址:https://github.com/zoggy/stog

http://zoggy.github.io/stog/

PMBLOG是一个简单的静态博客程序,只需要PHP,不需要数据库的支持,这对于小内存小功耗的路由来说是再友好不过的。下面我就讲讲如何安装PMBLOG。

首先我们需要下载PHP及其相关的一些扩展。

opkg update

opkg install php5 php5-cgi php5-mod-mcrypt php5-mod-curl php5-mod-hash php5-mod-json

配置PHP《参考文献:http://houdunwang.com/lesson.html》

编辑php.ini文件

vi /etc/php.ini

其中将

extension = ctype.so

extension = curl.so

extension = hash.so

extension = json.so

三个前面的去掉,用以启用扩展

并将date.timezone =修改为date.timezone = Asia/Shanghai,并将doc_root="/www"修改为doc_root="/www/root"。

如果你没有设置过系统时区的话还需要设置系统时区。打开LUCI界面,进入系统 - 系统属性 - 基本设置中将时区改为Asia/Shanghai。

最后你需要安装一个时区信息软件包,否则系统无法识别时区。

opkg install zoneinfo-asia

uhttpd配置端口转发

接着需要配置端口转发。由于默认的是LUCI占用80端口,但我比较喜欢80端口放网站,所以我将LUCI挪到了8080端口,而PHP则使用80端口。

vi /etc/config/uhttpd

将第5行的0.0.0.0:80修改为0.0.0.0:8080,

option rfc1918_filter 1这一句在前面加上#号注其实都很简单的,只要你用心学,多在后盾人平台看看教材,慢慢的就都会了

wp是我用过最强大的博客程序,没有之一。但随着它的进步与个人的发展和需求变化,我也不得不开始换用其他的程序来作为替代,这里分享下个人的想法。我寻找wp替代品,可以说是需求的变化。1.写作需求从一个曾经为追姑娘写脑残日记的二逼青年到现在实习伪FEEer,写作中更多的偏向于简单的一二级标题,列表和代码块,写作内容主要为代码及相关的说明注释,选择了md进行日常书写格式,故而选择了hexo进行静态站生成并存放在github上。2.功能需求wp可定制性极高,可以快速方便的进行内容输出,但是作为管理系统,二次开发成本过高(需要了解一些列的语法,钩子),而我需要的主要是一些数据和部分文章,故而采用golang做了api系统,为个人需求提供数据并进行一些列数据 *** 作。上述两点是我更换wp的原因,同时也是选择的依据,推荐如下:1.动态博客php. wp,emblog,typechonodejs. ghost2.静态博客hexo(简单,易用)octpress3.社区系统bbpress(已经可以作为wp插件使用)discuzgopher等(go的还是自行开发比较好)4.内容管理joomladrupal


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/11575267.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-17
下一篇2023-05-17

发表评论

登录后才能评论

评论列表(0条)

    保存