Blue Screen Of Duds

Where the alter ego of codelust plays

Archive for the ‘Apache’ Category

Installing Apache, PHP, MySQL, Postgresql on Mac OSX Leopard from source

with 14 comments

Update: Updated post (on December 11, 2008) here.

Notes

  1. We won’t be running any binary installations, all software will be compiled from source.
  2. The installation won’t make use of Fink or Darwinports either.
  3. These are instructions for the Intel Macs.
  4. Using this approach would mean that you will need to maintain the stack by hand.
  5. Use this information at your own risk.
  6. If you don’t want to go through all the trouble and use a binary installation, read this post.

The software stack we are going to install will be as follows:

Apache HTTP Server 2.2.6

Modules
core
mod_authn_file
mod_authn_dbm
mod_authn_default
mod_authz_host
mod_authz_groupfile
mod_authz_user
mod_authz_default
mod_auth_basic
mod_include
mod_filter
mod_log_config
mod_env
mod_setenvif
mod_ssl
prefork
http_core
mod_mime
mod_dav
mod_status
mod_autoindex
mod_asis
mod_info
mod_cgi
mod_dav_fs
mod_negotiation
mod_dir
mod_actions
mod_speling
mod_alias
mod_rewrite
mod_so
mod_php5

PHP 5.2.5

Modules
bz2
calendar
ctype
curl
date
dom
exif
filter
gd
hash
iconv
json
ldap
libxml
mbstring
mysql
mysqli
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
posix
session
SimpleXML
snmp
SPL
SQLite
standard
tidy
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zlib

MySQL 5.1.22 RC

Stock install

Postgresql 8.2.5

Stock install

We will also need to install the following software dependencies:

  1. Xcode (from the Leopard DVD or Apple Developer connection )
  2. Readline (http://tiswww.case.edu/php/chet/readline/rltop.html)
  3. Tidy (http://tidy.sourceforge.net)

This installation would not have been possible without help from the following websites:

  1. Installing Readline on OSX without using Fink or Darwinports
  2. Workaround for Tidy’s platform.h problem
  3. Installing the GD library on OSX Leopard

Now to the installation:

Install Xcode

Install MySQL

Download mysql-5.1.22-rc.tar.gz from the http://dev.mysql.com website
Uncompress
$/configure --prefix=/usr/local/mysql
$make
$sudo make install

Update: The steps did help me in getting to install the server, but on start up it did give certain location-specific errors.

As Hill has pointed out in the comments, MySQL.com has not released a version of their software for Leopard, but I got 5.1.22 RC to install, run and connect from PHP without any hassles following the instructions in one of the links he had kindly posted.

Install Readline

Download the source from ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
Uncompress
$./configure
There are bugs with the installation as elaborated in this link with workarounds:
$make static
$sudo make install static

Install Postgresql

Download the source from http://www.postgresql.org
Uncompress
$./configure --with-prefix=/usr/local/postgresql
$make
$sudo make install

Install GD

Follow the instructions at Veola.net

Install Tidy

Download Tidy source
Uncompress
$./configure
$make

This will throw up errors that can be fixed by following these instructions
$sudo make install

Install Apache

$CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk"
$./configure \
--prefix=/usr/local/apache2 \
--enable-authn-dbm \
--enable-ssl \
--enable-dav \
--enable-info \
--enable-speling \
--disable-userdir \
--enable-rewrite \
--enable-so \
--with-ssl=/usr/bin

if you get an apr.h error regarding sendfile, edit the apr.h file in srclib/ext/includes and change APR_HAS_SENDFILE to ‘0’

$make
$sudo make install

Install PHP

$./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--prefix=/usr/local/php \
--with-pgsql=/usr/local/postgresql \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-tidy=/usr \
--with-curl=/usr/bin \
--with-curlwrappers \
--with-openssl-dir=/usr/bin \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/X11R6 \
--with-zlib-dir=/usr \
--with-freetype-dir=/usr/X11R6 \
--enable-mbstring \
--with-xpm-dir=/usr/X11R6 \
--with-pdo-pgsql=/usr/local/postgresql \
--with-pdo-mysql=/usr/local/mysql \
--with-xsl=/usr/bin \
--with-ldap \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-snmp=/usr --enable-exif \
--enable-calendar \
--with-bz2=/usr \
--enable-debug

$make
$sudo make install

And that’s all folks!

Advertisements

Written by shyam

December 23, 2007 at 12:23 pm

Posted in Apache, Apple, Leopard, Mysql, OSX, PHP

Tagged with , , , , ,

Running Apache 2, PHP5 (Entropy) with Postgresql on Leopard

with 4 comments

Update: New post on installing from source here.

Getting Apache 2, PHP 5, MySQL 5 and Postgresql 8 on Leopard was not as easy as it was made to look, so I am noting it down so that it could help somebody later.

This does not deal with installing PHP or Apache from source which can be a bit hairy on OSX.

This was done on OSX Leopard, I have no idea if the same will work on Tiger, Panther etc.

Follow the instructions at your own risk. It did not blow up my Macbook Pro in doing this, but I can’t guarantee you that you’ll extract the same mileage.

All binaries have been downloaded from Marc Liyanage’s website (thanks Marc!):

Steps:

  1. Download the respective packages from the website
  2. Install them according the instructions
  3. Stop the httpd that is shipped with leopard (sudo /usr/sbin/apachectl stop)
  4. Backup existing PHP module: cp /usr/local/apache2/modules/libphp5.so /usr/local/apache2/modules/libphp5.so.orig
  5. Replace with the Entropy version: sudo cp /usr/local/php5/libphp5.so /usr/local/apache2/modules/libphp5.so
  6. Backup existing php.ini: cp /private/etc/php.ini /private/etc/php.ini.orig
  7. Replace with the Entropy version: sudo cp /usr/local/php5/lib/php.ini /private/etc/php.ini
  8. Edit the httpd.conf in /usr/local/apache2/conf to load the PHP module
  9. Back up existing httpd.conf in /private/etc/httpd
  10. Replace it with the version in /etc/local/apache/conf
  11. Start Apache
  12. Profit?

I know it is not the best or the most proper way possible. But after many days of poking around, this was the easiest and I am not one to complain about that.

Written by shyam

December 14, 2007 at 12:47 pm

Posted in Apache, Apple, Leopard, Mysql, OSX

PHP on Windows tip

leave a comment »

I have not seen much about this anywhere, but if you are wondering why you enabled extensions (in PHP.ini) don’t work in PHP on Windows, it is probably because your "extension_dir" path is wrong. This does not show up as an error anywhere other than in Apache’s error log, which is the last place where most would look for an error. To get rid of this error, do not use a relative path for the directory and use the absolute path. It is as simple as that.

Technorati Tags: , , ,

Written by shyam

November 1, 2007 at 1:24 pm

Posted in Apache, Web Servers

A Brijj too far

with 21 comments

When I started writing this sort of a review, I honestly wanted to rip Info Edge apart for releasing such a sham of a website. Having read a lot of what Sanjeev Bikhchandani has written and said over time and having seen Naukri grow into the robust company that it is today, I had considerably greater expectations from Brijj. But I’ll hold my horses, tone down the criticism and look at the larger picture, that the blame is almost universally spread out among the Indian internet landscape. Our idea of innovation is to look at the hottest 50 websites out there in the west, pull elements from each of them and promise to do everything, including an unconditional end to global warming, and hope nobody notices that beyond the stellar messaging (email for body builders, email for stupid people, anyone?) the product is the same wine in the same bottle.

Of course, a lot of Indian internet companies are profitable and in a good shape and at least in theory that should drive innovation across the board. But we seem to be happy to wait for the next big thing to fall from the western landscape, lap it up, spit it out and hope the audience here picks it up and voilà, you have a shortcut to near-instant profit. The strangest thing is that even here where there is hardly a decent business model online beyond the traditional banner spots, you get to hear almost endlessly about Web 2.0 and the like from within and outside the trade almost like it is the gospel that fell straight off the money tree.

What nobody will tell you is that most Web 2.0 companies in India today are neither successful nor feasible in both the long and the short run, including the latest string of Ruby on Rails-powered monstrosities, which often don’t have user bases that don’t extend beyond the developer’s immediate family and a string of former and current lovers. From that point of view, the ‘copy from west and paste here in the east’ routine may sound like a good and easy idea, but it is a malaise that will end up leaving us behind like cheap clattering Chinese imitations before soon. I think someone has to wake up, ground some good beans, brew some strong stuff and smell a whole lot of it.

Now to the product at hand: Brijj

On the surface, Brijj picks out the best of Facebook in terms of presentation (the squeaky clean lines, funky Javascript, Ajax etc) and marries it with the best of Linkedin (references, plug ins for Outlook, Outlook Express etc). But that’s where the similarity and the theory ends. Neither does Brijj have the stupendously awe-inspiring backend data wizardry that is the hallmark of Facebook, nor does it have the professional-friendly feel of Linkedin. For existing users of people networks, the lack of what are considered as standard features also stick out like a sore thumb.

For example, there is absolutely no granular privacy settings in terms of who gets to see what and how much. I am assuming that a lot of it is controlled by who you are a friend of and who you are not a friend of, but there’s hardly any easy way to figure it out. Beyond a few clicks and a handful of links, there is nothing to discover about the website. There is just no surprise factor. It looks and feels like a low cost carrier and the killer blow comes in when you see the best done page: product comparison — where you get to see what the different membership options are. And that is a dead giveaway of the shortcut to profit route, when you are crystal clear about your pricing options and are relatively clueless about the rest of the website.

On the technical front, the site is a bit rough around the edges. The server signature is the standard “NWS” or Naukri Web Server, which is actually Apache under the hood, running PHP and possibly one of the MVC frameworks. There are some duplicate meta and doctype declarations all over the place (UTF-8 or iso-8859-1? Make up your mind!), possibly due to some unfortunate soul including a default editor template in some controller file. There is almost certainly only a limited amount of QA done on it (other than a basic copy check) and page titles and meta tags are the same all over the place. And at least in the logged in home page, there is an invisible DIV with a certain Sonal Mehta’s (apparently, an HR manager at Infy) email and phone number hard coded into it.

So what’s the verdict? I am afraid unless Info Edge puts some real hard work into it and revises/refreshes the product, this will end up in the dustbin before soon. In any case, I can imagine the company having real pressure on it to diversify, especially after their successful listing. With 99acres and other properties not doing too well and still being huge cost points that gnaw away at Naukri’s healthy constitution, this won’t come as a relief in breaking the one hit wonder curse. Positioning-wise, I can’t see too many existing users moving over to this. The switching costs are way too high and the features are way too less and honestly, it all feels a bit too amateurish.

Info Edge is also making critical mistakes like not having a common registration database among its properties. Who on earth wants to maintain yet another login in an already troubled world of products where there is almost nothing that goes by the name of interoperability. I am assuming that at some point Info Edge will roll into Brijj, the muscle of Naukri’s database, but they have again erred gravely by not having it on from day one. It would have stood out as a major differentiator to any other similar product and this is again made considerably difficult because of users having to maintain two different identities on Naukri and Brijj.

Written by shyam

August 9, 2007 at 8:33 pm

Ibibo Pliggs it

with 2 comments

Ibibo Labs has a link to one of their new products under testing, a Digg-clone running on Pligg, called Newscola. Strangely, for all of Nasper’s technology muscle, MIH had to use a freely available software to push the product out. Now, I don’t have any problems using open source or free software, but the mistake that most companies make is in rushing to the market just to launch the product, without any thought given to how it would integrate with their existing systems. Ibibo’s other services run on .Net and IIS, while Pligg is a LAMP product and there is no common login. I can forsee that at some point a poor developer will end up having to write hacks into Pligg’s authentication module to integrate the regular Ibibo login into the system or migrate the system wholesale to .Net, which is such a ridiculous waste of time.

Technorati tags: , , ,

Written by shyam

February 2, 2007 at 6:43 am

Is Microsoft ignoring the mainstream media server space?

leave a comment »

Mainstream media publications may not be a high value market for Microsoft, but the segment scores very high as far as visibility and perception go. Who would really not love to have a “Powered by” label on a high volume traffic website like the New York Times, as a showpiece for their product? What you are going to read is by no means a scientific or foolproof way of coming to any conclusion. It is based on the headers that the server returns and Netcraft coming in as the fallback option when faced with the ‘unknown’ server signature.

The list is broken down into three parts. The first is a list of the websites of the top twenty newspapers in America. The second is a smaller listing of European publications. The third is a list of publications from India, because, well that’s where I come from.

The US List

USA Today
IIS5 & BigIp

The Wall Street Journal
IBM WebSphere Application Server

The New York Times
SunOne Webserver

LA Times
SunOne Webserver

The Washington Post
SunOne Webserver

Chicago Tribune
SunOne Webserver

New York Daily News
Apache

Philadelphia Inquirer
Apache & Akamai

Rocky Mountain News
Netscape Enterprise 4.1

Houston Chronicle
Apache 2.0.x + Akamai

New York Post
Apache 2.0.x

Detrori Free Press
IIS6

Dallas Morning News
Apache 2.0.x

Minneapolis Star Tribune
Apache 1.3.x & Akamai

Boston Globe
Apache 2.0.x

The Star-Ledger
Apache

Atlanta Journal-Constitution
Apache 1.3.x

Arizona Republic
Apache 2.0.x

Newsday
SunOne Webserver

San Francisco Chronicle
Apache 1.3.x

Apache: 11
SunOne Webserver: 5
IIS: 2
Websphere Application Server: 1
Netscape Enterprise: 1
Oracle Application Server: 0
Java Server Pages: 0

The European List

International Herald Tribune
Apache

Le Monde
Apache & Akamai

The Jerusalem Post
Java Server Pages & Akamai

Der Spiegel
Apache 1.3.x

El Pais
Apache & Akamai

Corriere Della Sera
Apache 2.0.x

The Guardian
Apache

The Independent
Oracle-Application-Server-10g

The Sun
Apache 1.3.x

The Mirror
Apache 1.3.x

BBC News
Apache

South China Morning Post
Netscape Enterprise 3.6

Apache: 9
SunOne Webserver: 0
IIS: 0
Websphere Application Server: 0
Netscape Enterprise: 1
Oracle Application Server: 1
Java Server Pages: 1

The Indian List

NDTV
IIS5 & Akamai

Rediff
Apache 2.0.x & Akamai

Indiatimes
IIS6 & Akamai

Hindustan Times
Netscape Enterprise 6.0

The Hindu
Apache 2.2.x

CNN-IBN
Apache 2.2.x

CNBC TV18-India
Apache 2.2.x

Sify.com
Apache 2.0.x

Mumbai Mirror
IIS6

Daily News and Analysis
IIS6

The Indian Express
Apache 2.2.x

Mid Day
IIS6

The Pioneer
IIS5

Tehelka.com
IIS4

WebDunia.com
IIS5

The Telegraph
SunOne & ASP

Malayala Manorama
IIS6 & Akamai

Business Standard
Apache 2.2.x

Apache: 7
SunOne Webserver: 1
IIS: 9
Websphere Application Server: 0
Netscape Enterprise: 1
Oracle Application Server: 0
Java Server Pages: 0

The Final Count

Apache: 27
IIS: 14
SunOne: 6
Netscape Enterprise: 3
Websphere Application Server: 1
Oracle Application Server: 1
Java Server Pages: 1

Couple of interesting observations:

  • 3 out of 20 in the US use a CDN (Akamai)
  • 3 out of 12 in the Europe chart use a CDN (Akamai)
  • 4 out of 18 in India use a CDN (Akamai)
  • Sun is impressive with its pitch in US, but non existent in Europe and India (with the exception one site which is running ASP via SunOne).
  • No Apache 2.2.x in the US list
  • IIS does well in India
  • Netscape Enterprise is still around from version 3.6 to 6.0
  • Help! Somebody out there still uses IIS4 on a live website. Line them up and shoot them!

One of the main reasons why this might not be a high value market for Microsoft is that it has become more or less the norm for media websites with huge traffic to get on the Akamai CDN these days than to scale vertically or horizontally to serve the surge in traffic. In fact, some websites on the list run on ancient five to six-year-old servers, running the origin servers for Akamai. From that point of view, Microsoft has little to gain because these guys are not buying new licenses for new CPUs or new servers.

Another interesting trend is the use of acceleration and caching devices like BigIp and Netscaler, that used to be the domain of major ecommerce operations. It is hard to predict and tune your infrastructure in a media set up. The traffic patterns are unpredictable and after a while you really don’t want to break you head over your squid clusters and nothing works as well as a well set-up acceleration device that does TCP offloading.

More to come later.

p.s: The US top-20 list has been sourced from here.

Technorati tags: , , , ,

Written by shyam

January 4, 2007 at 1:16 pm