macOS 下git+ Java + Maven + MySql + Nginx 开发环境

/ 默认分类 / 没有评论 / 1496浏览

Git

JDK

# JDK 1.8
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk

IntelliJ IDEA

Maven

MAVEN_HOME=/Users/youmeek/my_software/work_software/maven3.3.9
PATH=$PATH:$MAVEN_HOME/bin
export MAVEN_HOME
export PATH

MySQL 5.7

[mysql]
default-character-set = utf8mb4


[mysqld]
symbolic-links=0
log-error=/var/log/mysql/error.log
default-storage-engine = InnoDB
collation-server = utf8mb4_unicode_520_ci
init_connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4
lower_case_table_names = 1
max_allowed_packet = 50M
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
启动MySQL服务
sudo /usr/local/MySQL/support-files/mysql.server start

停止MySQL服务
sudo /usr/local/mysql/support-files/mysql.server stop

重启MySQL服务
sudo /usr/local/mysql/support-files/mysql.server restart
sudo rm -rf /usr/local/mysql
sudo rm -rf /Library/PreferencePanes/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

nginx

#当前目录 /Users/maruifu/work/ComponentServices

#下载nginx-1.18.0 
wget http://nginx.org/download/nginx-1.18.0.tar.gz
# 解压
tar -zxvf nginx-1.18.0.tar.gz
#创建目录
mkdir nginx
#创建模块目录
mkdir nginx-src
#进入模板目录
cd nginx-src
#下载pcre并解压
wget https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
#下载openssl并解压
wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz 
#下载zlib并解压
wget http://prdownloads.sourceforge.net/libpng/zlib-1.2.11.tar.gz
#进入源码目录
cd ../nginx-1.18.0

#配置nginx
./configure  \
--with-http_gzip_static_module  \
--with-pcre=../nginx-src/pcre-8.41/  \
--with-http_ssl_module  \
--with-openssl=../nginx-src/openssl-1.1.0g  \
--with-zlib=../nginx-src/zlib-1.2.11  \
--prefix=/Users/maruifu/work/ComponentServices/nginx/nginx \

#编译并安装
make && make install

brew install wget