美文网首页
java开发服务器环境搭建

java开发服务器环境搭建

作者: ouyangan | 来源:发表于2017-02-27 16:09 被阅读85次

    更新环境依赖

    • sudo apt-get update
    • sudo apt-get upgrade

    更换apt-get

    • vim /etc/apt/sources.list将下面内容粘贴在文件前面
    deb http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse
    

    安装ssh

    • sudo apt-get install openssh-client
    • sudo apt-get install openssh-server
    • 通过man sshd_config查看配置手册
    • 备份配置文件ssh:sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
    • 配置ssh: port ,PermitRootLogin yes
    • 重启ssh服务 :serivece sshd restart

    安装jdk

    • 解压安装文件 tar zxvf jdkfile.tar
    • tar xzf jdkfile
    • vim /etc/profile
    • 末尾添加
    export  JAVA_HOME=/your jdk path
    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

    安装maven

    • 解压安装文件 tar zxvf maven.tar
    • /etc/profile增加
    export MAVEN_HOME=/your maven path
    export PATH=/your maven path/bin:$PATH 
    

    安装redis

    • 下载wget http://download.redis.io/releases/redis-3.2.5.tar.gz
    • 解压安装文件 tar zxvf redis.tar
    • 执行make
    • cd redis/src
    • 运行redis-server
    • 进入命令行redis-cli

    安装Jenkins

    • Jenkins包放到tomcat的webapps下
    • 启动tomcat
    • 首次登陆需要复制/root/.jenkins/secrets下的initialAdminPassword文件中密码

    安装mysql

    • sudo apt-get install myql-server
    • 授权远程访问
    GRANT ALL PRIVILEGES ON *.* TO 'your username'@'your ip address' IDENTIFIED BY 'your pass word' with grant option;
    FLUSH PRIVILEGES;
    
    • 编辑文件/etc/mysql/mysql.conf.d下的mysqld.cnf
    bind-address=127.0.0.1 改成 #bind-address=127.0.0.1
    
    • 运行状态:service mysql status
    • 启动:service mysql start或者cd /etc/init.d->./mysql start
    • 重启:service mysql restart或者cd /etc/init.d->./mysql restart
    • 停止:service mysql stop或者cd /etc/init.d->./mysql stop

    相关文章

      网友评论

          本文标题:java开发服务器环境搭建

          本文链接:https://www.haomeiwen.com/subject/mdizwttx.html