views:

371

answers:

3

I wish to make a self contained LAMP distro software package from source with at least the following:
* php must have mysqli, ldap and GD support
* all required .so's must be included (like libpng needed by GD) (self contained)

I managed to make one but i keep patching quirks to it, SO i thought to start from a wide-used one like XAMPP but i can't find the source that builds it (some shell script where it writes all the configure options, involved sources etc).

Where can i find such a script/informations ?

I need this so my users have an easy out of the box install for my software, they are not LAMP admins.

I need the configure options of XAMPP packages or similar.

+1  A: 

You do realize you can enable these extensions inside XAMPP by just editing the php.ini file?

Also you should use Imagick (aka ImageMagick) instead of GD, it's substantially faster (around 3x) and more feature rich. Imagick replaces GD.

I don't see a reason to create a custom installation, just configure the one you have.

TravisO
I know about ImageMagick but my software uses libs that sit on top of GD, is fast eough and rich enough for me.
clyfe
+1  A: 

You want to create (and presumably maintain and support) a whole Linux distribution?????!!!!!

And you're expecting a complete answer here????!!!!!!!!!!!!!!!!!!!!

There's no way anyone can provide a proper answer to that - it takes years to learn how to do all that, IIRC there are no one-man Linux distributions currently available.

You might consider having a look at Puppy Linux which comes with a lot of tools for generating custom installations.

Alternatively, it might be a lot simpler to build a reference implementation then distribute it as a virtual machine image (I've recently started playing with VirtualBox which is free, but there are several others out there - Bochs, VMWare....).

Although you seem to be confusing LAMP (which is everything from the OS up) with XAMPP (which only contains the webserver, db, PERL and PHP).

C.

symcbean
I added clarifications in the question!
clyfe
+1  A: 

Here are the configure options that I used to build my own lamp stack.
They are extracted from CentOS rpm lamp packages.

# APACHE
cd httpd-2.2.14/
./configure \
--prefix=/opt/clamp \
--sysconfdir=/opt/clamp/etc \
--enable-auth-dbm \
--enable-cern-meta \
--enable-auth-digest \
--enable-charset-lite \
--enable-deflate \
--enable-expires \
--enable-cache \
--enable-disk-cache \
--enable-file-cache \
--enable-headers \
--enable-info \
--enable-mime-magic \
--enable-proxy \
--enable-proxy-ajp \
--enable-proxy-balancer \
--enable-proxy-connect \
--enable-proxy-ftp \
--enable-proxy-http \
--enable-rewrite \
--enable-so \
--enable-ssl
make
make install
cd ..

# MYSQL
cd mysql-5.1.44/
./configure \
--prefix=/opt/clamp \
--sysconfdir=/opt/clamp/etc \
--libexecdir=/opt/clamp/sbin \
--localstatedir=/opt/clamp/var \
--with-unix-socket-path=/opt/clamp/tmp/mysql.sock
make
make install
cd ..

# LIBS_DEP
yum install freetype
yum install freetype-devel
yum install libjpeg
yum install libjpeg-devel
yum install libpng
yum install libpng-devel
yum install libXpm
yum install libXpm-devel

# PHP
cd php-5.2.13/
./configure \
--prefix=/opt/clamp \
--sysconfdir=/opt/clamp/etc \
--with-apxs2=/opt/clamp/bin/apxs \
--with-config-file-path=/opt/clamp/etc/php.conf \
--disable-debug \
--with-pic \
--disable-rpath \
--without-pear \
--with-bz2 \
--with-curl \
--with-freetype-dir=/usr \
--with-png-dir=/usr \
--enable-gd-native-ttf \
--without-gdbm \
--with-gettext \
--with-gmp \
--with-iconv \
--with-jpeg-dir=/usr \
--with-openssl \
--with-pspell \
--with-zlib \
--with-layout=GNU \
--enable-exif \
--enable-ftp \
--enable-magic-quotes \
--enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-sysvmsg \
--enable-wddx \
--with-kerberos \
--enable-ucd-snmp-hack \
--enable-shmop \
--enable-calendar \
--without-sqlite \
--enable-force-cgi-redirect \
--enable-pcntl \
--with-imap --with-imap-ssl \
--enable-mbstring \
--enable-mbregex \
--with-ncurses \
--with-gd \
--enable-bcmath \
--with-xmlrpc \
--with-ldap --with-ldap-sasl \
--with-mysql=/opt/clamp \
--with-mysqli=/opt/clamp/bin/mysql_config \
--enable-dom \
--with-pgsql \
--enable-soap \
--enable-xmlreader --enable-xmlwriter \
--enable-fastcgi 
make
make install

ln -s /opt/clamp/share/mysql/mysql.server /opt/clamp/bin/mysql.server
mkdir /opt/clamp/tmp
/bin/cp -f /root/clamp/use/etc/* /opt/clamp/etc
/bin/cp -f /root/clamp/use/run /opt/clamp
/bin/cp -f /root/clamp/use/install /opt/clamp

./bin/mysql_install_db --user=clamp \
--basedir=/opt/clamp \
--datadir=/opt/clamp/var

groupadd clamp
useradd -g clamp -s /bin/nologin -d /opt/clamp clamp
chown -R clamp.clamp /opt/clamp


# start first !!!!!!!!!

/opt/clamp/bin/mysqladmin -u root -P 3307 password 123clamp456
/opt/clamp/bin/mysqladmin -u root -p123clamp456 -P 3307 flush-privileges

/opt/clamp/bin/mysql -u root -p123clamp456 -P 3307 -e "CREATE USER 'clamp'@'%' IDENTIFIED BY '123clamp456'";
/opt/clamp/bin/mysql -u root -p123clamp456 -P 3307 -e "update mysql.user set password = PASSWORD('123clamp456') where user='clamp'";
/opt/clamp/bin/mysql -u root -p123clamp456 -P 3307 -e "GRANT ALL PRIVILEGES ON *.* TO 'clamp'@'localhost' IDENTIFIED BY '123clamp456'";
/opt/clamp/bin/mysql -u root -p123clamp456 -P 3307 -e "GRANT ALL PRIVILEGES ON *.* TO 'clamp'@'%' IDENTIFIED BY '123clamp456'";
/opt/clamp/bin/mysql -u root -p123clamp456 -P 3307 -e "flush privileges";
clyfe