Setting up a Java operating environment under Ubuntu

Source: Internet
Author: User

(i) Linux operating system installation (details see: http://my.oschina.net/u/1458864/blog/366665)
1. Install the Oracle VM VirtualBox
2. Installing vagrant
3. Download box
4.vagrant add box to virtual machine (http://my.oschina.net/u/1458864/blog/366665)
Initialize Vagrant:vagrant init (see the configuration instructions for vagrant for more information)
Add box:vagrant box Add base F:\docker\box\precise64.box to vagrant
Start a box:vagrant up
5. telnet to box for authentication. User name: vagrant password vagrant


(ii) Docker installation (details see: http://my.oschina.net/u/1458864/blog/366672)
1. Update the Ubuntu system kernel
sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
2. Add Docker repository to the local KeyStore
sudo apt-key adv--keyserver keyserver.ubuntu.com--recv-keys 36a1d7869245c8950f966e92d8576a8ba88d21e9
3.Docker added to your apt software installation source
sudo sh-c "Echo Deb Http://get.docker.io/ubuntu docker main/etc/apt/sources.list.d/docker.list"


sudo apt-get install software-properties-common #增加 add-apt-repository command
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:dotcloud/lxc-docker #增加一个ppa源, such as: Ppa:user/ppa-name
sudo apt-get update #更新系统
sudo apt-get install Lxc-docker

(iii) Docker use (Details see: http://my.oschina.net/u/1458864/blog/366682)
1.docker Images
2.docker Search Ubuntu
3.docker pull Ubuntu
4.docker run-i-t-p 3306:3306 Ubuntu (run in the background and map port 3306)
5.docker ps-a
6.docker logs Containerid
7.docker RM Containerid
8.docker RMI ImageID
9.sudo Docker run-t-i-v/home/linjiqin/dev/docker:/home/mycontainer:rw-p 8000:8000 mydocker/bin/bash (shared disk)
10.sudo Docker--name--link (for container naming and access mapping between containers)
11.docker Attach Containerid
12.docker push Ubuntu

(d) Docker creates a private library (details see: http://my.oschina.net/u/1458864/blog/369057)
1.docker Pull Registry
2.docker run-i-t-p 5000:5000 Registry
3.docker tag Ubuntu 192.168.33.10:5000/ubuntu
4.docker Push 192.168.33.10:5000/ubuntu
5.curl Http://192.168.33.10:5000/v1/search
6.docker HTTPS security authentication, need to configure Ubuntu in the Docker client configuration file address is:/etc/init/docker.conf in which add--insecure-registry 192.168.33.10:5000


(v) Java environment Construction
1. Install JDK, Tomcat, Nexus, MySQL
2. Environment variable configuration file Modification vi ~/.BASHRC
Export java_home=/opt/jdk1.7
Export Jre_home= $JAVA _home/jre
Export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
Export M2_home=/opt/maven
Export m2= $M 2_home/bin
Export path= $M 2: $PATH
Export Run_as_user=root
3. Modify the startup script vi/ect/rc.local
Export java_home=/opt/jdk1.7
Export Jre_home= $JAVA _home/jre
Export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
Export M2_home=/opt/maven
Export m2= $M 2_home/bin
Export path= $M 2: $PATH
Export Run_as_user=root
Service Tomcat
Service Nexus Start
4.mysql Permissions Modification
Vi/ect/mysql/my.conf
Modify Bind_address 0.0.0.0
Log in to MySQL mysql-u root-r
GRANT all privileges on * * to ' root ' @ '% ' identified by ' mypwd ' with GRANT OPTION;
Flush privileges;

Setting up a Java operating environment under Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.