linux下的java环境配置
1:安装wget
yum install wget
wget是Linux下的一个下载工具
2:安装jdk
新建软件下载目录:
mkdir /home/soft
cd /home/soft
下载:访问 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 进行下载
安装:rpm -ivh jdk-8u144-linux-x64.rpm
环境变量配置
vim /etc/profile
在文件的最后变插入
export JAVA_HOME=/usr/java/devault
export CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=${PATH}:${JAVA_HOME}/bin
执行 source /etc/profile 让配置文件生效
3:安装svn
yum install subversion
创建源码目录
mkdir /home/soft/source
cd /home/soft/source
下载源码
svn checkout https://60.219.169.11/svn/newfreemarker
4:安装maven
cd /home/soft
下载maven
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz
解压:
tar -zxvf apache-maven-3.5.0-bin.tar.gz
修改解压后的名称
mv apache-maven-3.5.0 maven35
添加环境变量
vim /etc/profile
在文件的最后变插入
MAVEN_HOME=/home/soft/maven35
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
执行 source /etc/profile 让配置文件生效
mvn --version 可以查看maven的版本号
修改maven的仓库地址
创建本机maven仓库目录
mkdir /home/mvn_repo
进入maven目录
cd /home/soft/maven35
执行
vim conf/setting
找见localRepository,在注释外插入
<localRepository>/home/mvn_repo</localRepository>
找见mirrors标签,插入
<mirror>
<id>mirrorId</id>
<mirrorOf>*</mirrorOf>
<name>My Repository</name>
<url>http://60.219.169.11:9000/repository/maven-public/</url>
</mirror>
5: 安装数据库
# 下载mysql源安装包
shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# 安装mysql源
shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm
安装mysql
yum install mysql-community-server
启动mysql
systemctl start mysqld
开机启动
systemctl enable mysqld
systemctl daemon-reload
查看默认密码:
grep 'temporary password' /var/log/mysqld.log
修改密码:
以无密码方式启动
编辑/etc/my.cnf文件,增加skip-grant-tables=1
mysql -u root
use mysql;
update user set authentication_string=PASSWORD('haichang123');
flush privileges;
alter user 'root'@'localhost' identified by 'HaiChang123!@#';
flush privileges;
创建数据库
create database haichang default charset utf8;
导入数据库文件
安装redis
下载 wget http://download.redis.io/releases/redis-4.0.1.tar.gz
mv redis-4.0.1 redis
cd redis
make
修改以服务方式运行
vim /home/soft/redis/redis.conf
查找 deamonize ,将no改为yes
修改密码
vim /home/soft/redis/redis.conf
查找 requirepass
增加 requirepass haichang
6: 安装node
cd /home/soft
下载:wget https://nodejs.org/download/rc/v8.2.0-rc.1/node-v8.2.0-rc.1-linux-x64.tar.gz
tar -zxvf node-v8.2.0-rc.1-linux-x64.tar.gz
mv node-v8.2.0-rc.1-linux-x64 node
编辑环境变量
vim /etc/profile
在最后一行增加:
export PATH=${PATH}:/home/soft/node/bin
export NODE_PATH=/home/soft/node/lib/node_module
source /etc/profile
设置npm 仓库
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装vue
npm install -g vue-cli
n latest 升级node
7: 安装tomcat
普通解压包安装
8:安装nginx
cd /home/soft
yum install openssl
yum install openssl-devel
yum install zlib-devel
yum install zlib
yum install pcre-devel
yum install pcre
下载nginx
wget http://nginx.org/download/nginx-1.13.3.tar.gz
解压
tar -zxvf nginx-1.13.3.tar.gz
重命名
mv nginx-1.33.3 nginx
安装 c
yum install -y gcc gcc-c++
编译nginx
cd /home/soft/nginx
./configure
安装
make
make install
默认安装目录 /usr/local/nginx
关闭默认防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
nginx负载均衡 http://blog.csdn.net/kingzma/article/details/46331999