By Rupert
Posts tagged apache
Installing Apache2.2 ColdFusion8 on Mac OS X Leopard
May 7th
Ok so this post is a bit late as I saw it in my drafts, but better late than never. I did these even before I wrote the PostGres8.3/Postgis/pgRouting post.
1. Apache
reference: http://httpd.apache.org/
./configure –prefix=/usr/local/apache2 –with-m2m=prefork
make
sudo make install
- To start on boot, download apache2startup.tar.gz and extract to your /Library/StartupItems/
2. ColdFusion
- run the installer as you would normally do in any windows/linux installation. I would suggest you put your installation in /opt and not ~ (home) because Leopard might wipe it out when upgrading to a higher OS version.
- should automatically start on boot
- bind coldfusion to apache
- Just in case you need to start it on boot, download coldfusion8Startup.tar.gz
3. Installing mod_python on Apache
$ ./configure –with-apxs=/usr/local/apache2/bin/apxs
$ make
$ sudo make install
Mapserver Debug Output
Aug 24th
Grabbing the latest ms4w-2.2.6, I was now able to get debugging output by specifying below in my mapfile.
CONFIG MS_ERRORFILE "stderr"
This would log all requests to your Apache error log. I can now play with different debugging modes as described from RFC28. Here is a simple output of my error.log with a DEBUG 2 set..
[error] [client 127.0.0.1] CGI Request 1 on process 4136
[error] [client 127.0.0.1] msDrawMap(): Layer 0 (district), 0.172s
[error] [client 127.0.0.1] msDrawMap(): Layer 1 (water_200k), 0.187s
[error] [client 127.0.0.1] msDrawMap(): Layer 2 (greens_200k), 0.454s
[error] [client 127.0.0.1] msDrawMap(): Layer 6 (roads_150_01), 0.906s
[error] [client 127.0.0.1] msDrawMap(): Layer 9 (roads_270_01), 0.515s
[error] [client 127.0.0.1] msDrawMap(): Layer 10 (roads_180_01), 0.563s
[error] [client 127.0.0.1] msDrawMap(): Layer 11 (roads_280_01), 0.531s
[error] [client 127.0.0.1] msDrawMap(): Layer 12 (roads_400_01), 0.516s
[error] [client 127.0.0.1] msDrawMap(): Layer 13 (roads_140_03), 0.547s
[error] [client 127.0.0.1] msDrawMap(): Layer 14 (roads_140_04), 1.297s
[error] [client 127.0.0.1] msDrawMap(): Layer 15 (roads_141_02), 0.703s
[error] [client 127.0.0.1] msDrawMap(): Layer 16 (roads_150_02), 0.890s
[error] [client 127.0.0.1] msDrawMap(): Layer 17 (roads_boundary_160_170_270), 0.953s
[error] [client 127.0.0.1] msDrawMap(): Layer 18 (roads_160_02), 0.829s
[error] [client 127.0.0.1] msDrawMap(): Layer 19 (roads_170_02), 0.640s
[error] [client 127.0.0.1] msDrawMap(): Layer 20 (roads_270_02), 0.531s
[error] [client 127.0.0.1] msDrawMap(): Layer 22 (roads_180_02), 0.563s
[error] [client 127.0.0.1] msDrawMap(): Layer 23 (roads_280_02), 0.516s
[error] [client 127.0.0.1] msDrawMap(): Layer 24 (roads_400_02), 0.531s
[error] [client 127.0.0.1] msDrawMap(): Layer 26 (subway), 0.109s
[error] [client 127.0.0.1] msDrawMap(): Layer 27 (subwaystops), 0.125s
[error] [client 127.0.0.1] msDrawMap(): Layer 28 (subway_transfer_stops), 0.110s
[error] [client 127.0.0.1] msDrawMap(): Layer 29 (district_boundary), 0.156s
[error] [client 127.0.0.1] msDrawMap(): Layer 33 (400_280_180_170_160_150_labels_01), 4.859s
[error] [client 127.0.0.1] msDrawMap(): Layer 35 (subwaystops_labels), 0.125s
[error] [client 127.0.0.1] msDrawMap(): Layer 36 (district_labels), 0.125s
[error] [client 127.0.0.1] msDrawMap(): Drawing Label Cache, 5.860s
[error] [client 127.0.0.1] msDrawMap() total time: 23.329s
Debian Howto: Apache 2.2 + ColdFusion Updated for SID
Aug 1st
Wow, this is really nice. I was able to install Apache2.2 + ColdFusion on my current Debian 4.0 Etch.
Here’s an introduction on using apt…
Use apt-cache to search the local database for available packages.
apt-cache search [search terms] will find packages that sound like what you want and:
apt-cache show [packagename] will return more details on a particular package.
apt-cache showpkg [packagename] will return more details on a particular package.
apt-cache policy [packagename] will return which versions are available along with the priority of each version.
apt-setup will enable you to change mirrors. The alternative is to edit /etc/apt/sources.list manually (which I prefer).
apt-get clean clears the local repository of all retrieved package files.
apt-get autoclean clears the local repository of retrieved package files of programs that are no longer installed.
dpkg -l [packagename] will list the version and a short description of the package we have installed.
Installing Apache2.2
1. apt-get install g++
2. apt-get install apache2
Setting up apache2-utils (2.2.3-4) ... Setting up apache2.2-common (2.2.3-4) ... Setting Apache2 to Listen on port 80. If this is not desired, please edit /etc/apache2/ports.conf as desired. Note that the Port directive no longer works. Module alias installed; run /etc/init.d/apache2 force-reload to enable. Module autoindex installed; run /etc/init.d/apache2 force-reload to enable. Module dir installed; run /etc/init.d/apache2 force-reload to enable. Module env installed; run /etc/init.d/apache2 force-reload to enable. Module mime installed; run /etc/init.d/apache2 force-reload to enable. Module negotiation installed; run /etc/init.d/apache2 force-reload to enable. Module setenvif installed; run /etc/init.d/apache2 force-reload to enable. Module status installed; run /etc/init.d/apache2 force-reload to enable. Module auth_basic installed; run /etc/init.d/apache2 force-reload to enable. Module authz_default installed; run /etc/init.d/apache2 force-reload to enable. Module authz_user installed; run /etc/init.d/apache2 force-reload to enable. Module authz_groupfile installed; run /etc/init.d/apache2 force-reload to enable. Module authn_file installed; run /etc/init.d/apache2 force-reload to enable. Module authz_host installed; run /etc/init.d/apache2 force-reload to enable. Setting up apache2-mpm-worker (2.2.3-4) ... Starting web server (apache2)...apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
3. /etc/init.d/apache2 start
4. ps -ef | grep apache2
5. Post Install:
#mkdir -p /usr/local/apache2
#ln -s /var/log/apache2 /usr/local/apache2/logs
#ln -s /var/www /usr/local/apache2/htdocs
#ln -s /usr/lib/cgi-bin /usr/local/apache2/cgi-bin
Installing ColdFusion 8
1. Install ColdFusion 8 normally. Make the user as nobody
2. To start ColdFusion8 on boot, download this startup script (coldfusion8_startup_debian).
Drop it to /etc/init.d/ and start coldfusion
3. Bind ColdFusion to Apache. Modify the existing apache_connector.sh.
#!/bin/sh # # Configure the Apache connector. # -dir should be the *directory* which contains httpd.conf # -bin should be the path to the apache *executable* # -script should be the path to the script which is used to # start/stop apache # ../../runtime/bin/wsconfig \ -server coldfusion \ -ws apache \ -dir /etc/apache2 \ -bin /usr/sbin/apache2 \ -script /usr/sbin/apache2ctl \ -coldfusion exit $#
4. Check if the bind is successful by inspecting /etc/apache2/httpd.conf . You should see something similar below…
# JRun Settings LoadModule jrun_module /opt/coldfusion8/runtime/lib/wsconfig/1/mod_jrun22.so <IfModule mod_jrun22.c> JRunConfig Verbose false JRunConfig Apialloc false JRunConfig Ignoresuffixmap false JRunConfig Serverstore /opt/coldfusion8/runtime/lib/wsconfig/1/jrunserver.store JRunConfig Bootstrap 127.0.0.1:51011 #JRunConfig Errorurl url <optionally redirect to this URL on errors> #JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server> #JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server> #JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server> #JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server> AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf </IfModule>
5. Follow Post install considerations
Installing ColdFusion7.0.2
References:
http://demirkapi.net/tutorials/coldfusion_debian_installation.cfm
http://www.easycfm.com/print/index.cfm?tutorial_id=376
1. apt-get install libstdc++6 libstdc++5 libstdc++2.10-glibc2.2(etch)
On etch, by default there is already xlibs, if we have desktop. On sid, if there is also no X, we need to install libxp6 libxt6 libxtst6. If you don’t install these libraries, you will get a graphing library error during coldfusionmx startup.
2. By default debian has a ‘nobody’ user also
From http://forums.gentoo.org/viewtopic-t-312113.html, and if you get a libc.so.6 No suc file or directory found problem
3. Modify /opt/coldfusionmx7/bin/coldfusion and comment out LD_ASSUME_KERNEL
174 # Some Java JVMs (both from Sun and IBM) don't work with the new floating stack
175 # feature of the i686 version of glibc. Force glibc to use the deprecated stack model.
176 # Check if the OS is SuSE8.1 or SuSE 9 - if it is, do not use the deprecated stack model.
177 #SUSEFLAG=`grep 'SuSE Linux 8.1\|UnitedLinux 1.0\|SuSE Linux 9\|SUSE LINUX Enterprise Server 9' /etc/SuSE-release /etc/UnitedLinux-release /etc/UnitedLinux-release 2> /dev/null`
178
179 #if [ ! "$SUSEFLAG" ]; then
180 # LD_ASSUME_KERNEL=2.2.9
181 # export LD_ASSUME_KERNEL
182 #fi
4. Boot on Start.
#cp -Rf /opt/coldfusionmx7/bin/coldfusion /etc/init.d/coldfusionmx7 #update-rc.d coldfusionmx7 start 80 2 3 4 5 . stop 15 0 1 6 .
5. You need the latest wsconfig.jar that will work on Apache2.2. It was discussed from a technote here. Configure apache with coldfusion
or
Call java and execute wsconfig.jar
/opt/coldfusionmx7/runtime/jre/bin/java
cd {cf_root}/runtime/lib
java -Dtrace.ci=1 -jar wsconfig.jar -server coldfusion -ws apache
-dir /etc/apache2/
-bin /usr/sbin/apache2
-script /usr/sbin/apache2ctl
-coldfusion -v
[-apxs]
Installing TileCache on RedHat/CentOS
Jul 25th
1. Install Apache
./configure –prefix=/usr/local/apache2 –enable-so –enable-rewrite –with-mpm=prefork
make
make install
rm -Rf /usr/local/apache2/htdocs/*
2. Install mod_python-3.3.1
./configure --with-apxs=/usr/local/apache2/bin/apxs
make
make install
3. Install Python Imaging Library (PIL) – Imaging-1.1.6
python setup.py install
Note: To check if PIL was successfully installed:
#python selftest.py
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.
47 ln -s /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so
48 ldconfig
49 python setup.py install
51 python selftest.py
54 rm -rf Imaging-1.1.6
55 tar -zxvf Imaging-1.1.6.tar.gz
56 cd Imaging-1.1.6
58 python selftest.py -> still fails
59 python setup.py install
60 python selftest.py -> ok
4. Check if mod_python was sucessfully installed.
http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking
[root@rupert-centos pytest]# python Python 2.4.3 (#1, Mar 14 2007, 18:51:08) [GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mod_python >>> mod_python.version '3.3.1' >>>
4. Edit httpd.conf
<directory> AddHandler python-program .py PythonHandler TileCache.Service PythonOption TileCacheConfig /usr/local/apache2/htdocs/tilecache/tilecache.cfg PythonDebug On PythonPath "sys.path + ['/usr/local/apache2/htdocs/tilecache/']" </directory> <directory> AddHandler mod_python .py PythonHandler test PythonDebug On </directory>
Note: This syntax will work for all versions of mod_python. In version 3.0 and later, the name of the mod_python handler reference has actually been changed and thus it is now preferred to use “mod_python” instead of “python-program”. The old name though is still supported and will be used here to avoid confusion for those using version 2.7.
5. Test your python
from mod_python import apache def handler(req): req.log_error('handler') req.content_type = 'text/plain' req.send_http_header() req.write('mptest.py\n') return apache.OK
Installing Trac on CentOS4
Jun 27th
There is a problem with clearsilver on CentOS systems. I get neo_cgi.so module not found. Don’t force yourself, it would simply not work (Trac0.10.4 on CentOS, not unless we try the DAG repositories).
So, I have to use Trac 0.11, setuptools and Genshi.
Prerequisites:
- Must have python 2.3+
- Must have mod_python-3.3.1.tgz
- Must have httpd2.0.x+ or httpd2.2.x
A. Core Trac Installation
1. Install setuptools-0.6c6-py2.3.egg. Download the setuptools according to your python distribution and simply run:
sh setuptools-0.6c4-py2.3.egg
2. Install Genshi. There are numerous ways of installing Genshi.
easy_install Genshi
or
#wget http://ftp.edgewall.com/pub/genshi/Genshi-0.4.2-py2.3.egg
#chmod +x Genshi-0.4.2-py2.3.egg
#easy_install Genshi-0.4.2-py2.3.egg
3. Install Trac 0.11. We need to install trac from svn
#svn co http://svn.edgewall.org/repos/trac/trunk trac
#python ./setup.py install
This would install trac-admin and tracd in /usr/bin.
Trac Post Intall
#mkdir -p /var/www/trac
#cd /var/www/trac
#trac-admin /var/www/trac/poimgr initenv
#chown -Rf nobody:root /var/www
#chmod -Rf 755 /var/www
Just accept the defaults for now, we can change it later on /var/www/trac/poimgr/conf/trac.ini.
C. Apache Configuration
LoadModule python_module /usr/local/apache2/modules/mod_python.so <location> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnv /var/www/trac/poimgr PythonOption TracUriRoot /trac/poimgr #Order deny,allow #Deny from all #Allow from 192.168.1.0/24 AuthType Basic AuthName "TRAC-POIMGR" AuthUserFile "/repos/svn-auth-file" require valid-user </location>
Notes:
http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html
Depending on your installation, you may encounter some problems. I had problems with expat errors:
ExpatError (null): line 1,column 0.
Turns out that it was confused between the link libraries of apache and that of python.
#ps aux | grep http | head -3 #sof -p 29982 | grep expat # strings libexpat.so.0.1.0 | grep expat_ expat_1.95.2 # strings /usr/lib/python2.3/lib-dynload/pyexpat.so | grep expat_ expat_1.95.7 Quickfix is to use symbolic links: #cd /usr/local/apache2/lib/ #cp -Rf /usr/lib/libexpat.so.0.5.0 /usr/local/apache2/lib/ #ln -s libexpat.so.0.5.0 libexpat.so #ln -s libexpat.so.0.5.0 libexpat.so.0 #su -l #/etc/init.d/httpd restart
Configuring Trac.
1. I have to move /etc/svn-auth-file to /repos-auth-file. Change the permissions so “nobody” could access it.
2. How to configure my users? Well, since its an intranet application and my trac-users and developers is both in the svn-auth-file, I need a way to configure users easily. Follow these steps from trac-hack.
easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk
Role base authorisation in trac
trac-admin /var/www/trac/poiclient permission remove anonymous \ TICKET_CREATE TICKET_MODIFY WIKI_CREATE WIKI_MODIFY for n in rupert andrew; do trac-admin /var/www/trac/{app_name} permission add $n TRAC_ADMIN done for n in rupert andrew; do trac-admin /var/www/trac/{app_name} permission add $n WIKI_DELETE done trac-admin /var/www/trac/poiclient permission add authenticated \ BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW \ REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW \ TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW \ WIKI_CREATE WIKI_MODIFY WIKI_VIEW
3. Here’s my trac.ini. Things to look at is the notification and account-manager.
4. Deleting a Trac Ticket:
# sqlite3 trac.db
delete from ticket_custom where ticket = [ticketID];
delete from ticket_change where ticket = [ticketID];
delete from ticket where id = [ticketID];
Other References:
http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash
http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html
Trac and Multiple Subversion Repositories
Future Work:
http://insurrection.tigris.org/
Comments