MapServer linux上劳动安装


大纲

一.下载职业版:pycharm-professional-20一七.3.叁.exe

新建mapserver用户

图片 1

新建map server用户//密码123456

1.安装gcc编译器

2.安装Pycharm

安装相关重视

  • gcc-c++
    查询gcc-c++是还是不是安装:
    rpm -qa | grep gcc-c++

    图片 2

    查询gcc-c++是否安装

安装gcc-c++:  
`yum -y install gcc-c++`  

![](https://upload-images.jianshu.io/upload_images/2279108-251c61c2a8631f9b.png)

安装gcc-c++
  • gcc cmake curl
    安装gcc cmake curl:
    yum -y install gcc cmake curl curl-devel
    部分lib已安装,不会再度设置。

图片 3

安装gcc cmake curl

  • 设置cgi相关进展注重:

yum -y install libpng libpng-devel freetypegd gd-devel zlib zlib-devel 
giflib giflib-devel readline readline-devel libxml2 libxml2-devel 
libtiff libtiff-devel libjpeg libjpeg-devel libgeotiff 

图片 4

cgi重视安装part-1

图片 5

cgi信Ryan装part-2

图片 6

cgi注重安装part-三

  • 安装cairo 2D图形库:
    yum -y install cairo cairo-devel

图片 7

cairo安装-part1

图片 8

cairo安装-part2

  • PostGis安装
    亟待先安装postgresql数据库参考:
    PostGIS安装参考

图片 9

postgis安装

  • sqlite 安装
    yum -y install sqlite sqlite-devel

图片 10

sqlite安装-part1

图片 11

sqlite安装-part2

  • httpd web server 安装

yum -y install httpd httpd-devel fcgi fcgi-devel mod_fcgid

图片 12

webServer安装-part1

图片 13

WebServer安装-part2

  • 安装GIS相关库

yum -y install gdal gdal-devel geos geos-devel proj proj-devel

图片 14

按章GIS相关lib-part1

图片 15

安装GIS相关lib-part2

  • 安装SWIG
    yum -y install swig swig-devel

图片 16

SWIG安装

  • 安装python
    yum -y install python python-devel

图片 17

python安装-part1

图片 18

python安装-part2

  • MapCache安装
    获取mapcache:
    wget http://download.osgeo.org/mapservehttp://download.osgeo.org/mapserver/mapcache-1.4.1.tar.gzr/mapcache-1.4.1.tar.gz

图片 19

下载MapCache 以及MapServer安装源代码

tar -xvf  mapcache-1.4.1.tar.gz
...
cd  mapcache-1.4.1
mkdir build 
cd build 
cmake ..
make 
make install

图片 20

mapcache安装-part1

图片 21

mapcache安装-part2

图片 22

mapcache安装-part2

图片 23

mapcache安装-part3

图片 24

mapcache安装-part4

  • MapServer安装
    下载MapServer 7.0.1
    wget http://download.osgeo.org/mapserver/mapserver-7.0.1.tar.gz
    安装:

tar -xvf mapserver-7.0.1.tar.gz
cd mapserver-7.0.1
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt -DCMAKE_PREFIX_PATH=/usr/pgsql-9.6:/usr/share:/usr/lib64:/usr/lib64/python2.6:/usr/local:/opt -DWITH_CLIENT_WFS=ON  -DWITH_CLIENT_WMS=ON  -DWITH_CURL=ON  -DWITH_SOS=ON  -DWITH_PHP=OFF  -DWITH_PERL=ON  -DWITH_RUBY=OFF  -DWITH_JAVA=OFF  -DWITH_CSHARP=OFF  -DWITH_PYTHON=ON  -DWITH_SVGCAIRO=OFF  -DWITH_ORACLESPATIAL=OFF  -DWITH_MSSQL2008=OFF -DWITH_FRIBIDI=0 -DWITH_LIBXML2=1 -DWITH_HARFBUZZ=0 -DWITHCAIRO=0  -DWITH_POSTGIS=0 -DWITH_CAIRO=0  ../>../configure.out.txt

图片 25

MapServer cmake

图片 26

MapServer安装-part1

图片 27

MapServer安装-part2

图片 28

MapServer安装-part3

图片 29

MapServer安装-part4

图片 30

MapServer安装-part5

图片 31

MapServer安装-part6

图片 32

MapServer安装-part7

图片 33

MapServer安装-part8

图片 34

MapServer安装-part9

图片 35

MapServer安装-part10

图片 36

MapServer安装-part11

2.卸载rpm安装的http和mysql软件

图片 37

配置Web service CGI

拷贝libmapcache.so 与 libmapcache.so.1

[root@localhost lib64]# cp /usr/local/lib/libmapcache.so
libmapcache.so        libmapcache.so.1      libmapcache.so.1.4.1  
[root@localhost lib64]# cp /usr/local/lib/libmapcache.so /usr/lib64/
[root@localhost lib64]# cp /usr/local/lib/libmapcache.so.1 /usr/lib64/
  • 拷贝注重
![](https://upload-images.jianshu.io/upload_images/2279108-dd683bad6d1cbc9e.png)

拷贝libmapcache
  • 创办图片缓存目录
    ·

[root@localhost mapserver]# mkdir -p /home/mapserver/ms_data/cache
[root@localhost mapserver]# cp /usr/local/package/mapcache-1.4.1/mapcache.xml /home/mapserver/ms_data/cache/
  • 配置httpd module

vi /etc/httpd/conf/httpd.conf

图片 38

配置httpd module

  • 拷贝map server依赖

[root@localhost cache]# cd /opt/lib/
[root@localhost lib]# ll
总用量 4128
lrwxrwxrwx. 1 root root      16 10月 17 18:16 libmapcache.so -> libmapcache.so.1
lrwxrwxrwx. 1 root root      20 10月 17 18:16 libmapcache.so.1 -> libmapcache.so.1.4.1
-rwxr-xr-x. 1 root root  421474 10月 17 18:02 libmapcache.so.1.4.1
lrwxrwxrwx. 1 root root      17 10月 17 18:21 libmapserver.so -> libmapserver.so.2
lrwxrwxrwx. 1 root root      21 10月 17 18:21 libmapserver.so.2 -> libmapserver.so.7.0.1
-rwxr-xr-x. 1 root root 3802833 10月 17 18:21 libmapserver.so.7.0.1
[root@localhost lib]# cp /opt/lib/libmapserver.so /usr/local/lib/
[root@localhost lib]# cp /opt/lib/libmapserver.so.2 /usr/local/lib/
[root@localhost lib]# cp /opt/lib/libmapserver.so.7.0.1 /usr/local/lib/
[root@localhost lib]# cd /usr/local/lib
[root@localhost lib]# ll | grep libmap
lrwxrwxrwx. 1 root root      16 10月 17 18:02 libmapcache.so -> libmapcache.so.1
lrwxrwxrwx. 1 root root      20 10月 17 18:02 libmapcache.so.1 -> libmapcache.so.1.4.1
-rwxr-xr-x. 1 root root  421474 10月 17 18:17 libmapcache.so.1.4.1
-rwxr-xr-x. 1 root root 3802833 10月 17 18:51 libmapserver.so
-rwxr-xr-x. 1 root root 3802833 10月 17 18:51 libmapserver.so.2
-rwxr-xr-x. 1 root root 3802833 10月 17 18:51 libmapserver.so.7.0.1
[root@localhost lib]# cp /usr/local/package/mapserver-7.0.1/build/mapserv /var/www/cgi-bin/
[root@localhost lib]# cd /var/www/cgi-bin/
[root@localhost cgi-bin]# ll
总用量 16
-rwxr-xr-x. 1 root root 13630 10月 17 18:53 mapserv

图片 39

拷贝map server依赖

图片 40

拷贝CGI

三.编写翻译安装php依赖包

图片 41

4.安装apache软件

 

5.安装mysql软件

图片 42

6.安装php软件

图片 43

7.安装memcache
php模块软件

等待安装到位

八.装置pdo
mysql模块软件

3.激活用到

9.安装zend加速器

  获取密钥

拾.设置memcache服务器软件

如下:

 

D87IQPUU3Q-eyJsaWNlbnNlSWQiOiJEODdJUVBVVTNRIiwibGljZW5zZWVOYW1lIjoiTnNzIEltIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMDItMDcifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTktMDItMDcifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOS0wMi0wNyJ9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDE5LTAyLTA3In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMTktMDItMDcifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOS0wMi0wNyJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE5LTAyLTA3In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjIwMTktMDItMDcifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxOS0wMi0wNyJ9LHsiY29kZSI6IkFDIiwicGFpZFVwVG8iOiIyMDE5LTAyLTA3In0seyJjb2RlIjoiRFBOIiwicGFpZFVwVG8iOiIyMDE5LTAyLTA3In0seyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMTktMD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44

1、安装编写翻译工具gcc、gcc-c++、make

4.字体调解

 

图片 45

注意化解注重关系,推荐使用yum安装,若不可能联网可使用安装光盘做为yum源

 

壹)编辑yum配置文件:

1
2
3
4
5
6
7
8
9
10
Mount /dev/cdrom /media
vi /etc/yum.repos.d/CentOS-Media.repo
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media
//修改为光盘挂载点
enabled=1
//改为1意为启用
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

2)设置alias值:

1
2
3
4
Vi /etc/bashrc
alias yum="yum --disablerepo=\* --enablerepo=c5-media"
3)依次安装gcc、gcc-c++
Yum -y install gcc*

 

二、卸载系统Apache、MySQL和PHP的RPM安装包

 

1
2
3
4
5
6
7
下载前需关闭启动的服务,如httpd、mysqld
service httpd stop
service mysqld stop
卸载RPM包的Apache、MySQL、PHP
yum remove httpd
yum remove mysql
建议使用rpm –e http-1.2.3.rpm --nodeps (截断这个rpm包的依赖性)

 

③、关闭SELinux,允许防火墙80端口访问

 

1
2
3
1)关闭SELinux
vi /etc/selinux/config
SELINUX=disabled

若安装时未有禁止使用SELinux,将enforcing改为disabled,修改后需重新起动Linux方可生效!

二)关闭防火墙Netfilter/iptables

因未有做防火墙讲明,直接省略的关门全部防火墙设置:

1
2
iptables -F * 如果没有禁用防火墙,默认80端口禁止访问
service iptables save 防火墙策略写到/etc/sysconfig/iptables,以后计算机重启再加载这个文件时,防火墙策略就会永久清空.

 

四、编写翻译安装php重视包

 

各类源码包配置编写翻译安装达成后,确认安装目录下是还是不是变动安装文件

 

#
安装libxml2

1
2
3
4
cd /lamp/libxml2-2.6.30
./configure --prefix=/usr/local/libxml2/
make
make install

 

#
安装libmcrypt

1
2
3
4
cd /lamp/libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt/
make
make install

需调用gcc-c++编写翻译器,未安装会报错

 

#
安装libltdl,也在libmcrypt源码目录中,非新软件

1
2
3
4
cd /lamp/libmcrypt-2.5.8/libltdl
./configure --enable-ltdl-install
make
make install

 

#
安装zlib

1
2
3
4
cd /lamp/zlib-1.2.3
./configure
make
make install

zlib指定安装目录恐怕导致libpng安装退步,故不钦赐,为卸载方便,建议make
install实行结果输出到安装日志文件,便于日后卸载

 

#
安装libpng

1
2
3
4
cd /lamp/libpng-1.2.31
./configure --prefix=/usr/local/libpng/
make
make install

 

#
安装jpeg6

1
2
3
4
5
6
7
8
9
10
mkdir /usr/local/jpeg6
mkdir /usr/local/jpeg6/bin
mkdir /usr/local/jpeg6/lib
mkdir /usr/local/jpeg6/include
mkdir -p /usr/local/jpeg6/man/man1
cd /lamp/jpeg-6b
./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static
make
make install
--enable-shared与--enable-static  参数分别为建立共享库和静态库使用的libtool

 

#
安装freetype

1
2
3
4
cd /lamp/freetype-2.3.5
./configure --prefix=/usr/local/freetype/
make
make install

 

#
安装autoconf

1
2
3
4
cd /lamp/autoconf-2.61
./configure
make
make install

#
安装GD库

1
2
3
4
5
6
7
8
9
10
11
12
mkdir /usr/local/gd2
cd /lamp/gd-2.0.35
#png错误,修改方法:
vi gd_png.c
#include “png.h”替换
#include "/usr/local/libpng/include/png.h"
./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/ --with-freetype=/usr/local/freetype/
--with-png=/usr/local/libpng/
Make
#如果出现错误,把上面的两步重新执行一次.
make install
若前面配置zlib时没有指定安装目录,gd配置时不要添加--with-zlib=/usr/local/zlib/参数

 

#
安装Apache

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cd /lamp/httpd-2.2.9
./configure --prefix=/usr/local/apache2/ --sysconfdir=/usr/local/apache2/etc/ --with-included-apr --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared
make
make install
启动Apache测试:
/usr/local/apache2/bin/apachectl restart
查看进程:
ps -le | grep httpd
查看apache模块:
/usr/local/apache2/bin/apachectl –h
#share 动态模块或动态库文件
Php5 rewrite
#static 静态模块或表态库文件
Server-status
Userdir
Virtual host
测试:
http://localhost/index.html
“it works”
设置Apache随机启动
Vi /etc/rc.local
/usr/local/apache2/bin/apachectl restart

 

#
安装ncurses

1
2
3
4
5
6
7
1.yum –y install ncurses*
2.源代码编译:
cd /lamp/ncurses-5.6
./configure --with-shared --without-debug --without-ada --enable-overwrite
make
make install
若不安装ncurses编译MySQL时会报错

 

5、安装MySQL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
useradd mysql
添加用户组mysql ,将mysql用户默认组设置为mysql用户组
cd /lamp/mysql-5.0.41
./configure --prefix=/usr/local/mysql --without-debug --enable-thread-safe-client --with-pthread --enable-assembler --enable-profiling --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-extra-charsets=all --with-plugins=all --with-mysqld-user=mysql --without-embedded-server --with-server-suffix=-community --with-unix-socket-path=/tmp/mysql.sock
make
make install
--with-extra-charsets=all参数为安装所有字符集
#如果不行的话,make clean 后再make ;make install,这样去试一下,默认是不支持innodb存储引擎的.其中--with-plugins=all可以把innodb加载进来.
1.cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
修改mysql配置文件
1.[client]
default-character-set=utf8
#客户端字符集
#连接字符集
2.[ mysqld]
character-set-server = utf8
#服务器字符集
#数据库字符集
collation-server = utf8_general_ci
#服务器,库,表的校验字符集
#default-storage-engine=innodb
#把默认的表引擎改为innodb
生成MySQL配置文件
Setfacl –m u:mysql:rwx –R /usr/local/mysql
Setfacl –m d:u:mysql:rwx –R /usr/local/mysql
用acl来让mysql用户对/usr/local/mysql有所有权限
/usr/local/mysql/bin/mysql_install_db --user=mysql
创建数据库授权表
启动MySQL服务
1.用原本源代码的方式去使用和启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
2.重启以后还要生效:
Vi /etc/rc.local
/usr/local/mysql/bin/mysqld_safe --user=mysql &
4./usr/local/mysql/bin/mysqladmin -uroot password kkk
#给mysql用户root加密码.密码为kkk
/usr/local/mysql/bin/mysql -u root -pkkk test
mysql>show databases;
mysql>use test
mysql>show tables;
#进入mysql以后用set来改密码.
mysql> exit
登录MySQL客户端控制台设置指定root密码

 

6、安装PHP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
编译前确保系统已经安装了libtool和libtool-ltdl软件包,若没有安装使用yum或rpm安装下:
yum install libtool*
yum install libtool-ltdl*
cd /lamp/php-5.2.6
./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets
若前面配置zlib时没有指定安装目录,PHP配置时不要添加--with-zlib-dir=/usr/local/zlib/参数
make
make install
生成php.ini(php的配置文件)
cp /lamp/php-5.2.6/php.ini-dist /usr/local/php/etc/php.ini
测试apache与php的连通性,看apache是否能解析php文件
让apache支持php代码 :
vi /usr/local/apache2/etc/httpd.conf
AddType application/x-httpd-php .php .phps
重启Apache服务:
/usr/local/apache2/bin/apachectl restart
测试:vi /usr/local/apache2/htdocs/test.php
<?php
phpinfo();
?>
通过浏览器测试:
http://localhost/test.php

 

7、编写翻译安装memcache模块

1
2
3
4
5
tar zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

 

8、编写翻译安装
PDO_MYSQL

1
2
3
4
5
6
7
8
9
10
11
tar zxvf /lamp/PDO_MYSQL-1.0.2.tgz
cd /lamp/PDO_MYSQL-1.0.2/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql
make && make install
修改php.ini
extension_dir = "/usr/local/php//lib/php/extensions/no-debug-non-zts-20060613/"
extension="memcache.so";
extension="pdo_mysql.so";
修改php文件生效:
/usr/local/apache2/bin/apachectl restart

 

9、安装Zend加速器

1
2
cd /lamp/ZendOptimizer-3.2.6-linux-glibc21-i386
./install.sh

 

十、安装memcache服务器软件

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
http://memcached.googlecode.com/files/memcached-1.4.10.tar.gz
首先安装依赖包libevent
yum –y install libevent*
#主包已经安装,别忘记安装libevent-devel*,不然./configure过不去
Tar xzf /lamp/memcached-1.4.10.tar.gz
Cd /lamp/memcached-1.4.10
./configure --prefix=/usr/local/memcache
Make && make install
Useradd memcache
#因为系统不能用root运行memcache软件
/usr/local/memcache/bin/memcached -umemcache & #后台运行
Netstat –tunpl|grep :11211
telnet 192.168.10.1 11211
stats
写入自启动:
Vi /etc/rc.local
/usr/local/memcache/bin/memcached -umemcache &
#如何杀掉后台进程,用kill %1,查看进程用jobs

相关文章