CentOS
一 说明
1.材料
VMware Fusion 7 专业版 7.0.0 (2075534)
CentOS-7-x86_64-DVD-1503-01.iso
2.符号意义
#,$ 命令行
-> 步骤说明
-- 简要说明
-------------->
<-------------- 表示sql语句段落
====>
<==== 命令行输出段落
|--------------------
--------------------| vi 文本段落
二 PostGIS相关
1.PostGIS yum源
安装方式可以命令行或者官网下载rpm包安装 (dl.fedoraproject.org/pub/epel)
repos目录 /etc/yum.repos.d/
(1) yum epel源 http://mirrors.ustc.edu.cn/fedora/epel/epel-release-latest-7.noarch.rpm
->命令参考
# wget http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
# rpm -ivh epel-release-7-0.2.noarch.rpm
(2) yum pgdg源 http://yum.postgresql.org/
->命令参考
# yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
(3) yum elgis源 http://elgis.argeo.org/
2.yum安装
->查看可安装的软件版本
# yum list postgres*
# yum list postgis*
# yum list pgadmin*
安装命令类似 yum install postgresql (postgresql94, contrib, server, postgis2, pgadmin)
3.初始化
->切换到root
# su
->创建文件夹
# mkdir /opt/pgdata
->更改文件夹所有者
# chown -R postgres /opt/pgdata
->使用initdb创建db
# cd /usr/pgsql-9.4/bin
# ./initdb -D /opt/pgdata
4.修改配置文件
(1)
->改权限
# su
# chown -R apple /opt/pgdata
(2) 修改
-> postgresql.conf文件
listen_addresses ‘*’
--监听所有ip
->pg_hba.conf文件
host all all 0.0.0.0/0 md5
--配置远程连接数据库
->文件夹所有者转回postgres
# chmod -R postgres /opt/pgdata
(3) 开放5432端口
# su
# iptables -I INPUT -p tcp —dport 5432 -j ACCEPT
5.启动/关闭postgres
# su
# cd /usr/pgsql-9.4/bin
# su postgres
-- bash-4.2$
->启动
$ ./pg_ctl -D /opt/pgdata start 或者 $ ./pg_ctl -D /opt/pgdata -l logfile start
->关闭
$ ./pg_ctl -D /opt/pgdata stop
6.使用pgAdmin3 创建用户 创建数据库 表空间等 略过
7.pgAdmin3在新建的数据库testgis中添加扩展
(1) postgis扩展
pgAdmin3->sql
---------------------------->
-- Extension: postgis
-- DROP EXTENSION postgis;
CREATE EXTENSION postgis
SCHEMA public
VERSION “2.1.7”;
<----------------------------
(2) topology架构
pgAdmin->sql
-------------------------->
-- Schema: topology
-- DROP SCHEMA topology;
CREATE SCHEMA topology
AUTHORIZATION postgres;
<-------------------------
(3) postgis_topology扩展
pgAdmin3->sql
----------------------->
-- Extension: postgis_topology
-- DROP EXTENSION postgis_topology;
CREATE EXTENSION postgis_topology
SCHEMA topology
VERSION “2.1.7”;
<-----------------------
(4)tiger地理编码
-> tiger schema
------------------------->
-- Schema: tiger
-- DROP SCHEMA tiger;
CREATE SCHEMA tiger
AUTHORIZATION apple;
<------------------------
-> tiger_data schema
--------------------------->
-- Schema: tiger_data
-- DROP SCHEMA tiger_data;
CREATE SCHEMA tiger_data
AUTHORIZATION apple;
<-------------------------
-> postgis_tiger_geocoder
---------------------->
-- Extension: postgis_tiger_geocoder
-- DROP EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION postgis_tiger_geocoder
SCHEMA tiger
VERSION "2.1.5";
<----------------
->fuzzystrmatch
-------------->
-- Extension: fuzzystrmatch
-- DROP EXTENSION fuzzystrmatch;
CREATE EXTENSION fuzzystrmatch
SCHEMA public
VERSION "1.0”;
<--------------
(4) AddGeometryColumn
-------------->
select AddGeometryColumn(’test’, ‘geom’, ‘4326’, ‘POINT’, 2);
<----------
参数解释:
test->表名
geom->add geometry字段名
4326->空间参考
POINT->geometry type
2->二维
三 NodeJS相关
1.安装 nodejs官网下载tar.gz
->提取文件
# su
# tar xvf /home/apple/下载/node-v0.12.4.tar.gz
->切换目录
# cd /home/apple/node-v0.12.4/
->gcc编译
# sudo yum install gcc gcc-c++
# ./configure
# make
--等待时间有点长
->安装
# sudo make install
->检验
# node -v
====>
v0.12.4
<===
# npm -v
====>
2.10.1
<====
2.Node + Express
# npm install express
->查看已安装的模块
# npm list
====>
<====
四 WebStorm相关
1.安装
# su
# cd /home/apple/下载/
# tar xvf /home/apple/下载/WebStorm-10.0.3.tar.gz
# mv ./WebStorm10 /home/apple/myapps
五 Sublime Text 2 相关
1.安装
# su
# cd /home/apple/下载
# tar jxvf ./Sublime\ Text\ 2.0.2\ x64.tar.bz2
# mv ./Sublime\ Text\ 2 /home/apple
右键sublime_text->创建链接 拖拽到桌面
六 mongodb
1.yum repo方式
(1)设置repo
# su
# vi ./mongo-org-3.0.repo
|-----------------------
[mongodb-org-3.0]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/86_64
gpgcheck=0
enabled=1
-----------------------|
:wq
(2)安装
# su
# yum install -y mongodb-org
--安装最新版本
# semanage port -a -t mongod_port_t -p tcp 27017
(3)启动
# sudo service mongod start
# sudo chkconfig mongod on
--开机启动?
(4)关闭
# sudo service mongo stop
(5)重新启动
# sudo service mongod restart
(6)操作数据库
# su
# mongo
--启动shell
====>
MongoDB shell version 3.0.3
connecting to: test
Welcome to MongoDB shell.
…
[initandlisten]
<====
# db.users.insert({user_id:”bc123”, age:30, status:”A”})
--插入数据
====>
WriteResult({“nInserted”:1})
<====
# db.users.find()
====>
{“_Id”:ObjectId:”5574446eb34dc5ec0990789d”, “user_id”:”abc123”, “age”:30, “status”:”A”}
<====
七 redis
# yum list redis*
====>
redis.x86_64 2.8.19-2.el7
<====
# su
# yum install redis