网站地图sitemap有两种生成方式,一种是客户端软件式的,像小爬虫之类,此类软件需要在我们的电脑上手动运行软件,通过模拟蜘蛛抓取生成一个sitemap.xml网站地图,此类方法的缺点是不能抓全网站页面,而且需要自己定时手动生成sitemap然后提交到谷歌网站管理员;另外一种在网站服务器上安装地图生成器,像google sitemap generator,它的优点是基本能抓全网站页面,而且能自动更新网站sitemap.xml并提交到google网站管理员上,可以说Google sitemap generator是一款google为广大站长制作站点地图的利器。Wordpress有一款自动更新网站地图的插件就是用google sitemap generator做的。

谷歌sitemap生成器是谷歌的一个开源产品,
地址:https://code.google.com/p/googlesitemapgenerator/

有三个服务器安装版本,for linux i386, for linux x86, for windows,需要安装在网站服务器上(共享空间的网站用户需要空间商帮忙安装),笔者以linux安装为例:

step1:

用putty SSH登陆到VPS或服务器上,下载相应版本,执行命令
下载:# wget https://googlesitemapgenerator.googlecode.com/files/sitemap_linux-i386-beta1-20091231.tar.gz
解压:# tar zxvf sitemap_linux-x86_64-beta1-20091231.tar.gz
进入安装目录:# cd sitemap-install
安装:# ./install.sh

安装命令执行后提示是否安装,Y

出现google使用说明,一路下去按空格直到又出现N/Y选项。

Do you agree with the terms of service? Yes

step 2:

这一步很关键了,请仔细阅读提示What is the location of the Apache binary or control script? [/usr/sbin/httpd]

输入 apachectl 的路径,这对应你 Apache 安装的路径。例上面的提示是[/usr/sbin/httpd]那么输入/usr/sbin/httpd回车

返回以下检测到的信息:

The following information about your Apache installation has been detected:
* Apache version: 2.2
* Apache architecture: 32 bits
* Apache root configuration file: /etc/httpd/conf/httpd.conf
* Apache group: apache
***************************************************************************
Is all of this information correct? If you answer No, installation will
terminate and you’ll need to restart the installation, using the necessary
command line options. [N/y] Y

按Y确认继续

step 3:

Google Sitemap Generator will start creating Web Sitemap files as soon as it
starts up. Do you want Google Sitemap Generator to start submitting these
files automatically? There are three options:
1. First installation. Start with automatic submission disabled.

2. First installation. Start with automatic submission enabled.

3. Reinstallation. Use the old automatic submission settings.

Specify your choice [1]:2

选第2个,第一次安装开机启动,自动生成sitemap

step 4:

提示安装升级完成,设置至少5位数密码

这时候需要重启apache服务器它才会生效,因为安全规则,默认 Google Sitemap Generator是不允许远程连接的,所以我们
进入其默认安装路径 /usr/local/google-sitemap-generator/bin
执行命令
# ./sitemap-daemon remote_admin enable
这么就能打开远程登录权限
在本地中重新输入:https://服务器IP地址:8181 即可打开远程登录页面。