目标:
没有老司机带路也能快速配置后端开发环境
软件:
JDK
IntelliJ IDEA
Maven
Tomcat
Nginx
步骤:
1.安装IDEA/JDK/Maven/Tomcat
2.导入项目/一路next
File -> New -> Project from Existing Sources…
导入完成,完成了1/3
3.配置Tomact
Run -> Edit Configurations…
Tomcat Server -> Local
4.配置Maven
window设置maven路径参考:
http://jingyan.baidu.com/article/1709ad808ad49f4634c4f00d.html
Mac:
vi ~/.bash_profile
export M2_HOME=/Users/robbie/apache-maven-3.3.3//本地maven所在目录
export PATH=$PATH:$M2_HOME/bin
IntelliJ IDEA配置Maven路径:
输入命令以使bash_profile生效
source ~/.bash_profile
参考:http://www.jianshu.com/p/191685a33786
5.安装配置Nginx
vim /usr/local/etc/nginx/nginx.conf
添加server:
server {
listen 80;
server_name locahost *.iwjw.com;
location ~* /iwjw-(\w*)/(.*)_\d.*.(css|js){
add_header Access-Control-Allow-Origin *;
//本地静态地址
alias /Users/zhuxinyong/iwjw/iwjw-static/iwjw-$1/dist/$2.$3;
}
location ~* /iwjw-(\w*)/(.*){
add_header Access-Control-Allow-Origin *;
//本地静态地址
alias /Users/zhuxinyong/iwjw/iwjw-static/iwjw-$1/dist/$2;
}
}
启动Nginx
sudo nginx