AD

Ubuntu under jdk, mysql, tomcat installation and configuration

A, jdk installation

1. Download and install sun jdk
First, **java.sun** download jdk-6u20-linux-i586.bin

2. To authorize the downloaded file and move to the specified folder Code:
$ Sudo chmod u + x jdk-6u20-linux-i586.bin

3. Executable file to install the code:
$ Sudo-s ./jdk-6u20-linux-i586.bin
All the way to enter, that displays pop-up page Done

4. Configuring environment variables
$ Sudo gedit / etc / profile
Added at the end in the most
# Set java environment
export JAVA_HOME = / usr/developenviroment/jdk1.6.0_21
export JRE_HOME = / usr/developenviroment/jdk1.6.0_21/jre
export CLASSPATH =.: $ JAVA_HOME / lib: $ JRE_HOME / lib: $ CLASSPATH
export PATH = $ JAVA_HOME / bin: $ JRE_HOME / bin: $ PATH

5. To set the default jdk
Because the default ubuntu as the default specified open jdk jdk, its Chinese support is not good, we can manually specify the default jdk
Code:
$ Sudo update-alternatives - install / usr / bin / java java / usr/developenviroment/jdk1.6.0_21/bin/java 300
$ Sudo update-alternatives - install / usr / bin / javac javac / usr/developenviroment/jdk1.6.0_21/bin/javac 300

6. Jdk installed to join our java menu code:
$ Sudo update-alternatives - config java

Into the super-user:
sudo-i
Select the path priority status
-------------------------------------------------- ----------
* 0 / usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 / usr/developenviroment/jdk1.6.0_21/bin/java 300 manual mode
2 / usr/developenviroment/jdk1.6.0_21/bin/javac 300 manual mode
3 / usr/java/jdk1.6.0_21/bin/java 300 manual mode
4 / usr/java/jdk1.6.0_21/bin/javac 300 manual mode
5 / usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode where we choose 1 and then Enter

7. The test environment is set up successfully
$ Java-version

java version "1.6.0_21"
Java (TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot (TM) Server VM (build 17.0-b16, mixed mode

Second, tomcat installation and configuration

First of all, to ensure that jdk is installed and have set the JAVA_HOME environment variable.
Then, in **tomcat.apache**/ for download apache-tomcat-5.5.27.tar.gz, I will move it to / usr / deveopenviroment, then run

1. Decompression code:
$ Sudo tar-zxvf apache-tomcat-5.5.27.tar.gz

Get a folder apache-tomcat5.5.27
At this point, tomcat is installed.
After installing the tomcat does not run, that **locathost:8080 in the address bar does not show the installation was successful.
Thus, the implementation of

Code:
$ Sudo / usr/deveopenviroment/apache-tomcat-5.5.27/bin/startup.sh
Show JAVA_HOME environment variable is not set, solutions are listed below

2. Configure tomcat environment variable code:
sudo vi / usr/deveopenviroment/apache-tomcat-5.5.27/bin/catalina.sh
Modify catalina.sh file, insert the comment in the beginning of the file reference:
JAVA_HOME = "/ usr/developenviroment/jdk1.6.0_21"

3. Open tomcat
$ Sudo / usr/deveopenviroment/apache-tomcat-5.5.27/bin/startup.sh
Get the following message
Using CATALINA_BASE: / usr/developenviroment/apache-tomcat-5.5.31
Using CATALINA_HOME: / usr/developenviroment/apache-tomcat-5.5.31
Using CATALINA_TMPDIR: / usr/developenviroment/apache-tomcat-5.5.31/temp
Using JRE_HOME: / usr/developenviroment/jdk1.6.0_21
Using CLASSPATH: / usr/developenviroment/apache-tomcat-5.5.31/bin/bootstrap.jar
Open **localhost:8080 in the browser while you can see the welcome page that configuration was successful

4. Modify the tomcat port code:
$ Sudo vi / usr/deveopenviroment/apache-tomcat-5.5.27/conf/server.xml
Modify server.xml, to which all of the figures changed to 80 to 8080, modified port location for reference:
<Connector Port="8080"....../>
Port 80 is rather special, if you change the port 80, you can directly enter **localhost/ in the address bar of your web access

5. Add user name and password code:
$ Sudo gedit / opt/apache-tomcat-6.0.18/conf/tomcat-users.xml

<? Xml version = '1 .0 'encoding =' utf-8 '?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manager"/>
</ Tomcat-users>

6. Startup and shutdown tomcat
Startup code:
~ $ Sudo / usr/deveopenviroment/apache-tomcat-6.0.18/bin/startup.sh

Close Code:
~ $ Sudo / usr/deveopenviroment/apache-tomcat-6.0.18/bin/shutdown.sh

TOMCAT those. Sh files are not executable, then find the command:
To all. Sh executable
chmod + x *. sh

Third, mysql installation and configuration

1.ubuntu under

mysql installation sudo apt-get install mysql-server

2. Configuration-related

Configure MySQL

Note that in MySQL by default under Ubuntu only allows local access, if you are able to access other machines, then the need to change / etc / mysql / my.cnf configuration files! Here we come a step by step:

The default MySQL installation is not the root user password, so the first entry with the root user:

$ Mysql-u root-p Enter

The reason here is with the-u root because I am an ordinary user (firehare), if not, then-u root, mysql thought it was firehare in the registry.
Note that I did not enter the root user mode here, because not necessary. In general, the mysql database to operate, there is no need to enter the root user mode, only when you have such a possibility in the set.

Into mysql, the most important thing is to set the root Mysql password, otherwise, Mysql service no security to speak of.

mysql> GRANT ALL PRIVILEGES ON *.* TO root @ localhost IDENTIFIED BY "123456";

Note that I used here is 123456 as the root user's password, but the password is not secure, please use the best mix of uppercase and lowercase letters and numbers password, and not less than 8 bits.

In this case, to set the MySQL root user password in, and then use the root user to establish a database you need. I am here to xoops example:

mysql> CREATE DATABASE xoops;

mysql> GRANT ALL PRIVILEGES ON xoops .* TO xoops_root @ localhost IDENTIFIED BY "654321";

This created a xoops_roots users, it has all the xoops database permissions. Later come to the right to use the xoops_root xoops database management, without the need for the user then root, while the user's authority is limited only in the xoops database.

If you want to remote access or control, then you have to do two things:

First:
mysql> GRANT ALL PRIVILEGES ON xoops .* TO xoops_root @ "%" IDENTIFIED BY "654321";

Allow xoops_root users can log in from any machine on MySQL.

Second:
$ Sudo gedit / etc / mysql / my.cnf

Old version

> Skip-networking => # skip-networking

New version

> Bind-address = 127.0.0.1 => bind-address = IP of your machine

This allows other machines to access the MySQL
标签: java sun, sun jdk, export path, environment variables, java jdk1, java environment, classpath java, jdk installation, java version, downloaded file, version java, export classpath, sudo chmod, menu code, chinese support, mysql tomcat, java hotspot, java menu, priority status, manual mode
分类: OS
时间: 2010-11-14

相关文章

  1. Ubuntu under jdk, mysql, tomcat installation configuration

    A, jdk installation 1 Download and install sun jdk First, at http://java.sun.com download jdk-6u20-linux-i586. ...
  2. Ubuntu install JDK, MySQL, Tomcat

    JDK Version: jdk-6u20-linux-i586-rpm.bin Tomcat version: apache-tomcat-6.0.29.tar.gz Mysql version: mysql-5.1. ...
  3. linux software installation (jdk, mysql, tomcat)

    linux software installation (jdk, mysql, tomcat) (2009-06-26 21:11:21) Run the installation file / Etc / profi ...
  4. jdk + tomcat installation and configuration

    Install and configure JDK: in fact the Path and Classpath and JAVA_HOME configuration JDK platform Java compil ...
  5. Use of InstallAnywhere 2009 Integrated jdk mysql tomcat to EXE

    1. Write two batch files: install.bat and uninstall.bat, on the service directory. install.bat content: set JA ...
  6. Ubuntu is installed JDK, MySQL, Tomcat

    JDK Version: jdk-6u20-linux-i586-rpm.bin Tomcat version: apache-tomcat-6.0.29.tar.gz Mysql version: mysql-5.1. ...
  7. Nginx + Tomcat installation and configuration of integrated (switch)

    1. Preparation software apache-tomcat-6.0.26.tar.gz http://tomcat.apache.org/download-60.cgi jdk-6u20-linux-i5 ...
  8. Linux + apache + mysql + php + phpmyadmin + svn + jdk + tomcat installation and configuration

    Install mysql tar-zxvf mysql-xxx.tar.gz cd mysql-xxx . / Configure - prefix = / usr / local / mysql - sysconfd ...
  9. jdk + apache + tomcat installation configuration

    apache2 install apt-get install apache2 tomcat6 install apt-get install tomcat6 jdk6 install apt-get install o ...
  10. (Transfer) OpenSuse install jdk \ mysql \ tomcat \ nginx \ mysql-proxy

    1. Install jdk a. go to http://java.sun.com download jdk (j2se) 1.6.0_19.bin b. # chkmod 777. / jdkxxx.bin c. ...
  11. Ubuntu installed JDK configure Tomcat service

    1. First install JDK Install the jdk-6u13-linux-i586.bin version. First switch to the administrator account ro ...
  12. Apache and Tomcat Installation and Configuration Guide

    1. The required packages j2sdk-1_4_1_02-linux-i586 Apache2.0.40 (Red Hat Linux) jakarta-tomcat-4.1.18 jakarta- ...
  13. tomcat installation and configuration.

    (This article is from the entire data collection) (A, Downloads) Tomcat Official Download: http://tomcat.apach ...
  14. Linux, Java, Tomcat installation and configuration of the environment (CentOS + JDK1.6)

    One. JDK 1 download JDK .............. 2 Installation 1) Create a folder # Mkdir / usr / java 2) Download a go ...
  15. ubuntu android sdk 1.5 Installation and Configuration

    1. Download android sdk Download the following address: http://dl.google.com/android/android-sdk-windows-1.5_r ...
  16. Ubuntu 下 JDK和Tomcat安装

    选择安装 sun-java6-jdk. apt-get install sun-java6-jdk 设置JAVA_HOME变量 编辑/etc/profile文件,添加如下内容: JAVA_HOME=/usr/lib/jv ...
  17. tomcat installation and configuration under linux

    Transfer from my ChinaUnix this blog: http://blog.chinaunix.net/u3/107162/showart_2188996.html 2010-03-02 Toda ...
  18. Linux installation and vncServer FTPServer apache tomcat installation

    1, download the Linux operating system pre-prepared apache and tomcat JDK64_Linux bit and JDK32_Linux Download ...
  19. Linux system installation and vncServer FTPServer apache tomcat installation

    1, download the Linux operating system pre-prepared apache and tomcat JDK64_Linux bit and JDK32_Linux Download ...