Steps to Lighttpd Installation
Here in blog most of the stuff is technical as I am guy with technical background. You might find some innovative and motivating stories along with some funny stories.I hope you find it useful :-) Happy blogging.
1) install apache, php …
yum install httpd php php-mysql php-pear php-devel zlib zlib-devel
yum groupinstall « Development Tools »
2) Download and install oracle instant client (basic and devel) from there:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
rpm -Uvh oracle-instantclient-basic-
rpm -Uvh oracle-instantclient-devel-
3) Add the Oracle instant client to dynamic linker
echo /usr/include/oracle/
ldconfig -v
4) Untar the PECL package and prepare it for compiling. You may download it from http://pecl.php.net/package/oci8
tar -xzvf oci-
cd oci-
phpize
5) Configure the PECL package as a shared object using the instant client and specifying where the Oracle client libraries are. Then build and install it.
./configure –with-oci8=shared,instantclient,/usr/lib/oracle/
make
make install
6) Add the library shared object for PHP
echo extension=oci8.so > /etc/php.d/oci8.ini
7) Start Apache
‘service httpd start’ _or_ ‘/etc/init.d/httpd restart’
Create a PHP info page and checked to see if the Oracle (oci8) driver is listed:
echo > /var/www/html/phpinfo.php
I hope this helps.
PS: These contents are borrows from url http://bigjim-network.be/2009/06/02/oracle-from-php-on-centos-5/
Steps to Lighttpd Installation
Steps to FAST CGI Support
Go to system -> Administration -> Synaptic Package Manager and select php-cgi
sh /etc/init.d/lighttpd start
sh /etc/init.d/lighttpd stop
Click apply changes
Edit file /etc/lighttpd/lighttpd.conf file to add following things.
First add the module mod_fastcgi (lighttpd provides an interface to a external programs that support the FastCGI interface via this module). Make sure your server.modules loades mod_fastcgi:
server.modules = (
“mod_access”,
“mod_accesslog”,
“mod_fastcgi”,
“mod_rewrite”,
“mod_auth”
)
Add following lines to configuration
fastcgi.server = ( “.php” =>
(( “socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/usr/local/bin/php”,
“bin-environment” => (
“PHP_FCGI_CHILDREN” => “16″,
“PHP_FCGI_MAX_REQUESTS” => “10000″
)
))
)
Restart lighttpd server with following command
Steps to Tile Cache Installation
Tile cache can be accessed by link http://localhost:port/tilecache/
Map Server version 5.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
[cache]
type=Disk
base=/home/mapserver/fgs/tmp/tilecache/cache
Sample WMS layer entry is as follows
[states]
type=WMS
url=http://localhost:8000/cgi-bin/mapserv?map=/home/mapserver/fgs/apps/OMMS3.0/htdocs/map/india_states.map
layers=states
extension=png
For above entry it is important that your map server supports WMS server to test that just go to your FGS installation directory and type command ./www/cgi-bin/mapserv -v and it should not throw any errorStep 1.
sudo fdisk -l
This command will list down all devices (drives) connected to your machine
Sample output can be as follows
Disk /dev/sda: 20.0 GB, 20020396544 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 83 Linux
/dev/sda2 1276 2434 9309667+ 5 Extended
/dev/sda5 1276 2388 8940141 83 Linux
/dev/sda6 2389 2434 369463+ 82 Linux swap / Solaris
Step 2.
Install partion creator program in ubuntu
sudo apt-get update
sudo apt-get install gparted gksu
gksudo gparted
Step 3.
sudo mkdir /storage
This will create a directory where partition will be mounted
Step 4.
ls -l /dev/disk/by-uuid
List down uuids for all drive’s partitions.
Sample output can be as follows
lrwxrwxrwx 1 root root 10 2009-11-04 17:05 069427AD94279E65 -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-11-04 17:05 82b11ae0-e4c9-4e95-9518-06a337659dfb -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-11-04 17:05 EA902C94902C6971 -> ../../sda7
Step 5.
sudo cp /etc/fstab /etc/fstab_backup
Take back up of original file
sudo gedit /etc/fstab
Edit original file and add following line to that.
Step 6
sudo mount -a
Mount all partitions
Step 7
sudo chown -R username:usergroup /storage
sudo chmod -R 755 /storage
UUID=82b11ae0-e4c9-4e95-9518-06a337659dfb /storage ext3 defaults 0 0
Steps to Postgres Update Memory
Open Terminal Window
cat/proc/sys/kernel/shmmax.
To view By default shared memory segment
based on your needs, although the default configuration is viable.
client authentication methods. By default, IDENT authentication method is
used for postgres and local users.
Please refer the PostgreSQL Administrator’s Guide.
and use the MD5 method for client authentication. PostgreSQL configuration
files are stored in the /etc/postgresql/
directory.
For example, if you install PostgreSQL 8.3, the configuration files are stored
in the /etc/postgresql/8.3/main
directory.
add entries to the /etc/postgresql/8.3/main/pg_ident.conf
file.
edit the file /etc/postgresql/8.3/main/postgresql.conf
‘localhost’ with the IP Address of your server.
For details, refer to the configuration file or to the PostgreSQL documentation.
password for the postgres user. Run the following command at a terminal
prompt to connect to the default PostgreSQL template database:
as user postgres. Once you connect to the PostgreSQL server, you
will be at a SQL prompt. You can run the following SQL command
at the psql prompt to configure the password for the user postgres.
file /etc/postgresql/8.3/main/pg_hba.conf
to use MD5 authentication
with the postgres user:
Please refer the PostgreSQL Administrator’s Guide to configure
more parameters.
sudo apt-get install postgresql-doc-8.3
To view the guide enter
file:///usr/share/doc/postgresql-doc-8.3/html/index.html
into the address bar of your browser. For general SQL information see
Using SQL Special Edition by Rafe Colburn.
With this post I will show how to install PostGIS 1.2.1 on Postgres
8.2.5 in Ubuntu 7.10 (but this procedure should work also for previous
PostGIS/Postgres/Ubuntu versions) from repositories.I will also show
you how to load and secure GIS data and how to access them with
some cool OS GIS Client (QGIS, UDig and gvSIG).
-1- Install Postgres
If you haven’t Postgres, you need to install it (PostGIS runs on top of it).
Open an Ubuntu terminal, and type:
sudo apt-get install postgresql postgresql-client
postgresql-contrib pgadmin3
sudo apt-get install postgresql pgadmin3
Postgres (8.2.5) will be now on your Ubuntu box.
-2- Install PostGIS
Still from the terminal, type:
sudo apt-get install postgresql-8.2-postgis
PostGIS (1.2.1) will now be installed, to be precise this
2 packages are installed:
postgresql -8.2-postgis
postgis
under file:///usr/share/doc/postgis/postgis.html you will
find the PostGIS Manual, for more help about installation
and configuration.
-3- Create a PostGIS database template
Creating a PostGIS database template is the way to go if
you want to make it easy the creations of many GIS database
on the same server. Without creating this template, you
would need to repeat this steps every time you need to
create a PostGIS database.
sudo su postgres
createdb postgistemplate
createlang plpgsql postgistemplate
psql -d postgistemplate -f /usr/share/postgresql-8.2
-postgis/lwpostgis.sql
psql -d postgistemplate -f /usr/share/postgresql-8.2
-postgis/spatial_ref_sys.sql
The template is now ready (a lot of functions and two
tables – geometry_columns and spatial_ref_sys – were
created in it).
Now we can test of postgistemplate we just created:
$ psql -d postgistemplate -c “SELECT postgis_full_version();”
postgis_full_version
————————————————————
POSTGIS=”1.2.1″ GEOS=”2.2.3-CAPI-1.1.1″ PROJ=”Rel.
4.5.0, 22 Oct 2006″ USE_STATS
(1 row)
-4- Create group role and user
General keyboard shortcuts for ubuntu.
Ctrl + A = Select all
Ctrl + C = Copy the highlighted content to clipboard
Ctrl + V = Paste the clipboard content
Ctrl + N = New (Create a new document, not in terminal)
Ctrl + O = Open a document
Ctrl + S = Save the current document
Ctrl + P = Print the current document
Ctrl + W = Close the close document
Ctrl + Q = Quit the current application
Keyboard shortcuts for GNOME desktop
Ctrl + Alt + F1 = Switch to the first virtual terminal
Ctrl + Alt + F2(F3)(F4)(F5)(F6) = Select the different virtual terminals
Ctrl + Alt + F7 = Restore back to the current terminal session with X
Ctrl + Alt + Backspace = Restart GNOME
Alt + Tab = Switch between open programs
Ctrl + Alt + L = Lock the screen.
Alt + F1 = opens the Applications menu
Alt + F2 = opens the Run Application dialog box.
Alt + F3 = opens the Deskbar Applet
Alt + F4 = closes the current window.
Alt + F5 = unmaximizes the current window.
Alt + F7 = move the current window
Alt + F8 = resizes the current window.
Alt + F9 = minimizes the current window.
Alt + F10 = maximizes the current window.
Alt + Space = opens the window menu.
Ctrl + Alt + + = Switch to next X resolution
Ctrl + Alt + – = Switch to previous X resolution
Ctrl + Alt + Left/Right = move to the next/previous workspace
Keyboard shortcuts for Terminal
Ctrl + A = Move cursor to beginning of line
Ctrl + E = Move cursor to end of line
Ctrl + C = kills the current process.
Ctrl + Z = sends the current process to the background.
Ctrl + D = logs you out.
Ctrl + R = finds the last command matching the entered letters.
Enter a letter, followed by Tab + Tab = lists the available commands beginning with those letters.
Ctrl + U = deletes the current line.
Ctrl + K = deletes the command from the cursor right.
Ctrl + W = deletes the word before the cursor.
Ctrl + L = clears the terminal output
Shift + Ctrl + C = copy the highlighted command to the clipboard.
Shift + Ctrl + V (or Shift + Insert) = pastes the contents of the clipboard.
Alt + F = moves forward one word.
Alt + B = moves backward one word.
Arrow Up/Down = browse command history
Shift + PageUp / PageDown = Scroll terminal output
Keyboard shortcuts for Ubuntu
Alt + Tab = switch between open windows
Win + Tab = switch between open windows with Shift Switcher or Ring Switcher effect
Win + E = Expo, show all workspace
Ctrl + Alt + Down = Film Effect
Ctrl + Alt + Left mouse button = Rotate Desktop Cube
Alt + Shift + Up = Scale Windows
Ctrl + Alt + D = Show Desktop
Win + Left mouse button = take screenshot on selected area
Win + Mousewheel = Zoom In/Out
Alt + Mousewheel = Transparent Window
Alt + F8 = Resize Window
Alt + F7 = Move Window
Win + P = Add Helper
F9 = show widget layer
Shift + F9 = show water effects
Win + Shift + Left mouse button = Fire Effects
Win + Shift + C = Clear Fire Effects
Win + Left mouse button = Annotate: Draw
Win + 1 = Start annotation
Win + 3 = End annotation
Win + S = selects windows for grouping
Win + T = Group Windows together
Win + U = Ungroup Windows
Win + Left/Right = Flip Windows
Keyboard shortcut for Nautilus
Shift + Ctrl + N = Create New Folder
Ctrl + T = Delete selected file(s) to trash
Alt + ENTER = Show File/Folder Properties
Ctrl + 1 = Toggle View As Icons
Ctrl + 2 = Toggle View As List
Shift + Right = Open Directory (Only in List View)
Shift + Left = Close Directory (Only in List View)
Ctrl + S = Select Pattern
F2 = Rename File
Ctrl + A = Select all files and folders
Ctrl + W = Close Window
Ctrl + Shift + W = Close All Nautilus Windows
Ctrl + R = Reload Nautilus Window
Alt + Up = Open parent directory
Alt + Left = Back
Alt + Right = Forward
Alt + Home = go to Home folder
Ctrl + L = go to location bar
F9 = Show sidepane
Ctrl + H = Show Hidden Files
Ctrl + + = Zoom In
Ctrl + – = Zoom Out
Ctrl + 0 = Normal Size
If you want to configure your own keyboard shortcuts, you can do it at System->Preferences->Keyboard Shortcuts.
ST_MakePoint(Float Longitude, Float Latitude) returns Point
Create a new point. Note the order of the coordinates (longitude then latitude).
ST_GeomFromText(String WellKnownText, Integer SRID) returns Geometry
Create a new geometry from a standard formatted string and SRID. For example: POINT(0 0), LINESTRING(0 0, 1 1), POLYGON((0 0, 0 1, 1 1, 1 0, 0 0)).
ST_SetSRID(Geometry, Integer SRID) returns Geometry
Update the SRID on a geometry. This does not alter the coordinates of the geometry, it just updates the SRID number. For example: ST_SetSRID(‘POINT(0 0)’::geometry, 4326). The direct cast of text to geometry creates a geometry without an SRID, so we set it post-facto. This function is useful for conditioning geometries created without SRIDs.
ST_Expand(Geometry, Float Radius) returns Geometry
Create a new geometry that is the expanded bounding box of the input geometry. For example: ST_Expand(‘POINT(0 0)’, 1) returns POLYGON((-1 -1, -1 1, 1 1, 1 -1, -1 -1)). This function is useful for creating envelopes for use in indexed searches.
ST_AsText(Geometry)
Convert geometry from internal format to human-readable text format.
ST_AsGML(Geometry)
Convert geometry from internal format to standard OGC GML format.
ST_AsGeoJSON(Geometry)
Convert geometry from internal format to standard GeoJSON format.
ST_Area(Geometry) returns Float
Return the area of the geometry in the units of the spatial reference system.
ST_Length(Geometry) returns Float
Return the length of the geometry in the units of the spatial reference system.
ST_Perimeter(Geometry) returns Float
Return the perimeter of the geometry in the units of the spatial reference system.
ST_NumPoints(Linestring) returns Integer
Return the number of vertices in a linestring.
ST_NumRings(Polygon) returns Integer
Returns the number of rings in a polygon.
ST_NumGeometries(Geometry) returns Integer
Returns the number of geometries in a geometry collection.
ST_Distance(Geometry, Geometry) returns Float
Return the distance between two geometries in the units of the spatial reference system.
ST_DWithin(Geometry, Geometry, Float Radius) returns Boolean
Return true if the geometries are within radius distance of one another.
ST_Intersects(Geometry, Geometry) returns Boolean
Return true if the geometries are not disjoint.
ST_Contains(GeometryA, GeometryB) returns Boolean
Return true if geometry “A” fully contains geometry “B”.
ST_Crosses(Geometry, Geometry) returns Boolean
For line/polygon case, return true if line crosses polygon boundary. For line/line case, return true if lines cross.
To suppress php errors we need to add ‘@’ sign before statement.
It will continue processing to next statment.
Example:
@ $result1 = pg_query($connection,$query1) or die(‘Error, query1 failed’);
if(!$result1)
continue;
Network Set up of Ubuntu
Open terminal window
Type sudo gedit /etc/network/interfaces and press enter
Type password for your root
Copy following lines to that file
auto eth0
iface eth0 inet static
address 192.168.1.100
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
Save file and close the editor
restart network with following command
sudo /etc/init.d/networking restart
Installation error “eval 1 :can not
found $FGS_HOME/www/bin/httpd” where as ‘httpd’ is there.
When i debugged that in apachectl it throws error code 2
which means httpd usage error. I am not able to proceed
further. After searching lot and using mailing lists i found
solution which is described as below.
Solution
Follow following steps : -
1. You need to install the ia32-libs package:
apt-get install ia32-libs
2. You need to install the fgs package:
download latest fgs from
www.maptools.org/fgs/
3. Install fgs
sh fgs-mapserver_extended_5.4.2-fgs_9.5-linux-i386.bin
4. star fgs
5. You have done enjoy…
The functions given below are spatial aggregate functions provided with PostGIS that can be used just like any other sql aggregate function such as sum, average.
The functions given below are PostGIS functions that conform to the SQL/MM 3 standard