Tuesday, July 7, 2009

xampp on ubuntu

xampp on the dell mini 9

specs: Atom 1.6ghz ht cpu, 2 gig ddr2 ram, 64 gig runcore SSD.

Decided to see if the netbook could be used as a travelling development machine so we need to install lamp. So off to apache friends at http://www.apachefriends.org/en/xampp-linux.html to download the linux version which comes in a tarball. Not my fav method but so be it.

We save the download to our home directory.
Open a terminal window and do:

sudo tar xvfz xampp-linux-1.7.1.tar.gz -C /opt

which extracts all the files. Now to run the lamp stack

sudo /opt/lampp/lampp start

which displays

Starting XAMPP for Linux 1.7.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.

we then run firefox and goto http://localhost and the lamp page is displayed. success

Next we do places,home and browse the filesystem to opt/lampp/htdocs and create a bookmark which adds a htdocs folder to the places list. we should also check out apache/bin/php.ini and make some changes and we should install a good php aware text editor and then install joomla

Joomla on the Dell Mini 9

Now that LAMPP is installed (thanks apache friends) it is time to install joomla. We follow the same instructions as per xampp on windows. The phpmyadmin has a few minor differences but we created the joomla database and joomla user ok. This is fairly straightforward under linux but the next part is different. You can't just create a directory in the system area and extract a bunch of files to it - you are just a regular user. Windows XP allows that and look what happens.

So we open a terminal and cd /opt/lampp/htdocs and then do sudo mkdir joomla to set up the folder for the joomla. We goto off the joomlacode.org and under the 1.5 section we click on Other Joomla Packages. Under Joomla1.5.12 we find Joomla_1.5.12-Stable-Full_Package.tar.gz which is what we want. You have to know this is a zipped tarball for linux while the .zip package is for windows. We save it to own home folder.

In the terminal we copy the download to the joomla folder with sudo cp Joomla_1.5.12-Stable-Full_Package.tar.gz /opt/lampp/htdocs/joomla which is no mean feat on the Dell mini 9 keyboard! Actually, once i had done this i realized i should just have extracted the files to there instead of copying the archive. Oh well. Change to there with cd /opt/lampp/htdocs/joomla and extract the files with sudo tar xvzf Joomla_1.5.12-Stable-Full_Package.tar.gz

Why it was stupid to copy instead of extracting is now i have to rm the joomla file - 3 times i had to type that file name...arghh

Anyway now we can run the install with the web browser pointed to http://localhost/joomla which gives the browser based setup. Answer a few questions - ok, the joomla install cannot write changes to the php configuration file. This is configuration.php in the joomla folder that contains the settings - it recommends copying the configuration settings and editing the file manually after the install is finished.

The other problem is that php.ini has Display Errors set to ON as well as Register Globals set to ON. We will have to edit php.ini to fix these after the install.

One change from windows installs is that i've set up FTP so that the joomla ftp user can ftp files to the system. Note to self - check and see if joomla has to be manually added to the list of ftp users, similar to the list of samba users. The Verify FTP button returned an error, noting the ftp server was 'not compatible'. Probably because one is not running, i'll install wu-ftp later. The root path is /joomla. We decide to press on and install the sample data and setup the admin user. Install is ok.

Ok, the final page lists the code for configuration.php so we copy and paste it into the text editor and then in the terminal we do cp configuration.php /opt/lampp/htdocs/joomla

Now that it is copied over time to fix the other problems, first to remove the installation directory. Since this is a system folder in linux you just can delete it in the file manager, so we cd /opt/htdocs/joomla and type sudo rm -rf installation/ and away it goes.

The php.ini file is not in the opt/lampp/bin folder, it's not fatal so we ignore it for now and run joomla with http://localhost/joomla and login as the admin user. We check the global configuration and the paths are /opt/lampp/htdocs/joomla/tmp etc.

Update Aug 31

I run xampp with sudo /opt/lampp/lampp start and up it comes but going to http://localhost returns 'object not found'. The xampp stack is running, we confirm this by checking the open ports with network tools:

21 - open
80 - open
443 - open
3306 - open

but we cannot get to the mysql database server either, the client returns an error message of 'can't connect through socket 'var/run/mysqld/mysqld.sock(2)'. This seems odd, one would think it would be something like 'opt/lampp/var/mysql/mysql.sock'?

I opened a web browser on another machine and connected to the webserver on the dell mini9 but no pages are returned. You get:

Object Not Found!
192.168.1.109
Sun 30 Aug 2009 02:24:56 PM EDT
Apache/2.2.11 (Unix) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.2.9 mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0

This shows xampp is running but it is not working anymore. Why? This makes my idea of using it as a portable in-class server less likely. The USB xampp is more reliable and we can use wamp/mamp laptops as well. Found lots of theories as to why but testing them out to come up with a solution will take more time than i have to invest. Disappointing....

2 comments:

animelam said...

Hi I had the same problem as you had when connecting to the server. I used an ubuntu computer, but I wanted to access it from my windows conputer.
The way I solved it was to add the ip address of the server to the windows host file on the computer accessing the server. It's a bit more work, but I have no problems with it running.

jake4d said...

Just installed xampp on my gateway netbook and have a display problem when I go to http://localhost

the left sidebar of the page is sticky so I cannot see anything below the "tools" heading. (like phpMyAdmin) know of any fix?