Mereset username dan password untuk MySQL dan PostgreSQL

29/07/2010

Lupa dengan password databse di  MySQL/PostgreSQL? Berikut cara singkat hasil browsing saya di internet untuk mereset username dan pasword tersebut di Servers:

MySQL:

Step 1. Stop mysql server or Kill it:

# service mysqld stop

verify whether mysqld process stopped, if not you can go ahead to kill it:

# ps aux | grep mysql

Kill all processes shows by above command.
OR

# killall mysqld

Step 2. Start mysqld process manually without using grant table (to skip requirement of user/password):

# /bin/sh /usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --pid-file=/var/run/mysqld/mysqld.pid --skip-grant-tables

Step 3. Reset root password:

# mysql
(mysql prompt)# use mysql;
(mysql prompt)# update user set password=PASSWORD("newpassword") where user="root";
(mysql prompt)# quit;

You can also set password of any user here.

Step 3. Restart MySQL server and use new password.

Related posts in this blog on MySQL:
1. Setup MySQL Cluster in RedHat based Linux
2. Setup Multiple MySQL server instances in a single Linux Server.
3. Optimize a large installation of MySQL.
4. Fix MySQL running slow without any known reason.
5. Ignore MySQL error coming while executing bulk statements.

***

PostgreSQL:

Step 1. Edit PostgreSQL config file to establish trust relationship to login without password:

 # vi /var/lib/pgsql/data/pg_hba.conf
Old Line:
local all postgres password
Change it to:
local all postgres trust

Step 2. Restart PostgreSQL Server:

# service postgresql restart

Step 3. Change password:

# psql -U postgres template1 -c alter user postgres with password 'newpassword';

Step 4. Password has been updated. Revert back the original settings of config file:

# vi /var/lib/pgsql/data/pg_hba.conf

Old Line:
local all postgres trust
Change it to:
local all postgres password

Step 5. Restart server and use your new password to access PostgreSQL Server.

 # service postgresql restart

Cara ini saya ambil dari sumber :

http://linuxadminzone.com/recover-or-reset-root-password-of-mysql-and-postgresql-servers/


Kompilasi dan Instalasi Grass 6 di Linux (Centos 5.4)

16/04/2010

Catatan : Dikompilasi dari berbagai sumber, terutama dari http://grass.itc.it/ dan http://en.wikipedia.org/wiki/GRASS_GIS

General requirements:

(most  tools are standard tools on Linux, for other platforms you may have to install some of them.)

  • C-compiler (cc, gcc, egcs, …)

gcc: http://www.gnu.org/software/gcc/gcc.html

  • GNU make is recommended

http://www.gnu.org/software/make/make.html

  • zlib compression library (already installed on most modern systems)

It is used to internally compress GRASS raster maps:

libz: http://www.gzip.org/zlib

  • flex lexical analyzer generator (flex) – note: lex is no longer supported, please use flex instead:

flex: http://www.gnu.org/software/flex/flex.html

  • parser generator (yacc, bison)

bison: http://www.gnu.org/software/bison/bison.html

  • libncurses4.x/5.x (already installed on modern systems)

http://www.gnu.org/software/ncurses/ncurses.html

ftp://ftp.gnu.org/pub/gnu/ncurses

  • X Window system for graphical output, development libraries (X development libraries, in some linux distributions they are separate packages, e.g. xlibs-dev or x11-server-devel)

http://www.xfree.org; http://www.x.org

winGRASS note: As alternative a generic MS-Windows driver is under construction which does not require X11

  • PROJ4 – Projection Library

http://proj.maptools.org

  • GDAL and OGR for import and export of most external raster and vector map formats

http://www.gdal.org

Optional requirements:

  • Tcl/Tk 8.x libraries (including the ‘wish’ program) to use the GRASS GUI menu system and the NVIZ visualization suite. Some features of the new gis.m GIS manager may depend on version 8.4 or newer. see http://tcl.sourceforge.net
  • If hardware openGL support is missing in the X Server, Mesa-3.x (openGL clone) may be required for NVIZ. http://mesa3d.sourceforge.net
  • C++ Compiler (required for the r.terraflow module)

gcc: http://www.gnu.org/software/gcc/gcc.html

  • FFTW 2.x or 3.x (library for computing the Discrete Fourier Transform), required for i.fft and i.ifft and other modules . See http://www.fftw.org
  • LAPACK / BLAS (libraries for numerical computing) for GMATH library (GRASS numerical lib)

http://www.netlib.org/lapack.  (usually available on Linux distros)

Note: LAPACK/BLAS support is intended for future module implementations, no need to use it at time!

  • libpng (for r.out.png and the PNG driver), usually already installed.

http://www.libpng.org/pub/png/libpng.html

  • libjpeg (for r.out.tiff), usually already installed.

http://www.ijg.org

ftp://ftp.uu.net/graphics/jpeg

  • libtiff (for r.out.tiff), usually already installed.

http://www.libtiff.org

  • readline for extra command prompt functionality

http://tiswww.case.edu/~chet/readline/rltop.html

ftp://ftp.gnu.org/gnu/readline/

  • PostgreSQL libraries (for the PostgreSQL database interface)

http://www.postgresql.org

  • mySQL libraries (for the mySQL database interface)

http://www.mysql.org

  • sqlite libraries (for the sqlite database interface)

http://www.sqlite.org

  • unixODBC (for the ODBC database interface)

http://www.unixodbc.org

  • Motif or Lesstif libraries (for the “xganim” module)

http://www.lesstif.org

  • R language (for the R statistical language interface)

Catatan : library readline dan readline devel sudah harus terinstall.

http://cran.r-project.org

  • FreeType2 (for TrueType font support and d.text.freetype)

http://www.freetype.org

  • Python >= 2.4 (for new wxPython GUI and SWIG interface)

Note: Python 3 is not supported

http://www.python.org

  • wxPython >= 2.8.1.1 for wxPython-based GUI (see file gui/wxpython/README)

http://www.wxpython.org

  • NumPy for wxPython-based GUI tools (see file gui/wxpython/README)

http://numpy.scipy.org , sudah di install.

Catatan :

-          [root@noname download] tar –xvf  numpy-1.4.0.tar.gz

-          [root@noname download] cd numpy-1.4.0

-          [root@noname numpy-1.4.0] python setup.py build –fcompiler=gnu

  • FFMPEG (for direct rendering of animations from NVIZ), including libavcodec, libavformat, libswscale

http://ffmpeg.mplayerhq.hu

  • Cairo (Cairo graphics library, Version >= 1.5.8)

Catatan : PAda centos 5.4, yang sudah terinstall adalah versi yang ada 1.2 dan bisa digunakan

http://cairographics.org

  • AVCE00 and E00Compr Libraries (avcimport)

http://avce00.maptools.org/

Catatan instalasi  :

tar -xvf e00compr-1.0.1.tar.gz

cd tar -xvf e00compr-1.0.1

make

tar -xvf avce00-2.0.0.tar.gz

cd avce00-2.0.0

make

[Kemudian copy file executable ke direktori,missal /usr/local/e00; kemudian tambahkan  environment path  pada file /root/.bash_profile seperti berikut /usr/local/avce00_e00:]

Catatan Tentang Library:

Disarankan untuk menjalankan perintah update sebelum menginstall library yang diperlukan ( di CentOS dengan mengetikkan perintah “ yum –y update”), kemudian juga install versi developnya untuk tiap library misalkan untuk tcl gunakan perintah “ yum –y intstall tcl tcl-devel” untuk menginstal library tcl dan tcl-devel. Untuk mengetahui apakah suatu library sudah terinstal atau belum gunakan perintah “rpm –qa|grep nama_library

Installation order:

1. PROJ4

2. GDAL-OGR  (compiled without GRASS support)

3. optionally: databases such as PostgreSQL, MySQL, sqlite

4. GRASS

5. optionally: GDAL-OGR-GRASS plugin

Contoh Instalasi Grass di CentOS 5.4 :

[root@noname grass-6.3.0]# ./configure –with-jpeg –with-tiff –with-png –with-tcltk –with-postgres –with-opengl –with-fftw –with-blas –with-lapack –with-cairo –with-freetype –with-gdal=/usr/local/bin/gdal-config –with-wxwidgets=/usr/bin/wx-config –with-python=/usr/local/bin/python2.5-config –with-includes=/usr/local/include –with-libs=/usr/local/lib –with-zlib-libs=/usr/lib –with-tiff-libs=/usr –with-tcltk-libs=/usr/lib –with-tcltk-includes=/usr/include –with-postgres-includes=/usr/include/pgsql –with-fftw-includes=/usr/local/include –with-fftw-libs=/usr/local/lib –with-opengl-libs=/usr/lib –with-opengl-includes=/usr/include/GL –with-blas-libs=/usr/lib –with-lapack-libs=/usr/lib –with-cairo-includes=/usr/include/cairo –with-cairo-libs=/usr/lib –with-freetype-includes=/usr/include/freetype2 –with-freetype-libs=/usr/lib –with-proj-includes=/usr/include –with-proj-libs=/usr/lib –with-proj-share=/usr/share/proj –enable-largefile

[root@noname grass-6.3.0]#make

Pada bagian paling akhir, akan diinformasikan pada bagian/modul grass mana yang error. Cek error tersebut apakah terkait dengan library tertentu dan install libraay yang diperlukan. Jika sudah maka masuk ke direktori /folder yang error kemudian ketik “make” maka grass akan mengkonfigurasi ulang khusus pada bagian yang error tersebut.  Contoh sebagai berikut :

…………………………………………………

………………………………………………….

…………………………………………………..

cp -f AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT /tmp/sharing_linux/grass-6.3.0/dist.i686-pc-linux-gnu/

cp -f /tmp/sharing_linux/grass-6.3.0/bin.i686-pc-linux-gnu/grass63 /tmp/sharing_linux/grass-6.3.0/dist.i686-pc-linux-gnu/grass63.tmp

build_html_index.sh

Generating HTML manual pages index (help system)…

Generated HTML docs in ../dist.i686-pc-linux-gnu/docs/html/index.html

———————————————————————-

Following modules are missing the ‘description.html’ file in src code:

———————————————————————-

GRASS GIS compilation log

————————-

Started compilation: Tue Feb  9 13:41:13 WIT 2010

Errors in:

/tmp/sharing_linux/grass-6.3.0/visualization/nviz

In case of errors please change into the directory with error and run ‘make’.

If you get multiple errors, you need to deal with them in the order they

appear in the error log. If you get an error building a library, you will

also get errors from anything which uses the library.

Finished compilation: Tue Feb  9 13:50:22 WIT 2010

make: *** [default] Error 1

[root@noname grass-6.3.0]# cd visualization/nviz

[root@noname nviz]# make

[root@noname grass-6.3.0]# make install

……………………………………………………………

……………………………………………………………

……………………………………………………………

chmod -R a+rX /usr/local/grass-6.3.0 2>/dev/null

tar cBf – gem/skeleton | (cd /usr/local/grass-6.3.0/etc ; tar xBf – ) 2>/dev/null

/usr/bin/install -c  gem/gem6 /usr/local/bin 2>/dev/null

make[1]: Leaving directory `/tmp/sharing_linux/grass-6.3.0′

[root@noname grass-6.3.0]#

[root@noname grass-6.3.0]# grass63

WELCOME TO GRASS              Version 6.3.0         2008

1) Have at your side all available GRASS tutorials

2) When working on your location, the following materials

are extremely useful:

- A topo map of your area

- Current catalog of available computer maps

3) Check the GRASS webpages for feedback mailinglists and more:

http://www.grass-gis.org

http://grass.osgeo.org

Hit RETURN to continue

Starting GRASS …


Instalasi MapFISH (Windows maneh bos !, linuxnya lagi males . .:D)

13/04/2010

On Windows Python 2.5 (http://www.python.org/download/releases/2.5.4/), and the Python for Windows extensions (http://sourceforge.net/projects/pywin32/) must be installed.
To install MapFish, download the installation script (http://www.mapfish.org/downloads/go-mapfish-framework-1.2.py), and execute it from a terminal.

1. C:\>C:\Python25\python.exe go-mapfish-framework-1.2.py –no-site-packages env

New python executable in env\Scripts\python.exe
Installing setuptools………………………….done.
Searching for mapfish
Reading http://www.mapfish.org/downloads/1.2/pkg/mapfish/
Best match: mapfish 1.2
Downloading http://www.mapfish.org/downloads/1.2/mapfish-1.2-py2.5-win32.eg
Processing mapfish-1.2-py2.5-win32.egg
creating c:\env\lib\site-packages\mapfish-1.2-py2.5-win32.egg
Extracting mapfish-1.2-py2.5-win32.egg to c:\env\lib\site-packages
Adding mapfish 1.2 to easy-install.pth file

Installed c:\env\lib\site-packages\mapfish-1.2-py2.5-win32.egg
Processing dependencies for mapfish
Searching for geojson>=1.0,<=1.0.99
Reading http://www.mapfish.org/downloads/1.2/pkg/geojson/
Download error: (10054, ‘Connection reset by peer’) — Some packages may no
found!
Reading http://www.mapfish.org/downloads/1.2/pkg/geojson/
Best match: geojson 1.0.1
Downloading http://www.mapfish.org/downloads/1.2/geojson-1.0.1-py2.5.egg
Processing geojson-1.0.1-py2.5.egg
Moving geojson-1.0.1-py2.5.egg to c:\env\lib\site-packages
Adding geojson 1.0.1 to easy-install.pth file

Installed c:\env\lib\site-packages\geojson-1.0.1-py2.5.egg
Searching for Pylons>=0.9.7,<=0.9.7.99
Reading http://www.mapfish.org/downloads/1.2/pkg/Pylons/
Best match: Pylons 0.9.7
Downloading http://www.mapfish.org/downloads/1.2/Pylons-0.9.7-py2.5.egg
Processing Pylons-0.9.7-py2.5.egg
creating c:\env\lib\site-packages\Pylons-0.9.7-py2.5.egg
Extracting Pylons-0.9.7-py2.5.egg to c:\env\lib\site-packages
Adding Pylons 0.9.7 to easy-install.pth file

Installed c:\env\lib\site-packages\pylons-0.9.7-py2.5.egg

Link to http://www.pylonshq.com/download/0.9.7 ***BLOCKED*** by –allow-hos

Searching for SQLAlchemy>=0.5.0,<=0.5.99
Reading http://www.mapfish.org/downloads/1.2/pkg/SQLAlchemy/
Best match: SQLAlchemy 0.5.2
Downloading http://www.mapfish.org/downloads/1.2/SQLAlchemy-0.5.2-py2.5.egg
Processing SQLAlchemy-0.5.2-py2.5.egg
creating c:\env\lib\site-packages\SQLAlchemy-0.5.2-py2.5.egg
Extracting SQLAlchemy-0.5.2-py2.5.egg to c:\env\lib\site-packages
Adding SQLAlchemy 0.5.2 to easy-install.pth file

Installed c:\env\lib\site-packages\sqlalchemy-0.5.2-py2.5.egg
Searching for simplejson
Reading http://www.mapfish.org/downloads/1.2/pkg/simplejson/
Download error: (10054, ‘Connection reset by peer’) — Some packages may no
found!
Reading http://www.mapfish.org/downloads/1.2/pkg/simplejson/
Best match: simplejson 2.0.8
Downloading http://www.mapfish.org/downloads/1.2/simplejson-2.0.8-py2.5-win
g
Processing simplejson-2.0.8-py2.5-win32.egg
Moving simplejson-2.0.8-py2.5-win32.egg to c:\env\lib\site-packages
Adding simplejson 2.0.8 to easy-install.pth file

Installed c:\env\lib\site-packages\simplejson-2.0.8-py2.5-win32.egg
Searching for Tempita>=0.2
Reading http://www.mapfish.org/downloads/1.2/pkg/Tempita/
Best match: Tempita 0.2
Downloading http://www.mapfish.org/downloads/1.2/Tempita-0.2-py2.5.egg
Processing Tempita-0.2-py2.5.egg
Moving Tempita-0.2-py2.5.egg to c:\env\lib\site-packages
Adding Tempita 0.2 to easy-install.pth file

Installed c:\env\lib\site-packages\tempita-0.2-py2.5.egg
Searching for WebTest>=1.1
Reading http://www.mapfish.org/downloads/1.2/pkg/WebTest/
Best match: WebTest 1.1
Downloading http://www.mapfish.org/downloads/1.2/WebTest-1.1-py2.5.egg
Processing WebTest-1.1-py2.5.egg
Moving WebTest-1.1-py2.5.egg to c:\env\lib\site-packages
Adding WebTest 1.1 to easy-install.pth file

Installed c:\env\lib\site-packages\webtest-1.1-py2.5.egg

Link to http://svn.pythonpaste.org/Paste/WebOb/trunk#egg=WebOb-dev ***BLOCK
by –allow-hosts

Searching for WebError>=0.10.1
Reading http://www.mapfish.org/downloads/1.2/pkg/WebError/
Best match: WebError 0.10.1
Downloading http://www.mapfish.org/downloads/1.2/WebError-0.10.1-py2.5.egg
Processing WebError-0.10.1-py2.5.egg
creating c:\env\lib\site-packages\WebError-0.10.1-py2.5.egg
Extracting WebError-0.10.1-py2.5.egg to c:\env\lib\site-packages
Adding WebError 0.10.1 to easy-install.pth file

Installed c:\env\lib\site-packages\weberror-0.10.1-py2.5.egg
Searching for WebOb>=0.9.6.1
Reading http://www.mapfish.org/downloads/1.2/pkg/WebOb/
Best match: WebOb 0.9.6.1
Downloading http://www.mapfish.org/downloads/1.2/WebOb-0.9.6.1-py2.5.egg
error: Download error for http://www.mapfish.org/downloads/1.2/WebOb-0.9.6.
.5.egg: (10054, ‘Connection reset by peer’)
Searching for mapfish.plugin.client
Reading http://www.mapfish.org/downloads/1.2/pkg/mapfish.plugin.client/
Best match: mapfish.plugin.client 0.1.1
Downloading http://www.mapfish.org/downloads/1.2/mapfish.plugin.client-0.1.
.5.egg
Processing mapfish.plugin.client-0.1.1-py2.5.egg
creating c:\env\lib\site-packages\mapfish.plugin.client-0.1.1-py2.5.egg
Extracting mapfish.plugin.client-0.1.1-py2.5.egg to c:\env\lib\site-package
Adding mapfish.plugin.client 0.1.1 to easy-install.pth file

Installed c:\env\lib\site-packages\mapfish.plugin.client-0.1.1-py2.5.egg
Processing dependencies for mapfish.plugin.client
Searching for JSTools>=0.1.5,<=0.1.99
Reading http://www.mapfish.org/downloads/1.2/pkg/JSTools/
Best match: JSTools 0.1.5
Downloading http://www.mapfish.org/downloads/1.2/JSTools-0.1.5-py2.5.egg
Processing JSTools-0.1.5-py2.5.egg
Moving JSTools-0.1.5-py2.5.egg to c:\env\lib\site-packages
Adding JSTools 0.1.5 to easy-install.pth file
Installing jsbuild-script.py script to C:\env\Scripts
Installing jsbuild.exe script to C:\env\Scripts
Installing jsmin-script.py script to C:\env\Scripts
Installing jsmin.exe script to C:\env\Scripts

Installed c:\env\lib\site-packages\jstools-0.1.5-py2.5.egg
Searching for PasteScript>=1.7.2,<=1.7.99
Reading http://www.mapfish.org/downloads/1.2/pkg/PasteScript/
Best match: PasteScript 1.7.3
Downloading http://www.mapfish.org/downloads/1.2/PasteScript-1.7.3-py2.5.eg
Processing PasteScript-1.7.3-py2.5.egg
creating c:\env\lib\site-packages\PasteScript-1.7.3-py2.5.egg
Extracting PasteScript-1.7.3-py2.5.egg to c:\env\lib\site-packages
Adding PasteScript 1.7.3 to easy-install.pth file
Installing paster script to C:\env\Scripts
Installing paster-script.py script to C:\env\Scripts
Installing paster.exe script to C:\env\Scripts

Installed c:\env\lib\site-packages\pastescript-1.7.3-py2.5.egg
Searching for PasteDeploy
Reading http://www.mapfish.org/downloads/1.2/pkg/PasteDeploy/
Best match: PasteDeploy 1.3.3
Downloading http://www.mapfish.org/downloads/1.2/PasteDeploy-1.3.3-py2.5.eg
Processing PasteDeploy-1.3.3-py2.5.egg
creating c:\env\lib\site-packages\PasteDeploy-1.3.3-py2.5.egg
Extracting PasteDeploy-1.3.3-py2.5.egg to c:\env\lib\site-packages
Adding PasteDeploy 1.3.3 to easy-install.pth file

Installed c:\env\lib\site-packages\pastedeploy-1.3.3-py2.5.egg
Searching for Paste>=1.3
Reading http://www.mapfish.org/downloads/1.2/pkg/Paste/
Best match: Paste 1.7.2
Downloading http://www.mapfish.org/downloads/1.2/Paste-1.7.2-py2.5.egg
Processing Paste-1.7.2-py2.5.egg
creating c:\env\lib\site-packages\Paste-1.7.2-py2.5.egg
Extracting Paste-1.7.2-py2.5.egg to c:\env\lib\site-packages
Adding Paste 1.7.2 to easy-install.pth file

Installed c:\env\lib\site-packages\paste-1.7.2-py2.5.egg
Finished processing dependencies for mapfish.plugin.client

Downloading http://www.mapfish.org/downloads/exe/psycopg2-2.0.10.win32-py2.
.3.7-release.exe
Processing psycopg2 installation for windows
Installed C:\env\Lib\site-packages\psycopg2

Downloading http://www.mapfish.org/downloads/exe/Shapely-1.0.12.win32.exe
Traceback (most recent call last):
File “go-mapfish-framework-1.2.py”, line 1363, in <module>
main()
File “go-mapfish-framework-1.2.py”, line 424, in main
after_install(options, home_dir)
File “go-mapfish-framework-1.2.py”, line 1060, in after_install
remotezip = urllib2.urlopen(url)
File “C:\Python25\Lib\urllib2.py”, line 124, in urlopen
return _opener.open(url, data)
File “C:\Python25\Lib\urllib2.py”, line 381, in open
response = self._open(req, data)
File “C:\Python25\Lib\urllib2.py”, line 399, in _open
‘_open’, req)
File “C:\Python25\Lib\urllib2.py”, line 360, in _call_chain
result = func(*args)
File “C:\Python25\Lib\urllib2.py”, line 1107, in http_open
return self.do_open(httplib.HTTPConnection, req)
File “C:\Python25\Lib\urllib2.py”, line 1082, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (10054, ‘Connection reset by peer’)>

C:\>

2. Karena terjadi error, maka diulang untuk langkah yg pertama sampai hasilnya benar.

C:\>C:\Python25\python.exe go-mapfish-framework-1.2.py –no-site-packages env
New python executable in env\Scripts\python.exe
Installing setuptools……………..done.
Searching for mapfish
Best match: mapfish 1.2
Processing mapfish-1.2-py2.5-win32.egg
mapfish 1.2 is already the active version in easy-install.pth

Using c:\env\lib\site-packages\mapfish-1.2-py2.5-win32.egg
Processing dependencies for mapfish
Searching for WebOb>=0.9.6.1
Reading http://www.mapfish.org/downloads/1.2/pkg/WebOb/
Best match: WebOb 0.9.6.1
Downloading http://www.mapfish.org/downloads/1.2/WebOb-0.9.6.1-py2.5.egg
Processing WebOb-0.9.6.1-py2.5.egg
Moving WebOb-0.9.6.1-py2.5.egg to c:\env\lib\site-packages
Adding WebOb 0.9.6.1 to easy-install.pth file

Installed c:\env\lib\site-packages\webob-0.9.6.1-py2.5.egg
Searching for Mako>=0.2.4
Reading http://www.mapfish.org/downloads/1.2/pkg/Mako/
Best match: Mako 0.2.4
Downloading http://www.mapfish.org/downloads/1.2/Mako-0.2.4-py2.5.egg
Processing Mako-0.2.4-py2.5.egg
creating c:\env\lib\site-packages\Mako-0.2.4-py2.5.egg
Extracting Mako-0.2.4-py2.5.egg to c:\env\lib\site-packages
Adding Mako 0.2.4 to easy-install.pth file
Installing mako-render script to C:\env\Scripts

Installed c:\env\lib\site-packages\mako-0.2.4-py2.5.egg
Searching for nose>=0.10.4
Reading http://www.mapfish.org/downloads/1.2/pkg/nose/
Best match: nose 0.10.4
Downloading http://www.mapfish.org/downloads/1.2/nose-0.10.4-py2.5.egg
Processing nose-0.10.4-py2.5.egg
creating c:\env\lib\site-packages\nose-0.10.4-py2.5.egg
Extracting nose-0.10.4-py2.5.egg to c:\env\lib\site-packages
Adding nose 0.10.4 to easy-install.pth file
Installing nosetests-script.py script to C:\env\Scripts
Installing nosetests.exe script to C:\env\Scripts
Installing nosetests.exe.manifest script to C:\env\Scripts

Installed c:\env\lib\site-packages\nose-0.10.4-py2.5.egg
Searching for decorator>=2.3.2
Reading http://www.mapfish.org/downloads/1.2/pkg/decorator/
Best match: decorator 3.0.0
Downloading http://www.mapfish.org/downloads/1.2/decorator-3.0.0-py2.5.egg
Processing decorator-3.0.0-py2.5.egg
creating c:\env\lib\site-packages\decorator-3.0.0-py2.5.egg
Extracting decorator-3.0.0-py2.5.egg to c:\env\lib\site-packages
Adding decorator 3.0.0 to easy-install.pth file

Installed c:\env\lib\site-packages\decorator-3.0.0-py2.5.egg
Searching for FormEncode>=1.2.1
Reading http://www.mapfish.org/downloads/1.2/pkg/FormEncode/
Download error: (10054, ‘Connection reset by peer’) — Some packages may not be
found!
Couldn’t find index page for ‘FormEncode’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://www.mapfish.org/downloads/1.2/pkg/
No local packages or download links found for FormEncode>=1.2.1
Best match: None
Traceback (most recent call last):
File “C:\env\Scripts\easy_install-script.py”, line 8, in <module>
load_entry_point(‘setuptools==0.6c11′, ‘console_scripts’, ‘easy_install’)()
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 1712, in main
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 1700, in with_ei_usage
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 1716, in <lambda>
File “C:\Python25\Lib\distutils\core.py”, line 151, in setup
dist.run_commands()
File “C:\Python25\Lib\distutils\dist.py”, line 974, in run_commands
self.run_command(cmd)
File “C:\Python25\Lib\distutils\dist.py”, line 994, in run_command
cmd_obj.run()
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 211, in run
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 446, in easy_install
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 481, in install_item
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 519, in process_distribution
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\pkg_resources.py”,
line 563, in resolve
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\pkg_resources.py”,
line 799, in best_match
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\pkg_resources.py”,
line 811, in obtain
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\command\
easy_install.py”, line 434, in easy_install
File “C:\env\lib\site-packages\setuptools-0.6c11-py2.5.egg\setuptools\package_
index.py”, line 475, in fetch_distribution
AttributeError: ‘NoneType’ object has no attribute ‘clone’
Searching for mapfish.plugin.client
Best match: mapfish.plugin.client 0.1.1
Processing mapfish.plugin.client-0.1.1-py2.5.egg
mapfish.plugin.client 0.1.1 is already the active version in easy-install.pth

Using c:\env\lib\site-packages\mapfish.plugin.client-0.1.1-py2.5.egg
Processing dependencies for mapfish.plugin.client
Finished processing dependencies for mapfish.plugin.client

Downloading http://www.mapfish.org/downloads/exe/psycopg2-2.0.10.win32-py2.5-pg8
.3.7-release.exe
Processing psycopg2 installation for windows
Installed C:\env\Lib\site-packages\psycopg2

Downloading http://www.mapfish.org/downloads/exe/Shapely-1.0.12.win32.exe
Processing shapely installation for windows
Installed C:\env\Lib\site-packages\shapely

C:\>

3. Untuk mengecek hasilnya gunakan perintah sebagai berikut :

C:\> env\Scripts\activate.bat

(env) $ paster create –list-templates

maka akan tampil keterangan sebagai berikut :
#=====================================================================
Available templates:
basic_package:   A basic setuptools-enabled package
mapfish:         MapFish application template
mapfish_client:  MapFish client plugin template
paste_deploy:    A web application deployed through paste.deploy
pylons:          Pylons application template
pylons_minimal:  Pylons minimal application template
#=====================================================================

berarti konfigurasi mapfish sudah benar dan berhasil

4.    Membuat aplikasi mapfish pertamakali

Use:

(env) $ paster create -t mapfish MapFishApp

MapFishApp is the name of the MapFish application you’re creating, you can pick any name of your choice. We’ll assume that you choose
MapFishApp in the rest of this quickstart.

When asked what template engine to use answer mako, which is the default. When asked if SQLAlchemy 0.5 configuration is to be included,
answer True, as your MapFish application will include web services relying on database tables.

You should now have a folder named MapFishApp. This folder contains your application files.

Now check that your MapFish application works. For this go into the MapFishApp folder and start the application:

(env) $ cd MapFishApp
(env) $ paster serve development.ini

This command starts your application in the Paster web server, which is a pure-Python web server commonly used during development.

Open http://localhost:5000 in your web browser, you should get the default page:

Perintah – perintah MapFish
===========================
1.Installing the JavaScript toolbox

(env) $ cd ..
(env) $ paster create -t mapfish_client MapFishApp

When asked whether to overwrite index.html answer y. This will overwrite the index.html page you saw in the last section by the one provided
by the mapfish_client template. When asked whether to overwrite favicon.png also answer y.

Start the application again:

(env) $ cd MapFishApp
(env) $ paster serve –reload development.ini

Open or reload http://localhost:5000 in your web browser, you should now get the default user interface:

2. Creating a web service

To set up the database connection edit development.ini and replace the line

sqlalchemy.url = sqlite:///%(here)s/development.db

by this one:

sqlalchemy.url = postgres://quickstart:quickstart@www.mapfish.org:5432/quickstart

The connection string specifies that the postgres driver must be used, the database system is located at www.mapfish.org on port 5432, and the
name of the database is quickstart.

Creating a web service is done in three steps:

1.create a layer configuration in the layers.ini file, in our case we’re going rely on the table named countries in the database, so the
configuration is:

[countries]
singular=country
plural=countries
table=countries
epsg=4326
geomcolumn=the_geom

singular provides a singular name for the layer. plural provides a plural name for the layer. Both are used by the code generator when
substituting variables. table provides the name of the database. epsg provides the coordinate system of the table data. geomcolumn provides
the name of the geometry column.

2. Generate the web service code with the mf-layer command:

(env) $ paster mf-layer countries

3.configure a route to the countries controller, this is done by adding the following statement after the “CUSTOM ROUTES HERE” comment in the
mapfishapp/config/routing.py file:

map.resource(“country”, “countries”)

Watch the indentation! 4 spaces are needed here.

If you stopped paster serve or if you did not add the –reload switch, restart MapFishApp with:

(env) $ paster serve –reload development.ini

You can now open http://localhost:5000/countries?limit=1 in your browser, you should see a GeoJSON representation of the first object in the
countries table:


Ikuti

Get every new post delivered to your Inbox.