Fast-Linux project address: https://gitee.com/uitc/Fast-Linux introduce Initializing Linux and setting up some commonly used environments is a simple but time-consuming task, especially when your Linux crashes due to some uncontrollable factors, which means you have to deploy the environment again from scratch, which is a bit maddening. So I came up with the idea of building this Linux initialization script library. No matter you are a novice or an expert, you only need to run it with one click and then have a cup of coffee, and the environment can be successfully built. Isn't it wonderful? Due to my limited personal ability, I can only summarize the environment scripts I encountered (I am a Java developer and am not familiar with python, c/c++, etc.) Due to the large number of Linux versions and various development environments, this is a repository that needs everyone's contribution to become more and more powerful. Welcome to fork push start!!! Tutorial
Script update log (Note: If you need to submit, please add it after this log to indicate the script path and environment combination you added, in a unified format for easy management) 2020/7/26
#Set apt source echo "deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiversec" >/etc/apt/sources.list #Update apt source apt-get update #Allow root users to log in remotely via ssh sed -i "s/PermitRootLogin prohibit-password/#PermitRootLogin prohibit-password\nPermitRootLogin yes/g" /etc/ssh/sshd_config #Restart the ssh service service ssh restart #Append system commands to user variables to prevent the restart command from failing echo 'export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games' >>/etc/profile #Create a new folder and allocate resources mkdir /usr/local/java mkdir /usr/local/maven cp settings.xml /usr/local/maven #Install Java cd /usr/local/java #Download the java installation package curl -o jdk-8u251-linux-x64.tar.gz https://code.aliyun.com/kar/oracle-jdk/raw/3c932f02aa11e79dc39e4a68f5b0483ec1d32abe/jdk-8u251-linux-x64.tar.gz tar -zxvf jdk-8u251-linux-x64.tar.gz rm jdk-8u251-linux-x64.tar.gz #Add java system environment variables (available to all users) echo 'export JAVA_HOME=/usr/local/java/jdk1.8.0_251' >>/etc/environment echo 'export JRE_HOME=/usr/local/java/jdk1.8.0_251/jre' >>/etc/environment echo 'export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib' >>/etc/environment echo 'export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin' >>/etc/environment #Add java user environment variable echo 'export JAVA_HOME=/usr/local/java/jdk1.8.0_251' >>/etc/profile echo 'export JRE_HOME=/usr/local/java/jdk1.8.0_251/jre' >>/etc/profile echo 'export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib' >>/etc/profile echo 'export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin' >>/etc/profile #Install Maven cd /usr/local/maven #Download the Maven installation package curl -o apache-maven-3.6.3-bin.tar.gz https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz tar -zxvf apache-maven-3.6.3-bin.tar.gz rm apache-maven-3.6.3-bin.tar.gz #Add Maven system environment variables (available to all users) echo 'export M2_HOME=/usr/local/maven/apache-maven-3.6.3' >>/etc/environment echo 'export CLASSPATH=$CLASSPATH:$M2_HOME/lib' >>/etc/environment echo 'export PATH=$PATH:$M2_HOME/bin' >>/etc/environment #Add Maven user environment variables echo 'export M2_HOME=/usr/local/maven/apache-maven-3.6.3' >>/etc/profile echo 'export CLASSPATH=$CLASSPATH:$M2_HOME/lib' >>/etc/profile echo 'export PATH=$PATH:$M2_HOME/bin' >>/etc/profile #Create a new Maven repository mkdir repository #Modify Maven's configuration file# rm apache-maven-3.6.3/conf/settings.xml mv settings.xml apache-maven-3.6.3/conf #Reboot
#Docker environment setup script#Download Docker curl -fsSL get.docker.com -o get-docker.sh # sh get-docker.sh --mirror Aliyun sh get-docker.sh --mirror AzureChinaCloud #Configure mirror acceleration echo "{\"registry-mirrors\": [\"https://qy5lms4s.mirror.aliyuncs.com\"]}" >/etc/docker/daemon.json #Restart the service systemctl daemon-reload systemctl restart docker #Pull ubuntu:16.04 test docker pull ubuntu:16.04 #Installation of docker-compose curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m) >/usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose This is the end of this article about how to initialize Ubuntu 16.04, deploy Java, Maven, and Docker environments in three minutes. For more information about how to initialize Java, Maven, and deploy Docker environments in Ubuntu 16.04, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: The principle and application of MySQL connection query
>>: Understand all aspects of HTTP Headers with pictures and text
In a cluster with master-slave replication mode, ...
1. Introduction Vagrant is a tool for building an...
Table of contents 1. Supplementary knowledge poin...
Copy code The code is as follows: <!DOCTYPE ht...
Docker is a very popular container technology. Th...
MySQL master-slave setup MySQL master-slave repli...
This article uses examples to illustrate the impa...
Table of contents Preface 1. Deployment and Confi...
In most application scenarios, we need to back up...
Table of contents 1. HttpGET 2. HTTP POST WebSock...
Overview When a 500 or 502 error occurs during ac...
As a useful terminal emulator, Xshell is often us...
Preface Although some love in this world has a pr...
Docker virtualizes a bridge on the host machine. ...
This article mainly introduces the sample code of...