Bonjour, si vous voulez installer Nexus 3 voici comment faire :
Installer OpenJDK :
CentOS / Fedora / RHEL
yum install -y java-1.8.0-openjdk nginx
Debian / Ubuntu
apt-get install -y openjdk-8-jdk nginx
Télécharger Nexus :
mkdir -p /opt/nexus /root/.ssl
wget -O /opt/nexus/nexus.tar.gz https://download.sonatype.com/nexus/3/latest-unix.tar.gz
cd /opt/nexus && tar -xvf nexus.tar.gz
mv /opt/nexus/nexus-* mv /opt/nexus/nexus
rm -f /opt/nexus/nexus.tar.gz
Créer un utilisateur dédié :
groupadd -r nexus
useradd -r -g nexus -d /opt/nexus -s /sbin/nologin nexus
chown -R nexus: /opt/nexus
Configurer nexus :
echo 'run_as_user="nexus"' > /opt/nexus/nexus/bin/nexus.rc
nano /opt/nexus/nexus/bin/nexus.vmoptions
Créer le service :
nano /etc/systemd/system/nexus.service
[Unit]
Description=Nexus 3
After=network.target
[Service]
Type=forking
User=nexus
Group=nexus
LimitNOFILE=65536
#Environment="JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk"
#Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true"
ExecStart=/opt/nexus/nexus/bin/nexus start
ExecStop=/opt/nexus/nexus/bin/nexus stop
[Install]
WantedBy=multi-user.target
Démarrer Nexus :
systemctl enable --now nexus
Aller sur le site :
http://ip_server:8081
Nginx avec Nexus :
nano /etc/nginx/conf.d/nexus.conf
server {
listen 443 ssl http2;
server_name nexus.my_domain.com;
access_log /var/log/nginx/nexus-access.log;
error_log /var/log/nginx/nexus-error.log error;
## The default `client_max_body_size` is 1M, this might not be enough for some posters, etc.
client_max_body_size 200M;
# SSL Configuration
ssl_certificate /root/.ssl/nexus.my_domain.com.crt;
ssl_certificate_key /root/.ssl/nexus.my_domain.com.key;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
ssl_prefer_server_ciphers on;
# See https://hstspreload.org/ before uncommenting the line below.
# add_header Strict-Transport-Security "max-age=15768000; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header Content-Security-Policy "frame-ancestors 'self'";
add_header X-Frame-Options DENY;
add_header Referrer-Policy same-origin;
location / {
proxy_pass http://localhost:8081/;
proxy_set_header Host $host;
proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
}
systemctl enable --now nginx
Login :
User : admin
Password : cat /opt/nexus/sonatype-work/nexus3/admin.password
Voilà vous pouvez maintenant accéder à votre Nexus.