mac做java后端,后端mac搭建环境

Homebrew

Homebrew是mac的包管理工具,官网,在mac上打开终端,输入以下命令安装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

安装失败使用以下命令

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

iTerm2

可以直接去官网下载安装包安装即可使用

OH MY ZSH

iterm命令行中输入以下命令

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

JAVA7&JAVA8

去以下地址下载JAVA7和JAVA8的安装包,链接如下

安装完成后,执行以下命令

echo "alias setJdk7='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'" >> ~/.zshrc

echo "alias setJdk8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'" >> ~/.zshrc

echo "export JAVA_HOME=`/usr/libexec/java_home -v 1.7`" >> ~/.zshrc

source ~/.zshrc

MAVEN

brew install maven

验证

$ mvn -v

Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-14T04:10:27+08:00) Maven home: /usr/local/Cellar/maven/3.3.1/libexec

Java version: 1.7.0_79, vendor: Oracle Corporation

Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre

Default locale: en_US, platform encoding: UTF-8

OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"

配置

~/.m2目录下创建settings.xml文件

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

terminusREPO用户名REPO密码

terminus

terminushttp://repo.terminus.io/content/groups/public/

true

true

terminus

Nginx

安装

brew install nginx

验证

$ nginx -V

nginx version: nginx/1.6.3

built by clang 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)

TLS SNI support enabled

configure arguments: --prefix=/usr/local/Cellar/nginx/1.6.3 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-pat h=/usr/local/Cellar/nginx/1.6.3/bin/nginx --with-cc-opt='-I/usr/local/Cellar/pcre/8.36/include -I/usr/local/Cellar/opens sl/1.0.2a-1/include' --with-ld-opt='-L/usr/local/Cellar/pcre/8.36/lib -L/usr/local/Cellar/openssl/1.0.2a-1/lib' --conf-p ath=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock -- http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/pro xy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/u wsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log - -error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module

修改配置文件

#user nobody;

worker_processes 2;

#error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info;

#pid logs/nginx.pid;

events {

worker_connections 1024;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on; #tcp_nopush on;

#keepalive_timeout 0;

keepalive_timeout 65; gzip on;

include servers/*.conf; }

Redis

安装

brew install redis

验证

$ redis-server -v

Redis server v=2.8.3 sha=00000000:0 malloc=libc bits=64 build=e836d8ad888e21a1

Mysql

安装

brew install mysql

验证

$ mysql -V

mysql Ver 14.14 Distrib 5.6.15, for osx10.9 (x86_64) using EditLine wrapper

Elasticsearch

安装

下载后解压,将解压后的文件夹放到想安装的目录

验证

打开Iterm2执行以下命令

# 跳转到解压目录(如 /home/xxx/download) $ cd [ES_HOME]

$ bin/elasticsearch

看到以下类似输出

[2016-02-20 15:14:44,271][INFO ][node 1/2016-01-27T13:32:39Z]

[2016-02-20 15:14:44,272][INFO ][node [2016-02-20 15:14:44,783][INFO ][plugins

ugins [elasticsearch-analysis-jieba], sites [] [2016-02-20 15:14:44,808][INFO ][env

] [Bennet du Paris] version[2.2.0], pid[71066], build[8ff36d ] [Bennet du Paris] initializing ...

] [Bennet du Paris] modules [lang-expression, lang-groovy], pl

] [Bennet du Paris] using [1] data paths, mounts [[/ (/dev/dis k0s2)]], net usable_space [68.6gb], net total_space [232.9gb], spins? [unknown], types [hfs]

[2016-02-20 15:14:44,808][INFO ][env ] [Bennet du Paris] heap size [989.8mb], compressed ordinary o bject pointers [true]

main dict load finished, time elapsed 885 ms

initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba

loading dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/sougou.dict

user dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/sougou.dict load finished, tot words:23203 0, time elapsed:740ms

loading dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/user.dict

user dict /usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba/user.dict load finished, tot words:3, time elapsed:1ms

initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba

initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba

initialize user dictionary:/usr/local/elasticsearch-2.2.0/plugins/elasticsearch-analysis-jieba

[2016-02-20 15:14:48,213][INFO ][node

[2016-02-20 15:14:48,213][INFO ][node

[2016-02-20 15:14:48,320][INFO ][transport

dresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300} [2016-02-20 15:14:48,326][INFO ][discovery

] [Bennet du Paris] initialized

] [Bennet du Paris] starting ...

] [Bennet du Paris] publish_address {127.0.0.1:9300}, bound_ad

] [Bennet du Paris] elasticsearch/0v749OKeRuKGsYVCrH201w

[2016-02-20 15:14:51,357][INFO ][cluster.service

YVCrH201w}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received)

[2016-02-20 15:14:51,371][INFO ][http

dresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200} [2016-02-20 15:14:51,371][INFO ][node

[2016-02-20 15:14:51,404][INFO ][gateway

] [Bennet du Paris] new_master {Bennet du Paris}{0v749OKeRuKGs ] [Bennet du Paris] publish_address {127.0.0.1:9200}, bound_ad

] [Bennet du Paris] started

] [Bennet du P

安装应用

Sequel Pro

Sequel Pro 是一款mysql的图形管理工具,可在官网下载安装

标签:15,后端,--,nginx,mac,elasticsearch,usr,local,搭建

来源: https://blog.csdn.net/xiefusi/article/details/100559316

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值