下载nexus oss免费版本基于jetty的压缩包并解压

tar-zxvfnexus-3.0.1-01-unix.tar.gz

进入nexus目录,更改端口号

cdnexus-3.0.1-01vim/etc/org.sonatype.nexus.cfg#Jettysectionapplication-port=8081application-host=0.0.0.0nexus-args=${karaf.etc}/jetty.xml,${karaf.etc}/jetty-http.xml,${karaf.etc}/jetty-requestlog.xmlnexus-context-path=/#Nexussectionnexus-edition=nexus-oss-editionnexus-features=\nexus-oss-feature

更改端口后,修改Centos防火墙配置,开通对应端口

vim/etc/sysconfig/iptables#Generatedbyiptables-savev1.4.7onSunFeb1916:43:592017*filter:INPUTDROP[0:0]:FORWARDACCEPT[0:0]:OUTPUTACCEPT[0:0]:syn-flood-[0:0]-AINPUT-ilo-jACCEPT-AINPUT-mstate--stateRELATED,ESTABLISHED-jACCEPT-AINPUT-ptcp-mstate--stateNEW-mtcp--dport22-jACCEPT-AINPUT-ptcp-mstate--stateNEW-mtcp--dport80-jACCEPT-AINPUT-ptcp-mstate--stateNEW-mtcp--dport21-jACCEPT-AINPUT-ptcp-mstate--stateNEW-mtcp--dport2000:3000-jACCEPT-AINPUT-ptcp-mstate--stateNEW-mtcp--dport443-jACCEPT-AINPUT-ptcp-mstate--stateNEW-mtcp--dport8081-jACCEPT-AINPUT-ficmp-mlimit--limit1/sec--limit-burst10-jACCEPT-AINPUT-ptcp-mtcp--tcp-flagsFIN,SYN,RST,ACKSYN-jsyn-flood-AINPUT-jREJECT--reject-withicmp-host-prohibited-Asyn-flood-ptcp-mlimit--limit3/sec--limit-burst6-jRETURN-Asyn-flood-jREJECT--reject-withicmp-port-unreachableCOMMIT#CompletedonSunFeb1916:43:592017

重启iptables服务

serviceiptablesrestart

启动nexus服务

nexusstart