Showing posts with label web aplikasi. Show all posts
Showing posts with label web aplikasi. Show all posts

Tuesday, December 10, 2013

Cara Installasi Tomcat Web Server pada Windows

Download and Install Tomcat

For Windows
  1. Goto http://tomcat.apache.org ⇒ Downloads ⇒ Tomcat 8.0 ⇒ "8.0.{xx}" (where {xx} is the latest upgrade number) ⇒ Binary Distributions ⇒ Core ⇒ "zip" package (e.g., "apache-tomcat-8.0.{xx}.zip", about 8 MB).
  2. UNZIP into a directory of your choice. DO NOT unzip onto the Desktop (because its path is hard to locate). I suggest using "d:\myproject". Tomcat will be unzipped into directory "d:\myproject\apache-tomcat-8.0.{xx}". For ease of use, we shall shorten and rename this directory to "d:\myproject\tomcat". Take note of Your Tomcat Installed Directory. Hereafter, I shall refer to the Tomcat installed directory as (or - "Catalina" is the codename for Tomcat 5 and above).
(Advanced) A better approach is to keep the original directory name, such as apache-tomcat-8.0.{xx}, but create a symlink called tomcat via command "mklink /D tomcat apache-tomcat-8.0.{xx}". Symlink is available in Windows Vista/7/8 only.

For Mac
  1. Goto http://tomcat.apache.org ⇒ Download ⇒ Tomcat 8.0 ⇒ "8.0.{xx}" (where {xx} denotes the latest upgrade number) ⇒ Binary distribution ⇒ Core ⇒ "tar.gz" package (e.g., "apache-tomcat-8.0.{xx}.tar.gz", about 8 MB).
  2. To install Tomcat:
    1. Goto "~/Downloads", double-click the downloaded tarball (e.g., "apache-tomcat-8.0.{xx}.tar.gz") to expand it into a folder (e.g., "apache-tomcat-8.0.{xx}").
    2. Move the extracted folder (e.g., "apache-tomcat-8.0.{xx}") to "/Applications".
    3. Rename the folder to "tomcat", for ease of use. Take note of Your Tomcat Installed Directory. Hereafter, I shall refer to the Tomcat installed directory as (or - "Catalina" is the codename for Tomcat 5 and above).

Set the TCP Port Number ["conf\server.xml"]

The default TCP port number configured in Tomcat is 8080, you may choose any number between 1024 and 65535, which is not used by an existing application. We shall choose 9999 in this article. (For production server, you should use port 80, which is pre-assigned to HTTP server as the default port number.)
Locate the following lines, and change port="8080" to port="9999".


port="9999"
protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />


Enabling Directory Listing ["conf\web.xml"]

Again, use a programming text editor to open the configuration file "web.xml", under the "conf" sub-directory of Tomcat installed directory.
We shall enable directory listing by changing "listings" from "false" to "true" for the "default" servlet. This is handy for test system, but not for production system for security reasons.
Locate the following lines and change from "false" to "true".





 



  default
  org.apache.catalina.servlets.DefaultServlet
  
    debug
    0
  
  
    listings
    true
  
  1
 
 

Enabling Automatic Reload ["conf\context.xml"]


We shall add the attribute reloadable="true" to the element to enable automatic reload after code changes. Again, this is handy for test system but not for production, due to the overhead of detecting changes.
Locate the start element, and change it to .

reloadable="true"
> ......
 

Optional ["conf\tomcat-users.xml"]

Enable the Tomcat's manager by adding the highlighted lines, inside the elements:

  
  
This enables the manager GUI app for managing Tomcat server.

Starting TOMCAT

For Windows
Launch a CMD shell. Set the current directory to ">\bin", and run "startup.bat" as follows:
// Change the current directory to Tomcat's "bin"
// Assume that Tomcat is installed in "d:\myproject\tomcat"
> d:                           // Change the current drive
d:\> cd \myproject\tomcat\bin  // Change Directory to YOUR Tomcat's "bin" directory
 
// Start Tomcat Server
D:\myproject\tomcat\bin> startup
 
 
For Mac
I assume that Tomcat is installed in "/Applications/tomcat". To start the Tomcat server, open a new "Terminal" and issue:
// Change current directory to Tomcat's binary directory
$ cd /Applications/tomcat/bin
 
// Start tomcat server
$ ./catalina.sh run
 
 

Client Access

use bellow link to access 
Http://host:port/appfolder
 

Stopping TOMCAT

For Windows
You can shutdown the tomcat server by either:
  1. Press ctrl-c on the Tomcat console; or
  2. Run "\bin\shutdown.bat" script:
    // Change the current directory to Tomcat's "bin"
    > d:                           // Change the current drive
    d:\> cd \myproject\tomcat\bin  // Change Directory to YOUR Tomcat's "bin" directory
     
    // Shutdown the server
    d:\myproject\tomcat\bin> shutdown
    
For Mac
To shutdown the Tomcat server:
  1. Press control-c (NOT command-c); or
  2. Run the "/bin/shutdown.sh" script. Open a new "Terminal" and issue:
    // Change current directory to Tomcat's bin directory
    $ cd /Applications/tomcat/bin
     
    // Shutdown the server
    $ ./shutdown.sh
 
 
WARNING: You MUST properly shutdown the Tomcat. DO NOT kill the cat by pushing the window's "CLOSE" button.
 



Monday, November 11, 2013

Instalasi Apache Ofbiz sebagai Service pada Ubuntu Startup

Ketika anda menginstal aplikasi Ofbiz pada ubuntu anda akan mendapatkan file rc.ofbiz.for.ubuntu,
silahkan cari di directory ofbiz. misal /home/ofbiz/
jika anda tidak menjumpainya, maka anda bisa mengunduh dari SVN. dan anda perlu sedikit dimodifikasi agar dapat bekerja dengan baik.

OFBIZUSER="root"
OFBIZDIR="" //provide the ofbiz home directory


# Start OFBiz
start() {
    running
    if [ "$OFBIZ_PROCS" = "" ]; then
        echo "Ofbiz is already running..."
        return 0
    fi
    if [ "$USER" = "$OFBIZUSER" ]; then
        echo "starting standard ~/$OFBIZDIR/startofbiz.sh"
        cd ~/$OFBIZDIR
        ./startofbiz.sh >> $OFBIZDIR /runtime/logs/console.log 2>> $OFBIZDIR /runtime/logs/console.log&
        if [ $? = 0 ]; then 
            echo "start success"
        else
            echo "starting ofbiz user: $OFBIZUSER in dir: $OFBIZDIR failed return code: $?"
        fi
        return 0
    fi
}


stop() {
    if [ "$USER" = "$OFBIZUSER" ]; then
        echo "stopping standard ~/$OFBIZDIR/stopofbiz.sh"
        cd ~/$OFBIZDIR
   MAXCOUNT=10
        COUNTER=0
        until [ $COUNTER -gt $MAXCOUNT ]; do
             COUNTER=$((COUNTER+1))
             echo "Attempt number: $COUNTER"


            ./stopofbiz.sh
            if [ $? = 1 ]; then
                echo "stop success" 
                return 0
            fi
            sleep 3
        done
        echo "stopping ofbiz from user: $OFBIZUSER failed after $MAXCOUNT attemps"
        return 1
    fi
}


#check for user, if wrong try to change to 'OFBIZUSER' and re-execute.
checkUser() {
    if [ "$USER" != "$OFBIZUSER" ]; then
        if [ "$USER" = "" ]; then
            exec su - $OFBIZUSER -c "$0 $1 "
   else
       exec sudo -u $OFBIZUSER $0 $1 
   fi
        exit $?
    fi
}


# OFBiz processes running
running() {
    OFBIZ_PROCS=`/bin/ps h -o pid,args -C java -u $OFBIZUSER | /bin/grep -e "-jar ofbiz.jar" | /bin/egrep -o "^[[:space:]]*[[:digit:]]*"`
}


#========= main program ===============
checkUser $1
case "$1" in
    "start")
        start
    ;;
    "stop")
        stop
    ;;
    "restart")
        stop
        start
    ;;
    "status")
        running
        if [ "$OFBIZ_PROCS" = "" ]; then
            echo "OFBiz for user: $OFBIZUSER in dir: $OFBIZDIR is stopped"
            exit 1
        else
            echo "OFBiz for user: $OFBIZUSER in dir: $OFBIZDIR is running"
            exit 0
        fi
    ;;
    *)
        echo "Usage: $0 {start|stop|restart|status|help} not: $1"
        exit 1
    ;;
esac
exit $?

Selanjutnya copy file ini /etc/init.d
cp /home/ofbiz/rc.ofbiz.for.ubuntu /etc/init.d/ofbiz
Setelah itu restart service menggunakan

service ofbiz restart



Sunday, November 10, 2013

Instalasi Aplikasi Apache OFBiz di Ubuntu


Apache OFBiz adalah suatu framework+common data model+ business process atau aplikasi ERP dan dibangun dengan Pemrogaman Java. Semua aplikasi dibuat dengan menggunakan arsitektur yang umum, menggunakan komponen-komponen data, logic dan process.

1. Pastikan ubuntu telah terinstall java, Untuk mengecek java telah terinstall, dapat menggunakan perintah di bawah ini.
$ java -version
2. Pastikan juga aplikasi svn telah terinstall pada Ubuntu, jika belum, lakukan perintah di bawah ini.
$ sudo apt-get install subversion
Kemudian cek dengan perintah :
$ svn --version
3. Diperlukan juga aplikasi ant pada ubuntu, untuk instalasinya dapat menggunakan perintah :
$ sudo apt-get install ant
 Kemudian cek dengan perintah :
$ ant -version
4. Aplikasi OFBiz memerlukan database, untuk database gunakan mysql-server, install pada Ubuntu dengan perintah :
$ sudo apt-get install mysql-server
5. Buat sebuah database dengan nama “ofbiz” dengan langkah-langkah di berikut :
$ mysql -uroot -p (Masukkan Password)
mysql> create database ofbiz;
mysql> use ofbiz;
mysql> grant all privileges on ofbiz.* to ofbiz@'%' identified by 'ofbiz';
mysql> grant all privileges on ofbiz.* to ofbiz@'localhost' identified by 'ofbiz';
mysql> create database ofbiztenant;
mysql> use ofbiztenant;
mysql> grant all privileges on ofbiztenant.* to ofbiz@'%' identified by 'ofbiz';
mysql> grant all privileges on ofbiztenant.* to ofbiz@'localhost' identified by 'ofbiz';
mysql> create database ofbizolap;
mysql> use ofbizolap;
mysql> grant all privileges on ofbizolap.* to ofbiz@'%' identified by 'ofbiz';
mysql> grant all privileges on ofbizolap.* to ofbiz@'localhost' identified by 'ofbiz';
mysql> exit
6. Buat sebuah folder untuk menampung source code dari ofbiz, buat folder pada direktori /opt.
$ sudo mkdir /opt/ofbiz
$ cd /opt/ofbiz
7. Checkout source code ofbiz dengan perintah:
$ sudo svn co http://svn.apache.org/repos/asf/ofbiz/trunk
8. Setelah selesai, unduh mysql connector yang akan digunakan sebagai konektor antara aplikasi OFBiz dengan mysql server, ikuti langkah-langkahnya di bawah ini.
$ cd ../
$ sudo wget http://download.softagency.net/MySQL/Downloads/Connector-J/mysql-connector-java-5.1.24.tar.gz
$ sudo tar -zxvf mysql-connector-java-5.1.24.tar.gz
$ sudo mv mysql-connector-java-5.1.24/mysql-connector-java-5.1.24-bin.jar ofbiz/trunk/framework/entity/lib/jdbc/
$ cd ofbiz
9. Ubah konfigurasi agar aplikasi ofbiz terhubung dengan mysql.
$ cd trunk/framework/entity/config/
$ sudo nano entityengine.xml
Ubah semua konfigurasi delegator menjadi seperti di bawah ini, kemudian simpan.

group-map group-name="org.ofbiz" datasource-name="localmysql"/>
group-map group-name="org.ofbiz.olap" datasource-name="localmysqlolap"/>
group-map group-name="org.ofbiz.tenant" datasource-name="localmysqltenant"/>


10. Setelah semua terkonfigurasi, saatnya untuk membuild aplikasi dengan ant, ikuti langkah berikut :
$ cd /opt/ofbiz/trunk
$ sudo ./ant build
11. Jika membuild aplikasinya selesai dan muncul pesan “BUILD SUCCESSFUL”, saatnya ke tahap berikutnya, yaitu Instalasi OFBiz, lakukan dengan perintah :
$ sudo ./ant run-install
$ sudo ./ant load-demo
12. Jika selesai, siap ke tahap menjalankan aplikasi, gunakan perintah di bawah ini.
$ sudo ./ant start
13. Jika telah berjalan, akses lewat web browser dan ketikkan url berikut pada address bar.
 http://127.0.0.1:8080/ecommerce/control/main
Login dengan menggunakan :
username : admin
password : ofbiz

 https://127.0.0.1:8443/webtools/control/main 
Login dengan menggunakan :
username : admin
password : ofbiz


 https://127.0.0.1:8443/catalog/control/main 
Login dengan menggunakan :
username : admin
password : ofbiz

Selamat mencoba

Saturday, November 9, 2013

Instalasi Aplikasi OFBIZ pada Windows 8 (apache open source ecommerce solution)

Apache OFBiz (The Apache Open For Business Project) merupakan open source berlisensi di bawah Apache License Version 2.0.  untuk lebih detail silahkan kunjungi http://ofbiz.apache.org/




Disini saya akan memberikan panduan bagaimana memulai aplikasi OFBIZ pada windows


Berikut langkah - langkahnya :
1. Download and Install SVN, anda bisa mendapatkannya di TortoiseSVN(http://tortoisesvn.net/downloads)

2. Download dan Install the Java Development Kit(JDK).anda bisa mendapatkannya di http://www.oracle.com/technetwork/java/javase/downloads/index.html

3. Tambahkan System environment dan User Variabel untuk command prompt.



pada control panel pilih system, kemudian pilih Advanced system settings, setelah itu pilih Environment variables..

Buat Baru user variable :
  Variable Name : ANT_HOME
  Variable value : D:\ofbiz
*) Variable value : lokasi dimana anda minyimpan folder aplikasi ofbiz

Buat Baru System Variable :
Variable Name : JAVA_HOME
Variable value : C:\Program Files\Java\jdk1.7.0_45
*) Variable value : lokasi dimana anda menginstal Java

4. Buka Command Prompt, anda bisa membukanya dari Start -->; Run -->; CMD

Rubah Direktori dimana anda sudah mengekstrak file ofbiz, misal D:/ofbiz maka change directory nya. contoh CD D:/ofbiz

jalankan perintah berikut :
ant load-demo
Kemudian memulai ofbiz dengan syntax :
ant start
Jika ingin berhenti :
ant stop

5. Buka dengan web browser link : https://localhost:8443/catalog/control/main 
catalog adalah module, jika module production maka catalog di ubah ke production
user name : admin
password : ofbiz