Linux服务安装集合(1)

1、JDK安装

tar -zxvf jdk-8u181-linux-x64.tar.gz
mv jdk1.8.0_181/ jdk1.8
vim /etc/profile

##在profile文件下方添加
JAVA_HOME=/apps/jdk1.8
JRE_HOMW=$JAVA_HOME/jre
PATH=$JAVA_HOME/bin:$PATH
export PATH

##激活配置
source /etc/profile

2、Git安装

# 1.下载Git
wget https://github.com/git/git/archive/v2.23.1.tar.gz 
# 2.安装依赖环境
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
# 3.解压缩
$ tar -zxvf v2.23.1.tar.gz
$ cd git-2.23.1
# 4.编译 安装
make prefix=/apps/git all 
make prefix=/apps/git install
# 5.添加环境变量
vim /etc/profile 
export PATH=/apps/git/bin:$PATH 
source /etc/profile 
成功则显示版本号
git --version
git version 2.23.1 

 3、nginx安装

# 1.下载nginx
wget http://nginx.org/download/nginx-1.14.2.tar.gz
# 2.安装依赖环境
yum -y install gcc gcc-c++ zlib zlib-devel pcre-devel openssl openssl-devel 
# 3.解压缩
$ tar -zxvf nginx-1.14.2.tar.gz
$ cd nginx-1.14.2
# 4.指定安装位置、编译、安装
.configure --prefix=/apps/nginx --with-http_ssl_module --withhttp_stub_status_module
make
make install
# 5.启动
cd /apps/nginx/sbin/
./nginx
# 6.开放nginx默认端口号80
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
# 7.远程访问

4、nexus安装

# 1.解压上传的nexus包
unzip nexus-2.12.0-01-bundle.zip
# 2.改名(自己习惯去掉版本号,些许强迫^-^)
mv nexus-2.12.0-01 ./nexus
# 3.在profile文件添加用户,其实不推荐root用户
vim /etc/profile
export RUN_AS_USER=root
source /etc/profile
# 4.启动nexus,默认端口8081
nexus/bin/nexus start|stop|status|restart

5、redis单点安装

# 1.安装依赖
yum install -y gcc gcc-c++ make openssl openssl-devel
# 2.解压redis安装包
tar -zxvf redis-4.0.9.tar.gz
cd /apps/redis-4.0.9
# 3.编译并指定安装位置进行安装
make && make PREFIX=/apps/redis install
# 4.创建redis配置文件目录,并拷贝
mkdir -p /apps/redis/conf/
cp /apps/redis-4.0.9/redis.conf /apps/redis/conf/
# 5.修改配置文件内容
#去除绑定本机ip。redis默认绑定本机ip127.0.0.1,修改成0.0.0.0,也就所有ip都可访问
sed -i '69s/127.0.0.1/0.0.0.0/' /apps/redis/conf/redis.conf  
#关闭保护模式。 redis默认开启保护模式,也就是不能进行远程访问,保护模式下也不需要密码
sed -i '88s/protected-mode yes/protected-mode no/' /apps/redis/conf/redis.conf  
# 6.启动redis(默认前台启动,如后台启动可在redis.conf修改daemonize no 为 daemonize yes)
/apps/redis/bin/redis-server /apps/redis/conf/redis.conf

 

 

 

 

 

 

本文作者:hjjay
原文出处:https://www.cnblogs.com/jayhou/p/12262315.html
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接。

posted @ 2020-02-05 22:09  hjjay  阅读(249)  评论(0编辑  收藏  举报