Ubutu: mysql + jdk + tomcat installation

Note: 本例中所有Ubutu 操作均使用的root用户,如果当前非root用户,请使用sudo,并且记得需要时更改目录权限为777

Install MySQL on Ubutu:

下载安装包:https://dev.mysql.com/downloads/mysql/

Download the installation package and copy it to Linux machine under /home/agu/installer.

In the shell command, run following in order:

root@agu:~# dpkg -i /home/agu/installer/mysql-apt-config_0.8.10-1_all.deb

root@agu:~# apt-get update

  root@agu:~# apt-get install mysql-server

Till now, mysql is installed successfully, run following in order to check mysql status and start, stop the service

root@agu:~# service mysql status

root@agu:~# service mysql stop

root@agu:~# service mysql start

Install and configure JDK on Ubutu:

1. Download jdk from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. copy the jdk to linux machine and unzip it: tar -zxvf jdk-8u172-linux-x64.tar.gz

root@agu:/usr/local$ tar -zxvf jdk-8u172-linux-x64.tar.gz 

3. move the jdk to /usr/lcal

root@agu:~#  mv /home/agu/installer/jdk1.8.0_172  /usr/local/

4. 输入: vim /etc/profile  进入编辑界面并在末尾加上

export JAVA_HOME=/usr/local/jdk1.8.0_172
export JRE_HOME=/usr/local/jdk1.8.0_172/jre  

exportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib  

export PATH=$PATH:$JAVA_HOME/bin

完成后输入 :wq 保存退出

输入 source /etc/profile  使配置生效

输入 java -version  查看版本

Install Tomcat on Ubutu:

1. Download tomcat and copy to ubutu machine.

2. zip the tar file

root@agu:/home/agu/installer# tar -zxvf apache-tomcat-9.0.8.tar.gz 

3. copy the un-zipped comcat folder to /usr/local

root@agu:/home/agu/installer# mv  ./apache-tomcat-9.0.8 /usr/local

4. Cd to the tomcat/bin dir,start tomcat

root@agu:/usr/local/apache-tomcat-9.0.8/bin# ./startup.sh 

If you see following, then tomcat is intalled successfully:

5. 一般默认的端口则是8080,所以直接在你的电脑的浏览器输入 你的ip地址加上端口号,即可以访问到tomcat的首页了。 http://【你的linux服务器IP地址】:8080 

注意:ip地址 是你Linux服务器的ip地址,如何获取?--->在Linux中输入ifconfig 就可以获取到了!

refer to: https://www.cnblogs.com/liulinghua90/p/4661424.html

原文地址:https://www.cnblogs.com/alicegu2009/p/9174134.html