Friday, November 23, 2007

XAMPP 1.64 on Ubuntu

We know that Ubuntu server comes with a great support for LAMP, but for mobility issue, we can use XAMPP. However, I encountered a /bin/arch problem on my Gutsy. A quick search on Google, I found this link, http://jauhdimata.wordpress.com/2007/11/20/daripada-lupa/

Just in case something wrong with the link, I copied the solution here:

/opt/lampp/lampp: line 74: arch: command not found
Starting XAMPP for Linux 1.6.3…
/opt/lampp/lampp: line 74: arch: command not found
/opt/lampp/lampp: line 74: arch: command not found
XAMPP: Starting Apache with SSL (and PHP5)…
/opt/lampp/lampp: line 74: arch: command not found
XAMPP: Starting MySQL…
/opt/lampp/lampp: line 74: arch: command not found
XAMPP: Starting ProFTPD…
XAMPP for Linux started.

add this file, /bin/arch by typing:
% sudo vim /bin/arch

put this as the content of /bin/arch:

uname -m

then save and exit from vim by typing :wq

don't forget to make it executable by typing:

% sudo chmod +x /bin/arch

ok. now you can restart the xampp:

% sudo /opt/lamp/lampp restart

Sunday, November 4, 2007

Create Local Repo From DVD

1. Copy DVD contents to the folder in web server:
a. Preparing the folder, ie: /var/www/ubuntu, by doing $ sudo mkdir -p /var/www/ubuntu
b. Mount the DVD Repo to the /cdrom, $ sudo mount /cdrom
c. Copying the DVD Content to /var/www/ubuntu using rsync, $ sudo rsync -avx --progress /cdrom/. /var/www/ubuntu/.
d. Do (b) and (c) for all of your dvd repos.

2. Combine divided repo (ie: Gutsy)
a. Enter dvd repo #1, then mount it: $ sudo mount /cdrom
b. $sudo cp /cdrom/dists/gutsy/main/binary-i386/Packages /var/www/ubuntu/dists/gutsy/main/binary-i386/
c. eject the /cdrom, then do for dcd repo #2 $ sudo mount /cdrom
d. cat /cdrom/dists/gutsy/main/binary-i386/Packages >> /var/www/ubuntu/dists/gutsy/main/binary-i386/
should peemission denied, try: (don't forget to change back to 644)
$ sudo chmod 666
/var/www/ubuntu/dists/gutsy/main/binary-i386/
e. recreate the Packages.gz and Packages.bz
$ cd /var/www/ubuntu/dists/gutsy/main/binary-i386/
$ sudo rm Packages.gz Packages.bz2
$ sudo gzip -9 -c Packages > Packages.gz
$ sudo bzip2 -9 -c Packages > Packages.bz2
f. repeat for dvd #3, #4 and #5 for universe libraries.

3. That's all, you can activate it by adding:

deb http://[your-server-address]/ubuntu gutsy main restricted universe multiverse