Bu dökümantasyon üzerinde Nexus web arayüzü için self signed SSL kurulumu yapacağız. Self signed SSL kurulum amacımız burada test ve HTTPS üzerinden yayın yapabilmemiz içindir.
Şimdi bu SSL sertifikasını nasıl kurabileceğinizi göstereceğiz.
sudo service nexus stop
Şimdi nexus'u kurduğunuz dizine gidin:
cd /opt/nexus
Burada şimdi sertifika dosyası oluşturacağız ancak burada düzenlemeniz gereken yerler bulunmaktadır. Örneğin nexus.secops.com.tr kısmını kendi domainizle, Password1 yazan yere ise sertifikanızın hangi şifreyle korunmasını istiyorsanız yazmalısınız.
sudo keytool -genkey -alias nexus.secops.com.tr -keyalg RSA -dname 'CN=nexus.secops.com.tr, OU=UK, O=UK, C=UK, ST=LONDON, L=WESTMINSTER' -storepass Password1 -validity 365 -keystore keystore.jks -keypass Password1 -deststoretype pkcs12
Aşağıdaki komut otomatik olarak nexus.properties dosyasına application-host=0.0.0.0 tanımını ekleyecektir.
sudo sed -i 's|# application-host=0.0.0.0|application-host=0.0.0.0|g' /opt/nexus/sonatype-work/nexus3/etc/nexus.properties
Aşağıdaki komut otomatik olarak nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-requestlog.xml
ifadesini ekleyecektir.
sudo sed -i 's|# nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml|nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-requestlog.xml|g' /opt/nexus/sonatype-work/nexus3/etc/nexus.properties
Aşağıdaki komut otomatik olarak application-port=8081 tanımını ekleyecektir.
sudo sed -i 's|# application-port=8081|application-port=8081|g' /opt/nexus/sonatype-work/nexus3/etc/nexus.properties
Aşağıdaki komut application-port-ssl=8441 tanımını ekleyecektir.
sed -i '$a application-port-ssl=8441' /opt/nexus/sonatype-work/nexus3/etc/nexus.properties
Şimdi ise jetty-https.xml adlı dosya içerisinde yapmamız gereken bir kaç configürasyon bulunuyor. Burada aşağıdaki komutlar otomatik olarak sizin için tanımları ekleyecektir.
sudo sed -i 's|<Set name="KeyStorePath"><Property name="ssl.etc"/>/keystore.jks</Set>|<Set name="KeyStorePath">/opt/nexus/keystore.jks</Set>|g' /opt/nexus/etc/jetty/jetty-https.xml
sudo sed -i 's|<Set name="TrustStorePath"><Property name="ssl.etc"/>/keystore.jks</Set>|<Set name="TrustStorePath">/opt/nexus/keystore.jks</Set>|g' /opt/nexus/etc/jetty/jetty-https.xml
Burada ise Password1 değerini kendinize göre ayarlamayı unutmayın.
sudo sed -i 's|password|Password1|g' /opt/nexus/etc/jetty/jetty-https.xml
Şimdi ise nexus'a restart atıp 8441 portundan nexus'a gitmeye çalışın. Domain üzerinden gitmek için kendi bilgisayarınızda hosts dosyanızı düzenleyin.
sudo service nexus start