Dec 16 2007

Zend debugger - without Zend Core/Zend Platform

Tag: Apache, PHP, Zend CoreGrant Perry @ 12:10 am

Zend debugger is basically the server side component that is used by Zend Studio. You need this to do your remote debugging!!

Normally you’d find this included in an installation of Zend Core or Zend Platform. However we aren’t using Zend’s apache php bundle so this little gem has to be loaded…

It’s hard to find on the net and not well advertised - I imagine because of Zend’s preference that you’d start using Zend Core.. Which looks great mind you but is missing some vital extensions some of our projects are using..

http://downloads.zend.com/pdt/server-debugger/

Share bookmark

Sep 18 2007

Installing Trac and some plugins

Tag: Apache, Linux, Programming, SubversionGrant Perry @ 10:44 pm

Trac is a popular open source issues management system written in Python. It also features a wiki and subversion browser. There are also countless plugins that have been created for it some of which I’m surprised aren’t included in the base install.

I’m installing this on a Ubuntu server, so you may need to find installation instructions to suit your distribution! To install the packages:

apt-get install trac libapache2-mod-python

Now to setup our first Trac project:

mkdir /var/trac
trac-admin /var/trac/example initenv

The last command will step you through some questions:

Project name - Being creative I named mine “Example“.
Database connection string - I hit enter using the default.
Repository type - I hit enter using the default as mine is SVN.
Path to repository - My repository for this example was /var/svn/example.

Next you’ll need to make sure your web server can access the files:

chown -R www-data /var/trac/

There are two ways of serving Trac through your web server one using CGI the other using the mod_python which I’ll be using. Include the following in your apache config:

 <Location /trac>
     SetHandler mod_python
     PythonHandler trac.web.modpython_frontend
     PythonOption TracEnvParentDir /var/trac
     PythonOption TracUriRoot /trac
 </Location>

This doesn’t include any security as you’ll see in most install tutorials. This is because I plan on installing a plugin to make use of a web based form log in instead.

If you restart apache then open http://ip-address/trac/ in your web browser you should see you list of Trac projects. Log in won’t work yet so we’ll continue…

Installing some Trac plugins

Now we’ll install some plugins you really can’t live without! We’ll start with WebAdmin which an interface for trac-admin command line utility. This would normally be used for adding component names to your projects - something you really should have to drop to a shell for! I’ll also install the AccountManagerPlugin while I’m at it…

First we need to configure the server to be able to install python eggs! This is how all of the Trac plugins are packaged…

apt-get install python-dev
cd /tmp
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

Now that thats done lets get the plugins installed! Please note you may need to refer to the plugin websites to ensure you’re using the correct repository for your version of Trac.

easy_install http://svn.edgewall.com/repos/trac/sandbox/webadmin/
easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10

Now that these are installed we need to configure our Trac project to make use of them!

Open the trac.ini file inside under the /conf/ directory of your Trac project. Mine is located at /var/trac/example/conf/trac.ini

[components]
trac.web.auth.loginmodule = disabled
webadmin.* = enabled
acct_mgr.* = enabled
acct_mgr.web_ui.RegistrationModule = disabled
 
[account-manager]
password_format = htpasswd
password_store = HtPasswdStore
password_file = /var/trac/trac.htpasswd

We should setup that password file and create our first account:

htpasswd -c /var/trac/trac.htpasswd admin
trac-admin /var/trac/example permission add admin TRAC_ADMIN

Some plugins also use caching if you don’t follow this next step you’ll run in to some nasty errors (Permission denied: ‘/root/.python-eggs’) ! This is because the web server can’t write to the location they use by default… So:

mkdir /tmp/trac-cache
chown www-data /tmp/trac-cache/

Then include this line in your apache config along with the others for the /trac directory.

SetEnv PYTHON_EGG_CACHE /tmp/trac-cache

Then restart apache and cross your fingers!

Update!

After my success with this install I started looking at Trac-Hacks through all of the other plugins and also decided to install the following (I’ll update this as I find others):

Share bookmark

Aug 31 2007

IP address binding with IIS

Tag: IIS, Web serversGrant Perry @ 7:10 am

This little trick has saved my life with quite a number of times!! But took me a while to find, so here I am sharing…

Lets say you’ve already got IIS running on your 2003 server, but you want to install several other web servers (or just one.. Hehe). You’ve already assigned a number of additional IP addresses to your server under network adapters TCP/IP settings.

But you then notice IIS is listening on all IP address! Despite having configured you’re sites in Internet Information Services (IIS) Manager to only use one IP address. You can see this using netstat.exe!

Solution

  1. Install Microsoft Windows support tools. Found on your Windows Server 2003 CD at \support\tools\suptools.msi
  2. Stop IIS listening on all addresses “httpcfg delete iplisten -i 0.0.0.0
  3. Set IIS to listen on a specific address “httpcfg set iplisten -i 192.168.x.x
  4. Stop IIS “net stop http /y
  5. Start IIS “net start w3svc

Confirmation

Now to confirm what you’ve just done you can run “httpcfg query iplisten“.

Share bookmark



Close
E-mail It