Tuesday, January 15, 2013

SET ENVIRONMENT COMMAND LINE WINDOW


Procedure for Building and Deploying the Application
The build files are present in the tutorial folders, so the steps you need to follow to build
and deploy the application are quite simple.
Note:
These instructions assume particular folder locations for Ant, Nexaweb
Platform, and the Java Developers Kit. On your PC, the locations may be
different.

  1. Open a command window.
  2. Make sure that the bin folder of the Ant installation is in your PATH.
    set PATH=%PATH%;C:\apache-ant-1.6.2\bin
  3. Make sure the .jar file containing the nexawebify Ant task is in your CLASSPATH.
    set CLASSPATH=%CLASSPATH%;C:\Program Files\Nexaweb\Nexaweb
    Platform 4.0\bin\nexaweb-platform-installer.jar
  4. Make sure the location of your Java Development Kit is specified in JAVA_HOME.
    set JAVA_HOME=C:\jdk1.3.1_09
  5. Navigate to the folder:
    cd C:\Program Files\Nexaweb\Nexaweb Platform 4.0\samples\tutorial1
  6. Run Ant specifying the target: dist.
    ant dist
    Ant will read through and process the instructions in build.xml and display progress
    messages for each step. In the final step, Ant will build the WAR file. If everything is
    OK, the final message is “BUILD SUCCESSFUL”.
  7. Copy the WAR file from tutorial1/dist to your servlet container.
  8. Follow the procedure for your servlet container to deploy a WAR file.

Note:
You can get a list of build targets and the default target by running:
ant -projecthelp

Sửa lỗi chạy MYSQL trên CentOS

Error occure when using command  :

# mysql  -u root -p

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)



Are you sure you installed mysql as well as mysql server.. ?
For example to install mySql server I'll use yum or apt to install both mysql command line tool and the server:
#yum -y install mysql mysql-server
or #apt-get install mysql mysql-server
Enable the MySQL service:
#/sbin/chkconfig mysqld on
Start the MySQL server:
#/sbin/service mysqld start
afterwards set the MySQL root password:
#mysqladmin -u root password 'new-password' (with the quotes)

Try :#mysql -u root -p
 
hope this help.
References : stackoverflow 

Xác đinh chương trình nào đang sử dụng port nào

// dùng su để lấy quyển root
#su 
// dùng lệnh netstat -tulpn để liệt kê các port đang bị chương trình nào sử dụng.
#netstat -tulpn