Centos下安装erlang+postgresql+Zotonic
1.首先Centos要连上网,centos联网设置连接如下:http://jingyan.baidu.com/album/90808022dc25a1fd91c80fa5.html
2.erlang安装:
1. 安装依赖包
# yum install libGLU-devel
2. 安装 wxGTK
# wget http://prdownloads.sourceforge.net/wxwindows/wxGTK-2.8.12.tar.gz
# tar zxf wxGTK-2.8.12.tar.gz
# ./configure --with-opengl --enable-unicode --enable-graphics_ctx --enable-gnomeprint
# make
# make install
# cd contrib/src/stc
# make
# make install
3. erlang安装:http://blog.csdn.net/chszs/article/details/28638305
修改 /etc/profile
export PATH=/home/erlang/bin:$PATH
完成后保存
source /etc/profile 让环境变量立即生效
然后输入erl
出现erlang shell就说明你的erlang安装成功了
3.postgresql安装:
(1)安装 Postgresql
# wget http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
# rpm –ivh pgdg-centos93-9.3-1.noarch.rpm
# yum install postgresql93 postgresql93-server postgresql93-contrib
# su – postgres
# /usr/pgsql-9.3/bin/initdb -E UTF8 -D /var/lib/pgsql/9.3/data/
# rm /usr/bin/psql
# ln -s /usr/pgsql-9.3/bin/psql /usr/bin/psql
# ln -s /usr/pgsql-9.3/bin/pg_restore /usr/bin/pg_restore
# ln -s /usr/pgsql-9.3/bin/pg_dump /usr/bin/pg_dump
备份:
# pg_dump -h 127.0.0.1 -p 5432 -U qsdata -W -F c -C -v -i -f "20140125.backup" qsdata
恢复:
# pg_restore -h 127.0.0.1 -p 5432 -U qsdata -d qsdata -v “20140125.backup”
(2)配置 Postgresql
1. 修改配置文件,运行远程连接 postgresql
# emacs /var/lib/pgsql/9.3/data/postgresql.conf
去掉#listen_addresses = 'localhost'前面的#号,修改为:listen_addresses = '*'
2. 添加 qsdata 用户权限,并允许远程连接(Zotonic 配置部分说明新建该用户并建立数
据库、导入数据)
# emacs /var/lib/pgsql/9.3/data/pg_hba.conf
添加:
host qsdata qsdata 0.0.0.0/0 trust
4.安装 配置 Zotonic
(1)安装ImageMagick
# wget http://www.imagemagick.org/download/ImageMagick.tar.gz
# tar zxf ImageMagick.tar.gz
# cd ImageMagick-6.8.8-1
# ./configure
# make
# make install
# ldconfig /usr/local/lib
(2)安装Zotnic
http://zotonic.com/docs/0.12/installation/install.html#installation-install