#1
|
|||
|
|||
有熟悉python 的吗? 问一个建立google sitemap 的问题
因为sitemap 需要运行一个python 命令
所以我给我的虚拟主机客服写了一封信问了一下 下面是他们的回复 We support python on all levels of hosting so that should work (if it involves php calling files by their URL/http:// that will fail though as that is disabled... it's just a guess as to what might be happening if you tried to install and run it). 看来这个主机是支持python 的 想知道的是怎么运行这个命令呢? 下面是g sitemap 的安装步骤: 下载 Sitemaps 生成器程序文件。将这些文件解压缩到本地目录。 使用提供的 example_config.xml 文件作为模板,为您的网站创建配置文件。根据需要为网 站修改此文件,然后保存。 将必要的文件上传到您的 Web 服务器。 运行 sitemap_gen.py。 添加生成的 Sitemaps 到您的 Google Sitemaps 帐户。 设置递归脚本。(可选) 我没有用过python 是不是需要像shell 那样安装一个客户端? 哪位大大做过sitemap 能不能指点一下 -- |
#3
|
|||
|
|||
谢谢..
知道了现在 用ssh, 就是shell 的客户端就能运行python 命令 不过出错了还是 就是显示不能写文件 这个已经写信向主机商问了 |
#4
|
||||
|
||||
要快速制作一般網站的sitemap可參考:
http://www.webmasterclub.org/showthread.php?t=96 要製作vBulletin論壇的sitemap可參考: http://www.webmasterclub.org/showthread.php?t=110 |
#5
|
|||
|
|||
看看你的 config.xml (或設定檔名) 是否設定正確 (sitemap.xml 的路徑、取得資料的方式 (log 或原有的 sitemap)),再來 sitemap.xml 要在網頁根目錄。
引用:
|
#6
|
|||
|
|||
引用:
显示结果是下面这样: [beaudry]$ python sitemap_gen.py --config=config.xml Reading configuration file: config.xml Walking DIRECTORY "/" Sorting and normalizing collected URLs. Writing Sitemap file "/sitemap.xml" with 50000 URLs [FATAL] Couldn't write out to file: /sitemap.xml 应该是没有写的权限的问题吧? |
#7
|
|||
|
|||
....
faint 现在这个命令运行一半就中断 被服务器那边ban 掉了可能 |
#8
|
|||
|
|||
查看看 config.xml,
代碼:
<site base_url="http://[domain_name]/" store_into="/path-to/sitemap.xml" verbose="1" > |
#9
|
|||
|
|||
然後在測試時,在指令後加 "--testing",如
python sitemap_gen.py --config=config.xml --testing 這樣不會立即送 request 到 google 到確定可以執行無誤,在把 --testing 拿掉 |
#10
|
|||
|
|||
非常感谢!... 就是这个原因
|