Nexus installation instance and nexus instance
Nexus Installation
1. Download Nexus: nexus-2.11.2-03-bundle.tar.gz]
2. Install nexus
[root@localhost local]# pwd/usr/local[root@localhost local]# mkdir nexus-2.11.2-03[root@localhost local]# tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C nexus-2.11.2-03[root@localhost local]# cd nexus-2.11.2-03[root@localhost nexus-2.11.2-03]# lsnexus-2.11.2-03 sonatype-work[root@localhost nexus-2.11.2-03]# mv nexus-2.11.2-03 nexus-server[root@localhost nexus-2.11.2-03]# lsnexus-server sonatype-work
Note: nexus-server: private server, sonatype-work: private library directory
3. Configure the port and private library directory
[root@localhost nexus-2.11.2-03]# pwd/usr/local/nexus-2.11.2-03[root@localhost nexus-2.11.2-03]# cd nexus-server/conf/[root@localhost conf]# vim nexus.properties# Jetty sectionapplication-port=8081application-host=0.0.0.0nexus-webapp=${bundleBasedir}/nexusnexus-webapp-context-path=/nexus# Nexus sectionnexus-work=${bundleBasedir}/../sonatype-work/nexusruntime=${bundleBasedir}/nexus/WEB-INF
4. Edit the nexus configuration User Role
[root@localhost bin]# pwd/usr/local/nexus-2.11.2-03/nexus-server/bin[root@localhost bin]# cat nexus | grep AS_USE -n23:#RUN_AS_USER=[root@localhost bin]# vim nexusRUN_AS_USER=root
Description: configure the user role as root.
5. configure the firewall to open the nexus access port: [the default 8081 is used by the author]
[root@localhost bin]# vim /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT[root@localhost bin]# service iptables restartiptables: Setting chains to policy ACCEPT: filter [ OK ]iptables: Flushing firewall rules: [ OK ]iptables: Unloading modules: [ OK ]iptables: Applying firewall rules: [ OK ]
6. Start nexus
[root@localhost bin]# pwd/usr/local/nexus-2.11.2-03/nexus-server/bin[root@localhost bin]# ./nexus start****************************************WARNING - NOT RECOMMENDED TO RUN AS ROOT****************************************Starting Nexus OSS...Started Nexus OSS.
Visit: http: // 192.168.147.129: 8081/nexus
7. Added nginx response proxy
Create a log file
[root@localhost nexus]# pwd/usr/local/nexus-2.11.2-03/nexus-server/nexus[root@localhost nexus]# mkdir logs[root@localhost nexus]# lsfavicon.ico favicon.png images LICENSE.html logs robots.txt WEB-INF[root@localhost nexus]# cd logs/[root@localhost logs]# pwd/usr/local/nexus-2.11.2-03/nexus-server/nexus/logs
Upstream Configuration
[root@localhost logs]# vim /usr/local/nginx/conf/domains/tools.nexus.local.comupstream tomcat_tools.nexus.local { server 127.0.0.1:8081 weight=10 max_fails=2 fail_timeout=300s;}server { listen 80; server_name tools.nexus.local.com; root /usr/local/nexus-2.11.2-03/nexus-server/nexus/; access_log /usr/local/nexus-2.11.2-03/nexus-server/nexus/logs/tools.nexus.local.com_access.log main; error_log /usr/local/nexus-2.11.2-03/nexus-server/nexus/logs/tools.nexus.local.com_error.log warn; error_page 403 404 /40x.html; location / { index index.html index.htm; proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://tomcat_tools.nexus.local; expires 0d; }}
8. Restart nginx and start nexus.
Access .tools.nexus.local.com/nexus
Configure Nexus
1. password retrieval mailbox Configuration:
A) configure the email service address in the Administration/Server menu (if you forget the password, you can retrieve it through this mailbox)
Configuration:
You can click "Test SMTP settings" to check whether the configuration is successful. If the configuration is successful, you will receive a message indicating that the configuration is successful!
B) menu Security/Users:
2. modify the current password:
The current account name is displayed at [bottom right]/Profile.
3. Warehouse type
Generally, the types of warehouses used are hosted, proxy, and Hosted, which represent the host warehouse. They are used to publish components not allowed by third parties, such as oracle drivers and commercial software jar packages. Proxy represents a remote Agent repository. The most typical is the official Maven central repository and JBoss repository. If the local repository of the built Maven project does not have a dependency package, it will be downloaded from the agent site. If the agent site does not have this dependency package, go back to the remote central repository to download the dependency, these central warehouses are proxies. The proxy site is successfully downloaded and then downloaded to the local machine. I believe that Maven's default repository is usually enough for most projects. In special cases, you can configure a new repository and specify a url. Generally, ExtJS users are familiar with Nexus operations, and the words are not very difficult. The words are almost the same if you don't understand them. That is, it would be better if Sonatype had gone international.
Hosted Warehouse and internal project release warehouse
Release repository of the release module in the internal modules of releases
Snapshots releases the internal SNAPSHOT module Repository
3rd party third-party dependent warehouse, which is usually released after being downloaded by internal staff.
A proxy-type warehouse that looks for data from a remote central warehouse
A group-type warehouse. A group warehouse is a warehouse that allows our developers to conveniently set up.
4. maven project Index
Download the Maven project index, which is used to search for dependencies on private servers.
[More view] http://blog.csdn.net/zwc0910/article/details/17349111
For more information, see [http://www.cnblogs.com/dennisit/p/4546307.html].