1、安装postgresql
yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
yum install postgresql93-server
service postgresql-9.3 initdb(初始化)
chkconfig postgresql-9.3 on(加入开机自启动)
service postgresql-9.3 start(启动)
2、创建用户
sudo -u postgres createuser --superuser dbuser
sudo -u postgres psql
\password dbuser
3、允许登录和远程登录
vim /var/lib/pgsql/9.3/data/pg_hba.conf,修改内容如下:
local all all trust
host all all 127.0.0.1/32 trust
host al l all 0.0.0.0/0 md5
vi /var/lib/pgsql/9.3/data/postgresql.conf,修改内容如下:
listen_addresses = '*'
service postgresql-9.3 restart(重启)
4、安装postgis
yum install postgis2_93
su postgres
psql exampledb
CREATE EXTENSION postgis
CREATE EXTENSION postgis_topology
5、安装pgrout
yum install postgis2_93
su postgres
psql exampledb
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
6、安装map_path
mkdir source
导入map_path
cd map_path
cnpm install forever
./run.sh