Sencha Inc. | HTML5 Apps

Prepare Your Machine for EXT JS

Published Feb 27, 2009 | T.J. Yang | Tutorial | Easy
Last Updated Jul 11, 2011

This Tutorial is most relevant to Ext JS, 2.x, 3.x.

This article is currently due for review
We suspect that this article may be out-of-date or contain incorrect information.
But we are constantly editing articles, so we promise we will get to this one soon.


Ext JS is a javascript framework you can use to create professional graphical web user interfaces and AJAX web applications.

web-browser/
`-- javascript-framework
    |-- extjs
    `-- script-language
        |-- C
        |-- asp
        |-- databases
        |   |-- mysql
        |   `-- oracle
        |-- perl
        |-- php
        `-- python

As you can see from above diagram, there are many different paths to build a web application using different database backends and middle scripting languages to do the data processing between web frontend and database backend. This tutorial is to help making the pre-work needed for running the community Ext JS tutorial examples.

This article started with using Fedora 10 since most of extjs need software can be installed easily by just "yum install pkgname".

Please contribute your successful notes here for OS not listed here.

Fedora 10

Download and install Fedora 10 and you see following release note.

[me@fedora10 Tutorial_Part_12]$ cat /etc/redhat-release
Fedora release 10 (Cambridge)
[me@fedora10 Tutorial_Part_12]$

Package Manager

  • Get yum pass through a machine behind a firewall
[me@fedora10 ~]$ grep proxy  /etc/yum.conf
proxy=http://firewall.test.com:8080
proxy_username=myname
proxy_password=mypassword
[me@fedora10 ~]$
  • "SELINUX=disabled" in /etc/selinux/config.
  • yum search httpd

Web Server

Apache HTTP Server 2.2 is included in Fedora 12 but does not automatically start at boot time. To do this check your default runlevel with this command:

[root@fedoradev ~]# runlevel

Set apache autostart for your default runlevel (we assume 5 for all examples)

[root@fedoradev ~]# chkconfig --level 5 httpd on

The server's default root dir is /var/www/html

Databases

Oracle

References:

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
ORA_OWNER=oracle
 
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi
 
case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
        su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
        su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
        ;;
esac
  • Oneliner for install needed software in Fedora 10.
yum install binutils  glibc glibc-common libgcc \
libstdc++ make elfutils-libelf elfutils-libelf-devel \
glibc-devel gcc gcc-c++ libstdc++-devel unixODBC \
unixODBC-devel libaio libaio-devel sysstat compat-libstdc++-33 xterm ksh

MySQL

  • To install MySQL enter:
[root@fedoradev ~]# yum install mysql mysql-server

Make sure that the server automatically starts:

chkconfig --level 5 mysqld on

Start the server and set a password for root:

[root@fedoradev ~]# /etc/init.d/mysqld start
[root@fedoradev ~]# /usr/bin/mysql_secure_installation
  • Knowing your MySQL version infomation
[tjyang@ibm ~]$ mysqladmin version -p
mysqladmin  Ver 8.41 Distrib 5.0.67, for redhat-linux-gnu on i386
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
 
Server version          5.0.67
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/lib/mysql/mysql.sock
Uptime:                 21 days 2 hours 59 min 15 sec
 
Threads: 1  Questions: 1259  Slow queries: 0  Opens: 31  \
Flush tables: 1  Open tables: 21  Queries per second avg: 0.001
[tjyang@ibm ~]$

Postgresql

TBC.

Scripting Languages

Python

Python 2.6.2 comes with Fedora 12.

Perl

Perl v5.10.0 comes with Fedora 12.

PHP

Install PHP 5.3 and the Apache PHP module:

[root@fedoradev ~]# yum install php

You have to restart Apache afterwards:

[root@fedoradev ~]# /etc/init.d/httpd restart

To make sure your php has mysql library compiled within, we will create a small demo web site to display in your browser:

[root@fedoradev ~]# gedit /var/www/html/info.php

Enter these lines and save the file:

<?php
phpinfo();
?>

Open http://localhost/info.php on your machine to display the php info page. If MySQL is not listed as a module than you have to add MySQL support to PHP5:

[root@fedoradev ~]# yum install php-mysql

Restart apache after the installation.


Alternatively:

[me@fedora10 ~]$ cat phpinfo.php
<?
phpinfo();
?>
[me@fedora10 ~]$ php  phpinfo.php |grep mysql
Configure Command =>  './configure'  '--build=i386-redhat-linux-gnu'
<snip>
'--with-ldap-sasl' '--with-mysql=shared,/usr'
'--with-mysqli=shared,/usr/bin/mysql_config' '--enable-dom=shared'
'--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-pgsql=shared'
'--with-snmp=shared,/usr' '--enable-soap=shared'
'--with-xsl=shared,/usr' '--enable-xmlreader=shared'
'--enable-xmlwriter=shared' '--enable-fastcgi' '--enable-pdo=shared'
'--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr'
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr'
'--enable-json=shared' '--enable-zip=shared' '--with-readline'
'--enable-dbase=shared' '--with-pspell=shared'
'--with-mcrypt=shared,/usr' '--with-mhash=shared,/usr'
'--with-tidy=shared,/usr' '--with-mssql=shared,/usr'
 
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo_mysql.ini,
mysql
MYSQL_SOCKET => /var/lib/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib/mysql -lmysqlclient
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
<snip>
mysqli.reconnect => Off => Off
PDO drivers => mysql, pgsql, sqlite
pdo_mysql
[me@fedora10 ~]$
Share this post:
Leave a reply

Written by T.J. Yang

1 Comment

SloffWoblogma

3 years ago

lo que yo queria, gracias

Leave a comment:

Commenting is not available in this channel entry.