Chromebook Xampp

broken image


Champ = CH(romebook) A(pache) M(ySQL) P(hp)

  1. Chromebook Campfire
  2. Chromebook Xampp Download
  3. Chromebook Xampp Software
  4. Chromebook Xampp Pro

The #1 screen recorder for Chrome. Capture, edit and share videos in seconds. Screencastify - Screen Video Recorder. Need help download XAMPP to chromebook hi, i have the google pixelbook. 'chromebook' and i have to download XAMPP it will download but when i try to run it it wont because its not running off windows. Any suggestions? Download and install an easy to use software package called XAMPP in order to simplify the process of running the Apache webserver and MySQL database. We will then download Aptana, an open source Web IDE that comes with code assist/code completion abilities. It will prove invaluable when developing your own web based information systems. In XAMPP, there is an Apache server. Let's see steps to run a PHP program in browser: First, start the XAMPP control panel by clicking on the start button and then find the XAMPP control panel. A fast and simple guide for getting WordPress running locally on a Chromebook using XAMPP. A Chromebook running Crouton/Ubuntu 16.04 in developer mode.


Lamp is pretty popular and a well know term in the Web Developers world, Wamp also exists, and I have used Xampp with pleasure for many years.
But this blog posting is about the real champion: It's about Champ !!!
Ch = Chromebook
a = Apache
m = MySQL
p = PHP
Turn your Chromebook into a low cost Apache/PHP/MySQL development machine, run Apache/PHP/MySQL offline, develop LAMP websites offline.
It started because I wanted to test my own PHP apps with the new PHP 7.0 version that was in in that time in beta stage. I was wondering if I could use my Chromebook for this. YES, that was possible !

( ok ok, the term Champ is technically wrong, I have used Debian in a chroot environment that is setup by Crouton, so it is still Lamp, but the term Champ is just to good not to use it )

First the Chromebook must be put into developer mode, this can be different for the brand Chromebook you have, for me below actions did work.
  • Press + + at the same time
  • Press + d
See below page for more information about this step.
https://www.chromium.org/chromium-os/poking-around-your-chrome-os-device#TOC-Putting-your-Chrome-OS-Device-into-Developer-Mode

Install Debian through Crouton


Download Crouton at https://goo.gl/fd3zc and then activate it with below actions.
  • + + t
  • shell
  • sudo sh ~/Downloads/crouton -r jessie -t cli-extra
The rest of this document assumes you did use 'champ' as primary linux user with the last step above, you will be prompted for this.

Please read more about Crouton at below site, it's a great tool !

https://github.com/dnschneid/crouton/blob/master/README.md

Going into Debian on your Chromebook


After installation you can enter Debian on your Chromebook with below actions
  • + + t
  • shell
  • sudo enter-chroot
You must do this before each next step.
I did use below ones, but for sure those version numbers will soon be old ..
  • httpd-2.4.16.tar.gz
  • mysql-5.6.26.tar.gz
  • php-7.0.0RC3.tar.gz
  • phpMyAdmin-4.4.14-all-languages.zip
This page assumes you have those files in the Download folder on your Chromebook, start browsing at below sites, a real champ will have located and downloaded those files in less then 2 minutes.

Setup an build environment


Xampp
Chromebook
To compile the sources, we need compilers, build tools & libraries. Below packages will give this.
  • sudo apt-get install gcc g++ make cmake bison zip libaio-dev libapr1-dev libaprutil1-dev libpcre3-dev libxml2-dev libncurses5-dev libmcrypt-dev tidy libtidy-dev

Compile, install & start Apache


First step, the A from Champ, the Apache webserver
  • cd ~
  • tar zxvf Downloads/httpd-2.4.16.tar.gz
  • cd httpd-2.4.16
  • ./configure --with-mpm=prefork
  • make
  • sudo make instal
  • sudo /usr/local/apache2/bin/apachectl start
Wil it work ? Let's try it at below url
http://localhost

Compile, install, configure & start PHP


PHP is next.
  • cd ~
  • tar zxvf Downloads/php-7.0.0RC3.tar.gz
  • cd php-7.0.0RC3
  • ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --with-mysqli --with-mcrypt --with-tidy
  • make
  • sudo make install
Now we have to do some configuration, 'make install' does load the PHP module inside Apache but it does not not connect it to *.php files. Edit the Apache config file with below command.
  • sudo pico /usr/local/apache2/conf/httpd.conf
Locate below line
DirectoryIndex index.html
And change it into
DirectoryIndex index.php index.html
And add below lines just after the loading of the PHP 7 module.

SetHandler application/x-httpd-php
Restart apache with below command
  • sudo /usr/local/apache2/bin/apachectl restart
Create a PHP test file with below command
  • sudo pico /usr/local/apache2/htdocs/phpinfo.php
and put below content in it.
phpinfo();
?>
And got to below url in Chrome
http://localhost/phpinfo.php

Compile, setup and start MySQL


This one will take some time
  • cd ~
  • tar zxvf ~/Downloads/mysql-5.6.26.tar.gz
  • cd mysql-5.6.26
  • cmake .
  • make
  • make install
Time to setup MySQL
  • cd /usr/local/mysql
  • sudo chown -R champ:champ .
  • ./scripts/mysql_install_db --user=champ
  • chown -R root .
This step did also generate the file /champ/my.cnf file, lets edit it a bit, execute below command
  • sudo pico /usr/local/mysql/my.cnf
and add below 2 lines under [mysqld]
bind-address=127.0.0.1
user=champ
The first line makes sure that only your local Chromebook can access MySQL.
The second line defines the runtime user the MySQL deamon runs under.
Starting MySQL
  • cd /usr/local/mysql
  • sudo ./bin/mysqld_safe &
And make it secure with below script
  • cd /usr/local/mysql
  • sudo ./bin/mysql_secure_installation
Accept all defaults (and give twice the password you want for the user root)

Setup the real website.


Lets make our website, as a start, a single PHP page with 'Hello world'
Ok ok, a real linux champ will develop websites in a vt100 terminal with emacs, but wannabies like me will use Chrome OS apps like Caret, or a web edit like Codiac, that's why we put our website in ~/Downloads, so that Chrome OS apps like Caret can see it.
  • chmod 755 ~/Downloads
  • mkdir ~/Downloads/champ
  • mkdir ~/Downloads/champ/htdocs
And put a file with the name index.html and below context in the htdocs directory
pico ~/Downloads/champ/htdocs/index.php
Put below content in the file.
echo 'Hello world';
?>

Some more Apache configuration is needed to let Apache use above website and some other little tweeks
  • sudo pico /usr/local/apache2/conf/httpd.conf
First a few changes, find below options in the http.conf file and change it to whats given below.
Listen 127.0.0.1:80
User champ
Group champ
ServerName localhost:80
DocumentRoot '/home/champ/Downloads/champ/htdocs'
Then add below new lines at the end of the httpd.conf file.

Options Indexes FollowSymLinks
AllowOverride None
Require all granted
Restart apache to activate this new configuration
  • sudo /usr/local/apache2/bin/apachectl restart

phpMyAdmin


Install
Chromebook xampp free

  • cd ~/Downloads/champ/htdocs
  • unzip ~/Downloads/phpMyAdmin-4.4.14-all-languages.zip
  • mv phpMyAdmin-4.4.14-all-languages phpMyAdmin
Create the supporting Database
  • cd ~/Downloads/champ/htdocs/phpMyAdmin/sql
  • /usr/local/mysql/bin/mysql --user=root --password=????? < create_tables.sql
Configure
  • cd ~/Downloads/champ/htdocs/phpMyAdmin
  • mv config.sample.inc.php config.inc.php
  • pico config.inc.php
Change below line to something, every value seems to work.
$cfg['blowfish_secret'] = 'your_biggest_secret';
Go to it
http://localhost/phpMyAdmin

Starting and stopping MySQL & Apache/PHP


To make standard Linux start scripts, execute below commands.
  • sudo cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
  • sudo cp /usr/local/apache2/bin/apachectl /etc/init.d/apache
And now we can use below standard actions for starting & stopping
  • sudo service mysql start
  • sudo service mysql stop
  • sudo service apache start
  • sudo service apache stop
if you want to automatically start MySQL & Apache/PHP when you go into your chroot with the 'enter-chroot' command, add then below 2 lines to /etc/rc.local

Starting in the background & closing the chrosh tab afterwards


If you do the development with Chrome Apps and/or browser based, then there is no need to keep a crosh chrome tab open all the time.
Add the service start commands to /etc/rc.local as described in the previous paragraph. And then you execute below sequence of statements and afterwards close the crosh tab. The -b option submits the chroot to ghe background and the sleep make sure it never ends.
  • t
  • shell
  • sudo enter-chroot -b sleep infinity

Chromebook Campfire

Both the tboth the Crosh and Bash shells remember the commands you execute, so the next times you only need the & keys for this, it can be done in 2 seconds
Chromebook

Automatic starting MySQL & Apache/PHP


For me the previous paragraph is good enough, I don't need Champ every time I use my Chromebook.

However, it is possible to start Champ automatically after you login in your Chromebook. Add below file as champ.conf to /etc/init , note that this is in the ChromeOS file sytem, not the chrooted linux file system.
start on start-user-session
stop on stopping ui or starting halt or starting reboot
script
sudo enter-chroot sleep infinity
end script
!!! HA !!! You could not do this !!! Even the user root is not alowed to make changes to the root filesystem on ChromeOS. I suggest you leave it this way, I'm sure you like it that your Chromebook is a very secure system in the bad bad internet world.
Ok ok, of course you are not going to listen to the my good advice as given in the previous line, on below page you can find a script that will make the root file system on your Chromebook writable.
Poking around your Chrome OS Device
Please see also below page, that page covers in dept making the ChromeOS root file system writable and starting the Chroot environment automatically.
Autostart crouton chroot at ChromeOS startup
If you are going to use above page to autostart your Chroot, then below settings must be done in ~/Downloads/crouton.init to match the setup as given in this blog posting.
CHROOT=jessie
START_DE=enter-chroot
CHROOT_APP=sleep infinity
XMETHOD=default

by Victor A. Requena

Debugging your web applications with Visual Studio Code makes you more efficient. It helps you save a lot of time and keeps your code cleaner. This is because you don't have to write a bunch of console.logs and you can go through your code execution line by line. But if you're here, you probably know the benefits of debugging web applications. So let's begin…

Getting set up

The first thing you need to do is install the Debugger for Chrome extension. After you've installed it, you're almost ready to go. The next thing you need to do is create a launch file for the Visual Studio Code Debugger. This file contains the debugger's different configurations for your project.

You can create the launch file by going to the debug section in the Activity Bar and clicking the gear icon.

A list of options will prompt you to select the 'Chrome' one.

After you've done this, you're going to have a .vscode directory with a launch.json Utc clock. file.

Configurations

There are two kinds of Chrome debugging configurations: launch and attach. You can set this in the request option inside every configuration object.

Launch

The launch configuration launches a Chrome instance running a specified file or URL. If you specify a URL, you have to set webRoot to the directory that files are served from. This can be either an absolute path or a path using the ${workspaceFolder} resolver. This is the folder opened in your Visual Studio Code workspace.

Note: Be careful while setting webRoot, this is used to resolve URLs to a file on your computer.

You can see an example of two launch configurations: One launching against a local server and the other launching against a local file.

War thunder f4ej skins

If you have a Chrome instance running, the one launched by the debugger will use a temporary session. This means that you won't have your extensions or opened tabs. If you want to launch a Chrome instance with your user and extensions, you have to close every running instance first.

Chromebook Xampp Download

Note: When you stop the debugger, this will close the Chrome window.

Chromebook Xampp Software

Attach

I personally prefer using this one… This configuration attaches the debugger to a running instance of Chrome. But in order for this option to work, you need to launch Chrome with remote debugging enabled. Launching a Chrome instance with remote debugging varies depending on your OS.

Windows

There are two ways to launch Chrome with remote debugging in Windows. The simplest one is to right-click on the Google Chrome shortcut. Select the properties option and append the following command in the target field.

Xampp
To compile the sources, we need compilers, build tools & libraries. Below packages will give this.
  • sudo apt-get install gcc g++ make cmake bison zip libaio-dev libapr1-dev libaprutil1-dev libpcre3-dev libxml2-dev libncurses5-dev libmcrypt-dev tidy libtidy-dev

Compile, install & start Apache


First step, the A from Champ, the Apache webserver
  • cd ~
  • tar zxvf Downloads/httpd-2.4.16.tar.gz
  • cd httpd-2.4.16
  • ./configure --with-mpm=prefork
  • make
  • sudo make instal
  • sudo /usr/local/apache2/bin/apachectl start
Wil it work ? Let's try it at below url
http://localhost

Compile, install, configure & start PHP


PHP is next.
  • cd ~
  • tar zxvf Downloads/php-7.0.0RC3.tar.gz
  • cd php-7.0.0RC3
  • ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --with-mysqli --with-mcrypt --with-tidy
  • make
  • sudo make install
Now we have to do some configuration, 'make install' does load the PHP module inside Apache but it does not not connect it to *.php files. Edit the Apache config file with below command.
  • sudo pico /usr/local/apache2/conf/httpd.conf
Locate below line
DirectoryIndex index.html
And change it into
DirectoryIndex index.php index.html
And add below lines just after the loading of the PHP 7 module.

SetHandler application/x-httpd-php
Restart apache with below command
  • sudo /usr/local/apache2/bin/apachectl restart
Create a PHP test file with below command
  • sudo pico /usr/local/apache2/htdocs/phpinfo.php
and put below content in it.
phpinfo();
?>
And got to below url in Chrome
http://localhost/phpinfo.php

Compile, setup and start MySQL


This one will take some time
  • cd ~
  • tar zxvf ~/Downloads/mysql-5.6.26.tar.gz
  • cd mysql-5.6.26
  • cmake .
  • make
  • make install
Time to setup MySQL
  • cd /usr/local/mysql
  • sudo chown -R champ:champ .
  • ./scripts/mysql_install_db --user=champ
  • chown -R root .
This step did also generate the file /champ/my.cnf file, lets edit it a bit, execute below command
  • sudo pico /usr/local/mysql/my.cnf
and add below 2 lines under [mysqld]
bind-address=127.0.0.1
user=champ
The first line makes sure that only your local Chromebook can access MySQL.
The second line defines the runtime user the MySQL deamon runs under.
Starting MySQL
  • cd /usr/local/mysql
  • sudo ./bin/mysqld_safe &
And make it secure with below script
  • cd /usr/local/mysql
  • sudo ./bin/mysql_secure_installation
Accept all defaults (and give twice the password you want for the user root)

Setup the real website.


Lets make our website, as a start, a single PHP page with 'Hello world'
Ok ok, a real linux champ will develop websites in a vt100 terminal with emacs, but wannabies like me will use Chrome OS apps like Caret, or a web edit like Codiac, that's why we put our website in ~/Downloads, so that Chrome OS apps like Caret can see it.
  • chmod 755 ~/Downloads
  • mkdir ~/Downloads/champ
  • mkdir ~/Downloads/champ/htdocs
And put a file with the name index.html and below context in the htdocs directory
pico ~/Downloads/champ/htdocs/index.php
Put below content in the file.
echo 'Hello world';
?>

Some more Apache configuration is needed to let Apache use above website and some other little tweeks
  • sudo pico /usr/local/apache2/conf/httpd.conf
First a few changes, find below options in the http.conf file and change it to whats given below.
Listen 127.0.0.1:80
User champ
Group champ
ServerName localhost:80
DocumentRoot '/home/champ/Downloads/champ/htdocs'
Then add below new lines at the end of the httpd.conf file.

Options Indexes FollowSymLinks
AllowOverride None
Require all granted
Restart apache to activate this new configuration
  • sudo /usr/local/apache2/bin/apachectl restart

phpMyAdmin


Install
  • cd ~/Downloads/champ/htdocs
  • unzip ~/Downloads/phpMyAdmin-4.4.14-all-languages.zip
  • mv phpMyAdmin-4.4.14-all-languages phpMyAdmin
Create the supporting Database
  • cd ~/Downloads/champ/htdocs/phpMyAdmin/sql
  • /usr/local/mysql/bin/mysql --user=root --password=????? < create_tables.sql
Configure
  • cd ~/Downloads/champ/htdocs/phpMyAdmin
  • mv config.sample.inc.php config.inc.php
  • pico config.inc.php
Change below line to something, every value seems to work.
$cfg['blowfish_secret'] = 'your_biggest_secret';
Go to it
http://localhost/phpMyAdmin

Starting and stopping MySQL & Apache/PHP


To make standard Linux start scripts, execute below commands.
  • sudo cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
  • sudo cp /usr/local/apache2/bin/apachectl /etc/init.d/apache
And now we can use below standard actions for starting & stopping
  • sudo service mysql start
  • sudo service mysql stop
  • sudo service apache start
  • sudo service apache stop
if you want to automatically start MySQL & Apache/PHP when you go into your chroot with the 'enter-chroot' command, add then below 2 lines to /etc/rc.local

Starting in the background & closing the chrosh tab afterwards


If you do the development with Chrome Apps and/or browser based, then there is no need to keep a crosh chrome tab open all the time.
Add the service start commands to /etc/rc.local as described in the previous paragraph. And then you execute below sequence of statements and afterwards close the crosh tab. The -b option submits the chroot to ghe background and the sleep make sure it never ends.
  • t
  • shell
  • sudo enter-chroot -b sleep infinity

Chromebook Campfire

Both the tboth the Crosh and Bash shells remember the commands you execute, so the next times you only need the & keys for this, it can be done in 2 seconds

Automatic starting MySQL & Apache/PHP


For me the previous paragraph is good enough, I don't need Champ every time I use my Chromebook.

However, it is possible to start Champ automatically after you login in your Chromebook. Add below file as champ.conf to /etc/init , note that this is in the ChromeOS file sytem, not the chrooted linux file system.
start on start-user-session
stop on stopping ui or starting halt or starting reboot
script
sudo enter-chroot sleep infinity
end script
!!! HA !!! You could not do this !!! Even the user root is not alowed to make changes to the root filesystem on ChromeOS. I suggest you leave it this way, I'm sure you like it that your Chromebook is a very secure system in the bad bad internet world.
Ok ok, of course you are not going to listen to the my good advice as given in the previous line, on below page you can find a script that will make the root file system on your Chromebook writable.
Poking around your Chrome OS Device
Please see also below page, that page covers in dept making the ChromeOS root file system writable and starting the Chroot environment automatically.
Autostart crouton chroot at ChromeOS startup
If you are going to use above page to autostart your Chroot, then below settings must be done in ~/Downloads/crouton.init to match the setup as given in this blog posting.
CHROOT=jessie
START_DE=enter-chroot
CHROOT_APP=sleep infinity
XMETHOD=default

by Victor A. Requena

Debugging your web applications with Visual Studio Code makes you more efficient. It helps you save a lot of time and keeps your code cleaner. This is because you don't have to write a bunch of console.logs and you can go through your code execution line by line. But if you're here, you probably know the benefits of debugging web applications. So let's begin…

Getting set up

The first thing you need to do is install the Debugger for Chrome extension. After you've installed it, you're almost ready to go. The next thing you need to do is create a launch file for the Visual Studio Code Debugger. This file contains the debugger's different configurations for your project.

You can create the launch file by going to the debug section in the Activity Bar and clicking the gear icon.

A list of options will prompt you to select the 'Chrome' one.

After you've done this, you're going to have a .vscode directory with a launch.json Utc clock. file.

Configurations

There are two kinds of Chrome debugging configurations: launch and attach. You can set this in the request option inside every configuration object.

Launch

The launch configuration launches a Chrome instance running a specified file or URL. If you specify a URL, you have to set webRoot to the directory that files are served from. This can be either an absolute path or a path using the ${workspaceFolder} resolver. This is the folder opened in your Visual Studio Code workspace.

Note: Be careful while setting webRoot, this is used to resolve URLs to a file on your computer.

You can see an example of two launch configurations: One launching against a local server and the other launching against a local file.

If you have a Chrome instance running, the one launched by the debugger will use a temporary session. This means that you won't have your extensions or opened tabs. If you want to launch a Chrome instance with your user and extensions, you have to close every running instance first.

Chromebook Xampp Download

Note: When you stop the debugger, this will close the Chrome window.

Chromebook Xampp Software

Attach

I personally prefer using this one… This configuration attaches the debugger to a running instance of Chrome. But in order for this option to work, you need to launch Chrome with remote debugging enabled. Launching a Chrome instance with remote debugging varies depending on your OS.

Windows

There are two ways to launch Chrome with remote debugging in Windows. The simplest one is to right-click on the Google Chrome shortcut. Select the properties option and append the following command in the target field.

Note: This will launch Chrome with remote debugging enabled every time you click on the shortcut.

The other way is to open the command prompt and execute this command replacing the th> with the actual location of your Chrome installation.

macOS

Open the terminal and execute the following command:

Chromebook Xampp Pro

Linux

Launch your terminal and run this command:

What this does — no matter what OS — is open Chrome with a flag, in this case: --remote-debugging-port, and sets it to 9222. You can read more about this here.

Note: If you have other Chrome instances running with no remote debugging, make sure to close them before launching a new one.

Here's a sample attach configuration.

Note: If you do not set the 'url' option, a list will be prompted with your open tabs. UTC to Honolulu Converter - Convert Universal Time to ....

This extension have a lot of very useful options that you can use to adapt the configurations to your project. You can read the documentation of some of them here.

Summary

Congratulations! You've learned how to install and set up the debugger for Chrome in Visual Studio Code. You also learned how to launch Google Chrome with remote debugging enabled. Now it's time for you to explore and expand your new knowledge… I highly recommend you to take a look at the extension's repository.

I hope you enjoyed this post. You can find me on Twitter @_svictoreq. ?





broken image