Ubuntu 12.04 x64 JAVEE

  1. 安裝jdk

    a.http://download.csdn.net/download/weidi1989/6420205 下載jdk6 x64 bin文件

    b.創建 /usr/local/java 目錄將bin文件拷貝這裏

        c.vim /etc/profile

           添加 # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))  
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).  
#set java environment  
  
export JAVA_HOME=/usr/local/java/jdk1.6.0_37  
  
export JRE_HOME=/usr/local/java/jdk1.6.0_37/jre  
  
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH  
  
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$JAVA_HOME:$PATH         

       d.source /etc/profile  這個操作只對當前的對話域中有效果,如果想總是起效的話,需要重新啓動電腦

        e.java -verison 驗證


2.安裝tomcat

  a.apt-get install tomcat7 

  b.工程,log等文件在/var/lib/tomcat7    server配置在/usr/share/tomcat7/  下

  c.設置啓動參數

    修改/usr/share/tomcat7/bin/catalina.sh文件

    在cygwin=false前添加(物理內存512M)

     JAVA_OPTS="-server -Xms200M -Xmx400M -XX:PermSize=128M -XX:MaxPermSize=256M"

  d.啓動關閉

   service tomcat7 restart

    /etc/init.d/tomcat7 stop

    /etc/init.d/tomcat7 start

3.部署

   a.工程右鍵->export->javaee->war file

    如果報錯10.7.1 可參考http://download.csdn.net/download/cfltp/8005467

   b.打成zip包,上傳也可

4.修改tomcat ROOT目錄

    找到 :

            

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

     下面添加

<Context path="" docBase="XXXXX" debug="0" reloadable="true" />

 

5.安裝mysql

    a.驗證原有主機上是否安裝mysql:sudo netstat -tap | grep mysql

    b.sudo apt-get install mysql-server mysql-client來安裝mysql

    c.配置文件:vim /etc/mysql/my.cnf

    d.mysql 遠程授權

      現在my.cnf中註釋bing-adress=127.0.0.1

      #mysql -u root -p      

     #GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'password' WITH GRANT OPTION;

6.修改mysql密碼:

1.  確認服務器處於安全狀態,因爲數據庫都很重要,在以下修改mysql的root賬戶的密碼中,任意用戶都能訪問修改你的數據庫,所以建議斷網,在不聯網的環境下修改。

2.  關閉MySQL,打開/etc/my.cnf,在[mysqld]的段中加上一句:skip-grant-tables,保存退出。

3. [...] # /etc/init.d/mysqld restart 
Stopping MySQL: [ OK ] 
Starting MySQL: [ OK ] 

4. [...] # /usr/bin/mysql 

Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 3 to server version: 3.23.56 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 

mysql> USE mysql ; 
Reading table information for completion of table and column names 
You can turn off this feature to get a quicker startup with -A 
Database changed 

mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ; 
Query OK, 0 rows affected (0.00 sec) 
Rows matched: 2 Changed: 0 Warnings: 0 

mysql> flush privileges ; 
Query OK, 0 rows affected (0.01 sec) 

mysql> quit 
Bye 

5.[...] # vi /etc/my.cnf ,將剛纔在[mysqld]的段中加上的skip-grant-tables刪除 ,保存並且退出vi。 
6.[...] # /etc/init.d/mysqld restart 
Stopping MySQL: [ OK ] 
Starting MySQL: [ OK ]


  


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章