The only way to install (and execute) Xampp (for Linux)on a different folder than /opt/lampp is creating a symbolic link from the "real" installation folder to /opt/lampp.
Or directly "mount" the external drive to /opt/lampp - that will work (in that case) also, as you have to mount the external drive anyway.
Via Symbolic Link
Assuming that Xampp is installed (and mounted) to /mnt/drive (replace with the real name), simply enter in a Shell: (# is the shell prompt)
# ln -s /mnt/drive /opt/lampp
/opt/lampp MUST NOT exist before.
Assuming, that youre external drive is formatted with fat32 filesystem and is called /dev/drive (replace with the real name), simply enter in a Shell:
# mount -f fat32 /dev/drive /opt/lampp
/opt/lampp MUST exist before (vc. vs. to the case before).
You may specify some options to the mount command to grant access to special userid for the mounted drive, for example:
# mount -t fat32 /dev/drive /opt/lampp -o uid=www,gid=users,umask=002
Enter "man mount" in a Shell to learn about mount command.