Archive

Archive for January, 2007

Verbose Installation of ColdFusion and Apache in Linux

January 18th, 2007 rupert Comments off

You would find all the installers here:

http://192.168.1.10/installers/

1. Edit hosts file as follows:

[root@appserver php]# more /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
192.168.1.10            appserver

2. Edit your host as follows:
[root@appserver php]# more /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=appserver
GATEWAY=192.168.1.1

3. Apache:

http://192.168.1.10/installers/httpd-2.0.58.tar.gz

# tar -zxvf httpd-2.0.58.tar.gz
# cd httpd-2.0.58
# ./configure --help
# ./configure --prefix=/usr/local/apache2 --enable-so --with-mpm=prefork --enable-rewrite
# make
# make install

3.1 Starting apache2 on boot

#cd /usr/local/apache2/bin
#cp -Rf apachectl /etc/init.d/httpd

3.2 Edit httpd as follows

#cd /etc/init.d
#vi httpd

#!/bin/sh
# chkconfig: 35 80 15
# processname: httpd
# description: httpd
# Copyright 2000-2005 The Apache Software Foundation or its licensors, as
# applicable.

3.3 create runlevels for httpd

#/sbin/chkconfig --add httpd
#/sbin/chkconfig --level 345 httpd on
#/etc/init.d/httpd start

4. ColdFusion
4.1 Download http://192.168.1.10/installers/coldfusion-61-lin.bin
# chmod +x coldfusion-61-lin.bin

4.2 Run installer
# ./coldfusion-61-lin.bin

4.3 ColdFusion install:

Launching installer...
 
Preparing CONSOLE Mode Installation...
 
===============================================================================
Choose Locale...
----------------
 
  ->1- English
 
CHOOSE LOCALE BY NUMBER: 1
 
DO YOU ACCEPT THE TERMS OF THIS LICENSE AGREEMENT?
    (Y/N) : Y
 
The installer has found the following errors/warnings:
 
Warning: C++ compatibility pack
 
The installer was unable to determine if the C++ compatibility pack is
installed by running the following command: rpm --query compat-libstdc++
If this machine uses a version of glibc that is 2.2.5.x or higher the
compatibility pack is necessary for C++ custom tags, Verity, and web server
connectors to work properly.
 
For more information see the installation manual at
http://www.macromedia.com/go/livedocs_cfmx61docs
 
PRESS  TO CONTINUE WITH THE INSTALLER:
 
===============================================================================
Existing Macromedia ColdFusion MX Installation?
-----------------------------------------------
 
You cannot install a new installation of Macromedia ColdFusion MX 6.1 if you
have an existing version of Macromedia ColdFusion MX installed on this
computer.
 
If you do have a previous version installed, the installer can update your
current current installation to Macromedia ColdFusion MX 6.1.
 
Is there already a version of Macromedia ColdFusion MX installed on this
   computer? (Y/N): N
===============================================================================
Install Type
------------
 
Choose the type of Macromedia ColdFusion MX installation you want to perform:
 
  ->1- Install new version of ColdFusion MX
    2- 30-day trial (Enterprise Edition)
    3- Developer Edition (Single-IP Only)
 
Installation Choice: 1
 
Serial Number: CED600-18040-87264-92597
 
===============================================================================
Install Configuration
---------------------
 
What kind of installation do you want?
 
  ->1- Server configuration
    2- J2EE configuration (ColdFusion MX with JRun 4)
    3- J2EE configuration (EAR file)
    4- J2EE configuration (WAR file)
 
Please choose one of the following options: 1
 
===============================================================================
Choose Install Folder
---------------------
 
Select the directory in which to install Macromedia ColdFusion MX.
 
Directory:
 
  Default Install Folder: /opt/coldfusionmx
 
ENTER AN ABSOLUTE PATH, OR PRESS  TO ACCEPT THE DEFAULT
: [just press enter]
 
===============================================================================
Existing ColdFusion 4.5 or 5 Installation?
------------------------------------------
 
The installer can migrate your settings from ColdFusion 4.5 or 5 if you have
an
installation on this computer.
 
Is there a version of ColdFusion 4.5 or 5 installed on this computer? (Y/N) N
 
===============================================================================
Configure Web Servers
---------------------
 
Please configure your webserver(s).  If you do not configure a webserver the
built-in webserver will be used on port 8500.
 
    1- Add Web Server Configuration
  ->2- Continue with installation
 
Choice: 2
 
===============================================================================
Runtime User
------------
 
Enter the name of the runtime user.   This user must exist already on the
system.
 
User Name: (DEFAULT: nobody): [enter]
 
===============================================================================
Init System
-----------
 
Would you like ColdFusion MX to start at System Boot? Please note, this is
only supported on Solaris and Red Hat Linux. If you answer no to this, you can add
ColdFusion MX to system boot post install by running
/opt/coldfusionmx/bin/cfmx-init.sh
 
Answer (Y/N): Y
 
===============================================================================
Administrator Password
----------------------
 
Enter the password you will use to control access to the ColdFusion MX
Administrator.
 
This field is required.
 
Password:
Confirm Password:
 
===============================================================================
Installation Confirmation
-------------------------
 
Installation Type:
  Server configuration
 
Licensing:
  Fully Licensed Edition
  Serial Number: CED600-18040-87264-92597
 
Install Directories:
  Product: /opt/coldfusionmx
  Web root: /opt/coldfusionmx/wwwroot
 
Server Information:
  Web Server: Built-in Web Server
  Port: 8500
 
Disk Space Information (for Installation Target):
  Required: 433,293,879 bytes
  Available: 25,831,923,712 bytes
 
PRESS  TO CONTINUE:
[enter]
 
PRESS  TO CONTINUE:
 
===============================================================================
Installing...
-------------
 
 [==================|==================|==================|==================]
 [------------------|------------------|------------------|------------------]
 
===============================================================================
Installation Complete
---------------------
 
You have successfully completed the first step in installing Macromedia
ColdFusion MX.
 
To continue with your installation, go to /opt/coldfusionmx/bin and type
"./coldfusion start" to start your server.
 
Once the server is started log in to the Configuration Wizard at
http://[machinename]:8500/CFIDE/administrator/index.cfm
 
PRESS  TO EXIT THE INSTALLER:

5. Start coldfusion
# /etc/init.d/coldfusionmx start
Starting ColdFusion MX…
There may be a few moments before you can access the ColdFusion MX administrator. This is normal.
======================================================================
ColdFusion MX has been started.
ColdFusion MX will write logs to /opt/coldfusionmx/logs/cfserver.log
======================================================================

6. Bind ColdFusion with Apache.

$JAVA_EXECUTABLE -jar $CF_DIR/runtime/lib/wsconfig.jar \
        -ws apache \
        -dir /usr/local/apache2/conf \
        -bin /usr/local/apache2/bin/httpd \
        -script /usr/local/apache2/bin/apachectl \
        -coldfusion -v


[root@appserver /]# cd /opt/coldfusionmx/bin/connectors/
[root@appserver connectors]# ls
apache_connector.sh connectorslist.sh iplanet_connector.sh remove_all_connectors.sh upgrade_all_connectors.sh
[root@appserver connectors]# sh -v apache_connector.sh

You can check if your binding is successfull if you see the ff
messages:
 
Found JRun server default at 127.0.0.1:2901
CentOS release 4.4 (Final)
Detected Red Hat Linux release 7 or lower
Using Apache binary /usr/local/apache2/bin/httpd
Server version: Apache/2.0.58
Apache 2.0.58 is supported
Using Apache control script /usr/local/apache2/bin/apachectl
Parsing Apache configuration file /usr/local/apache2/conf/httpd.conf
Exec'ing chmod 777 /opt/coldfusionmx/runtime/lib/wsconfig/1
Set permission to 777 on /opt/coldfusionmx/runtime/lib/wsconfig/1
Exec'ing chmod +x /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun20.so
Set permission to execute on /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun20.so
Created file /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun20.so
Wrote file /usr/local/apache2/conf/httpd.conf
Added JRun configuration to Apache configuration file /usr/local/apache2/conf/httpd.conf
Created file /opt/coldfusionmx/runtime/lib/wsconfig/1/README.txt
Wrote file /opt/coldfusionmx/runtime/lib/wsconfig/wsconfig.properties
Exec'ing /usr/local/apache2/bin/apachectl restart
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Restarted Apache server
The Apache connector was installed to /usr/local/apache2/conf

7. Your httpd.conf file should contain the ff:

------------------------httpd.conf------------------------------
# NOTE: DO NOT ATTEMPT TO PUT THIS IN YOUR HTTPD.CONF MANUALLY.
LoadModule jrun_module /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun20.so
 
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ssl false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore /opt/coldfusionmx/runtime/lib/wsconfig/1/jrunserver.store
    JRunConfig Bootstrap 127.0.0.1:51010
    #JRunConfig Errorurl
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc

8. Copy ColdFusion Administrator to your webroot
# cd /usr/local/apache2/htdocs
# rm -Rf *
# cp -Rf /opt/coldfusionmx/wwwroot/CFIDE .
# ln -s CFIDE cfide

Open your browse and point to: http://192.168.1.15/cfide/administrator/

9. CFADMIN settings:
- Check Disable RDS Services. Press Next
- Install Documents: Yes. Press Next
- OK

10. Copy cfdocs to webroot:
# cp -Rf /opt/coldfusionmx/wwwroot/cfdocs /usr/local/apache2/htdocs/

Categories: coldfusion Tags: , ,

TileCache for Windows Revisited

January 17th, 2007 rupert Comments off

1. Downloaded TileCache1.8 from http://www.tilecache.org/

2. Get the current releases of python and mod_python.
http://www.python.org/download/releases/2.5/

http://httpd.apache.org/modules/python-download.cgi -> click on win32 binaries. Get the mod_python-3.3.1.win32-py2.5-Apache2.2.exe if your Apache is running on 2.2.

http://www.pythonware.com/products/pil/

http://effbot.org/downloads/PIL-1.1.6.win32-py2.5.exe

3. Install python2.5

4. Install mod_python and python_imaging.

5. Edit httpd.conf

LoadModule python_module modules/mod_python.so
 
<directory>
AddHandler python-program .py
PythonHandler test
PythonDebug On
</directory>
 
<directory>
	AddHandler python-program .py .cgi
	PythonHandler TileCache.Service
	PythonOption TileCacheConfig /wwwroot/tilecache/tilecache.cfg
	PythonDebug On
</directory>
 
ScriptInterpreterSource Registry
SetEnv PYTHONUNBUFFERED 1
PassEnv PYTHONPATH

6. run regedit. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.4\PythonPath. Append “E:\wwwroot\tilecache” to PYTHONPATH

D:\Python24\Lib;D:\Python24\DLLs;D:\Python24\Lib\lib-tk;E:\wwwroot\tilecache;

7. Put D:\Python24 in your WINDOWS PATH

8. Test if apache could read python by http://127.0.0.1/pytest/test.py

9. http://127.0.0.1/tilecache/test1.cfm

10. tilecache_seed.py “http://127.0.0.1/tilecache/tilecache.py” roads 12 17 “116.28229,39.85291,116.48657,39.98783″

Installing MS4W, Python2.4, ColdFusion6.1

January 17th, 2007 rupert Comments off

For Windows:

A. Installing MS4W
1. Download ms4w2.2 from maptools.org

2. Extract ms4w2.2 into your root drive (E:\)

3. Run E:\ms4w\apache-install.bat. This would install apache2.2 as a service.

4. Edit E:\ms4w\Apache\conf\httpd.conf to reflect your webroot in “DocumentRoot” (E:\wwwroot\)

149 DocumentRoot "/wwwroot"
...
....
177 <directory>
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
 
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None
 
    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
205 </directory>
....
....
212 DirectoryIndex index.html index.html.var index.php index.phtml index.php3 index.cfm
....
....

5. Test apache, navigate to “http://127.0.0.1/”.

B. Configuring Apache2.2 with ColdFusion6.1
6. Since Apache2.2 was released after CF6.1 and CF7.0 then, it would only bind with Apache2.0.x. We need a new wsconfig.jar that would bind with Apache2.2.x. Read more about the technote:
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=8001e97

Alternatively, you could download wsconfig.jar from http://www.adobe.com/support/coldfusion/ts/documents/8001e97/wsconfig.zip

7. Backup your existing wsconfig.jar to wsconfig.jar.bak. Replace the wsconfig.jar.

8. Restart ColdFusion.

9. Remove existing connectors from D:\CFusionMX\bin\connectors\Remove_ALL_connectors.bat

10. Execute D:\CFusionMX\bin\connectors\Apache_connector.bat

@echo off
echo WARNING!  This will install the ColdFusion MX Apache Connector.
echo Press Control+C to abort.
pause
SETLOCAL
PATH=..\..\runtime\jre\bin;%PATH%
java -jar ..\..\runtime\lib\wsconfig.jar  -ws apache -bin "e:\\ms4w\Apache\bin\httpd.exe" -dir "e:\\ms4w\apache\conf" -map .cfm,.cfc,.cfml -coldfusion -v
ENDLOCAL

11. Restart Apache and ColdFusion. Browse to http://127.0.0.1/cfide/administrator/index.cfm

C. Installing Python2.4
1. Read Reference document from maptools.org install site

2. Download Python2.4 from http://www.python.org/ftp/python/2.4/python-2.4.msi. Download mod_python from mod_python-3.3.0b.win32-py2.4-Apache2.2.exe

3. Install Python2.4 in your root drive. (D:\)

4. Install mod_python-3.3.0b.win32-py2.4-Apache2.2.exe

5. Edit your Windows Environment Variables (System Variable: PATH) to include “D:\Python23″

6. Edit E:\ms4w\Apache\conf\httpd.conf

#For Python
LoadModule python_module modules/mod_python.so
 
<directory>
	AddHandler python-program .py
	PythonHandler test
	PythonDebug On
</directory>
 
ScriptInterpreterSource Registry
SetEnv PYTHONUNBUFFERED 1
PassEnv PYTHONPATH

7. Restart Apache and test from http://127.0.0.1/pytest/test.py. If you see a “Hello World” web page from python then you are good to go. Sample python test page “test.py”:
E:\wwwroot\pytest\test.py

from mod_python import apache
 
def handler(req):
	req.content_type = 'text/plain'
	req.write("Hello World!")
	return apache.OK
Categories: mapserver, ms4w Tags: , ,

WordPress Plugins: CodeHighlight and DBBackup

January 16th, 2007 rupert 1 comment

1. I am currently using dean lee code highlighting for wordpress. Code is as follows:

echo "hello world";
?&gt;

To edit the code-highlight options go to: OPTIONS > Code Highlight

2. Download WP-DBManager. Extract it in the wp plugins directory and your good to go. Options for configuring can be found in “DATABASE” link in the Admin Site. Remember to change the Database options as follows:

for windows:

Path To mysqldump: mysqldump.exe
Path To mysql: mysql.exe
Path To Backup: E:\\wwwroot\wordpress\wp-content\backup-db

for linux:

Path To mysqldump: mysqldump
Path To mysql: mysql
Path To Backup: /usr/local/apache2/htdocs/wordpress/wp-content/backup-db

Categories: WordPress Tags:

Installing myhightman plugin in MySQL

January 15th, 2007 rupert Comments off

1. You need a fresh linux machine without mysql installed. You could follow the instructions from
here

2. Download myhightman.tar.gz which I already compiled.
myhightman.tar.gz

Extracting…

-rw-r--r-- 1 root root 377 Jan 12 17:00 bash_profile
drwxr-xr-x 2 1001 wheel 4096 Sep 14 00:30 ft_hightman
-rw-r--r-- 1 1001 wheel 4171 Sep 14 00:25 ft-hightman-M5-0.1.patch
-rw-r--r-- 1 root root 17955 Jan 11 18:52 ft-hightman-M5-0.1.tgz
-rw-r--r-- 1 root root 2051 Jan 12 17:00 install.sh
-rw-r--r-- 1 root root 574 Jan 11 19:19 my.cnf
drwx--x--x 2 root root 4096 Jan 11 19:37 mysql
-rw-r--r-- 1 root root 22265695 Jan 11 18:52 mysql-5.1.11-hi1.tgz
-rw-r--r-- 1 1001 wheel 3450 Sep 14 00:31 README.hightman_parser
-rw-r--r-- 1 root root 0 Jan 11 18:52 stopwords-gbk.txt
-rw-r--r-- 1 root root 3 Jan 11 18:52 stopwords-utf8.txt
-rw-r--r-- 1 root root 1466369 Jan 11 18:52 wordlist-gbk.txt
-rw-r--r-- 1 root root 1907299 Jan 11 18:52 wordlist-utf8.txt

3. install.sh:

#!/bin/sh
mysql_install_dir="./mysql-5.1.11-hi1"
mysql_base_dir="/usr/local/mysql"
hightman_patch="./ft-hightman-M5-0.1.patch"
stopword="stopwords-utf8.txt"
wordlist="wordlist-utf8.txt"
data_dir="/data/mysqldata"
temp_dir="/data/temp_dir"
 
echo "removing previous installation"
rm -rf $mysql_install_dir
 
echo "unpacking $mysql_install_dir"
tar -zxvf $mysql_install_dir.tar.gz
 
echo "copying ft_hightman to $mysql_install_dir/plugin"
cp -Rf ft_hightman $mysql_install_dir/plugin/
 
echo "copying $hightman_patch to $mysql_install_dir"
cp $hightman_patch $mysql_install_dir/
 
echo "patching please answer y to all..."
cd $mysql_install_dir
patch -p1 &lt; $hightman_patch
 
echo "patching again..."
patch -p1 &lt; $hightman_patch
 
echo "processing......."
 
echo "aclocal......."
aclocal
 
echo "automake......."
automake
 
echo "autoconf......."
autoconf
 
echo "configuring..."
./configure --prefix=$mysql_base_dir --with-charset=utf8 --with-extra-charsets=all --with-plugins=fthightman
 
echo "make..."
make
 
echo "make install..."
make install
 
echo "copying wordlist and stoplist to $mysql_base_dir/share/mysql"
cd ..
cp -Rf $stopword $mysql_base_dir/share/mysql/
cp -Rf $wordlist $mysql_base_dir/share/mysql/
 
echo "making mysql datadir on $data_dir"
rm -rf $data_dir
rm -rf $temp_dir
mkdir -p $data_dir
mkdir -p $temp_dir
 
echo "copying my.cnf default file to /etc"
cp -Rf my.cnf /etc/my.cnf
 
echo "copying custom mysql database to $data_dir"
cp -Rf mysql $data_dir
 
echo "changing ownership..."
useradd mysql
useradd -g mysql mysql
chown -Rf mysql:mysql $data_dir
chown -Rf mysql:mysql $temp_dir
 
echo "linking myhightman.so..."
ln -s /usr/local/mysql/lib/mysql/myhightman.so /usr/lib/myhightman.so
 
echo "creating startup scripts..."
cp -rf $mysql_base_dir/share/mysql/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
/sbin/chkconfig --add mysql
/sbin/chkconfig --level 345 mysql on
/etc/init.d/mysql start
 
echo "YOU HAVE SUCCESSFULLY INSTALLED mysql5 with HIGHTMAN. please add this to your path..."
echo "export PATH=$PATH:$mysql_base_dir/bin"

4. CREATE FUNCTION segment RETURNS STRING SONAME ‘myhightman.so’;

5. SET NAMES ‘utf8′;

Categories: mysql Tags: