Installing LAMP Apache/MySQL/PHP on Chromebook/Chromebox

Google Chromebook / Chromeboxes make excellent mini web-servers for development/testing/office use, or for using in kiosks / taking to tradeshows etc. Amazingly there is enough space on them for a reasonable sized web-site and database, and the oomph is comparable to a medium-size virtual server from one of the popular web-hosts.

Firstly, get your Chromebox / Chromebook running Linux by installing Chrubuntu:

Bring up a Terminal. (Remember, your user is called "user" with password "user" by default). Type:

sudo apt-get install tasksel
sudo  tasksel

Use the cursors to select "LAMP" (dom't deselect the default options or you may take away your desktop!) then hit return. (BTW: Now is a good time to try Edubuntu as it is cool, and openssh-server is useful too ;)
Give the mysql root user a password when prompted.

Test it out! Try this in terminal:
mysql -u root -p
show databases;
Now try Apache & PHP. In your browser go to http://localhost/
It should say something like "It works!"
BTW: your web-root is at /var/www/
Create a new file with your favourite editor (leafpad?) and smash the following line into it:


Save it in your web-root as something like test.php, then visit it ( http://localhost/test.php )


If you can't see the page, or any useful errors, change the display_errors setting in php.ini (which lives in /etc/php5/apache2/php.ini ) or immediately overwrite your php.ini with the dev version:

cd /usr/share/doc/php5-common/examples/
sudo cp php.ini-development /etc/php5/apache2/php.ini

You'll need to restart apache to pick up the changes:

sudo apachectl restart

sudo apachectl restart

Comments

Carl [Solvitor] said…
Here's another approach that retains all the ChromeOS functionality while allowing you to run LAMP. These steps are for the ARM ChromeBook but could probably be adapted for x86 versions.

http://solvitor.com/2013/01/02/lamp-stack-on-an-arm-chromebook/
Carl [Solvitor] said…
Update: a somewhat faster and more efficient way to set up a chroot and run LAMP on a ChromeBook.

http://solvitor.com/2013/09/02/a-better-arm-chromebook-lamp-stack-based-on-crouton-and-debian/
Unknown said…
Nice post, really informative thanks for sharing this.

Web Development Company

Popular posts from this blog

Installing Ubuntu Linux on your ChromeBox/ChromeBook

Changing your Mac OSX Terminal's default text editor