Ubuntu1604环境安装部署

nginx

apt-get install nginx -y
# 查看版本
nginx -v
# 启动服务(一般自启了)
service nginx start

/usr/sbin/nginx:主程序
/etc/nginx:存放配置文件
/usr/share/nginx:存放静态文件
/var/log/nginx:存放日志


redis

apt-get install redis-server -y
# 检查是否成功
ps -aux|grep redis

# 修改相关配置
cd /etc/redis/
vi redis.conf
# 防火墙放行
iptables -I INPUT -p tcp --dport 6379 -j ACCEPT
iptables-save
# 重启让配置生效
/etc/init.d/redis-server restart

mysql5.6

add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
apt-get update
apt install mysql-server-5.6 mysql-client-5.6

# Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.(2)
# 原因是没有启动MySQL服务
/etc/init.d/mysql  start

# 设置远程登录
use mysql;
update user set Host='%' where user='root' AND Host='localhost';
flush privileges;

# 重启服务
/etc/init.d/mysql  stop
/etc/init.d/mysql  start

# 安装sysv设置开机自启
apt-get install sysv-rc-conf
# 查看启动列表MySQL是否有2345权限
sysv-rc-conf --list
# 若无则设置
sysv-rc-conf --level 2345 mysql on

openjdk-8-jdk

apt-get install openjdk-8-jdk

# 配置环境变量(可不配,直接可用)
vim /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

# 重载配置
source /etc/profile

oracle-java8-jre

前往oracle官网下载相对应jre
https://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html

cd
wget #下载地址(oracle要注册登录认证,我是下载后sftp上传)
tar -xzf server-jre-8u221-linux-x64.tar.gz -C /opt/

# 配置环境变量
vim /etc/profile

export JAVA_HOME=/opt/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

# 重载配置
source /etc/profile

tomcat8

wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.42/bin/apache-tomcat-8.5.42.tar.gz
tar -xzf apache-tomcat-8.5.42.tar.gz -C /opt/

# 开机启动
vi /etc/init.d/tomcat8542
chmod +x /etc/init.d/tomcat8542
sysv-rc-conf tomcat8542 on
# 取消开机启动
sysv-rc-conf tomcat8542 off
# tomcat8配置文件

#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
WEBROOT_PATH=/opt
WEBSERVER_PATH=$WEBROOT_PATH/apache-tomcat-8.5.42
STARTUP_SHELL=$WEBSERVER_PATH/bin/startup.sh
SHUTDOWN_SHELL=$WEBSERVER_PATH/bin/shutdown.sh

case "$1" in
start)
sh $STARTUP_SHELL
;;
stop) 
sh $SHUTDOWN_SHELL
;;
restart)
sh $SHUTDOWN_SHELL
sh $STARTUP_SHELL
;;
esac

rabbitmq

apt install rabbitmq-server
点赞
  1. 11说道:
    Google Chrome Windows 10

    弟弟

发表评论

电子邮件地址不会被公开。必填项已用 * 标注