|
| 1 | +## New certificate on biprdsp7wbdb.cc.ku.edu server |
| 2 | + |
| 3 | +Form to request new certificate: https://kuit.service-now.com/nav_to.do?uri=%2Fcom.glideapp.servicecatalog_cat_item_view.do%3Fv%3D1%26sysparm_id%3D78fee42fdb2a8850162673e1ba96195b%26sysparm_link_parent%3D322911f41bec6490cf2d337e034bcb23%26sysparm_catalog%3De0d08b13c3330100c8b837659bba8fb4%26sysparm_catalog_view%3Dcatalog_default%26sysparm_view%3Dcatalog_default |
| 4 | + |
| 5 | +generate CSR string: |
| 6 | +```bash |
| 7 | +openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr |
| 8 | +``` |
| 9 | + |
| 10 | +with configuration: |
| 11 | +``` |
| 12 | +Country Name (2 letter code) [XX]:US |
| 13 | +State or Province Name (full name) []:Kansas |
| 14 | +Locality Name (eg, city) [Default City]:Lawrence |
| 15 | +Organization Name (eg, company) [Default Company Ltd]:University of Kansas |
| 16 | +Organizational Unit Name (eg, section) []:Specify |
| 17 | +Common Name (eg, your name or your server's hostname) []:biimages.biodiversity.ku.edu |
| 18 | +Email Address []:[email protected] |
| 19 | +A challenge password []: |
| 20 | +An optional company name []: |
| 21 | +``` |
| 22 | + |
| 23 | +verify configuration with `openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr` with output |
| 24 | +``` |
| 25 | +C = US, ST = Kansas, L = Lawrence, O = University of Kansas, OU = Specify, CN = biimages.biodiversity.ku.edu, emailAddress = [email protected] |
| 26 | +``` |
| 27 | + |
| 28 | +after receiving new certificate files |
| 29 | +``` |
| 30 | +biimages_biodiversity_ku_edu.cer |
| 31 | +biimages_biodiversity_ku_edu_cert.cer |
| 32 | +biimages.biodiversity.ku.edu.conf |
| 33 | +biimages_biodiversity_ku_edu.crt |
| 34 | +biimages_biodiversity_ku_edu_interm.cer |
| 35 | +biimages_biodiversity_ku_edu.p7b |
| 36 | +biimages_biodiversity_ku_edu.pem |
| 37 | +``` |
| 38 | + |
| 39 | +generate 'fullchain.pem' file with concatenation |
| 40 | +```bash |
| 41 | +cat biimages_biodiversity_ku_edu.pem biimages_biodiversity_ku_edu_interm.cer > fullchain.pem |
| 42 | +``` |
| 43 | + |
| 44 | +then run commands to copy files into proper locations (make sure the number is incremented ex. 40) |
| 45 | +```bash |
| 46 | +sudo cp server.key /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/privkey40.pem |
| 47 | +sudo cp biimages_biodiversity_ku_edu.pem /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/cert40.pem; |
| 48 | +sudo cp biimages_biodiversity_ku_edu_interm.cer /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/chain40.pem; |
| 49 | +sudo cp fullchain.pem /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/fullchain40.pem; |
| 50 | +``` |
| 51 | + |
| 52 | +then create symbolic links to where the nginx file looks for SSL files |
| 53 | +```bash |
| 54 | +sudo ln -sf /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/fullchain40.pem /etc/letsencrypt/live/biimages.biodiversity.ku.edu/fullchain.pem; |
| 55 | +sudo ln -sf /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/privkey40.pem /etc/letsencrypt/live/biimages.biodiversity.ku.edu/privkey.pem; |
| 56 | +sudo ln -sf /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/chain40.pem /etc/letsencrypt/live/biimages.biodiversity.ku.edu/chain.pem; |
| 57 | +sudo ln -sf /etc/letsencrypt/archive/biimages.biodiversity.ku.edu/cert40.pem /etc/letsencrypt/live/biimages.biodiversity.ku.edu/cert.pem; |
| 58 | +``` |
| 59 | + |
| 60 | +here are the line in the '/etc/nginx/conf.d/web-asset-server.conf' nginx file `sudo vim /etc/nginx/conf.d/web-asset-server.conf` |
| 61 | +``` |
| 62 | +server_name biimages.biodiversity.ku.edu; |
| 63 | +ssl_certificate /etc/letsencrypt/live/biimages.biodiversity.ku.edu/fullchain.pem; |
| 64 | +ssl_certificate_key /etc/letsencrypt/live/biimages.biodiversity.ku.edu/privkey.pem; |
| 65 | +``` |
| 66 | + |
| 67 | +verify the key and cert are correct by making sure their hashes are the same |
| 68 | +```bash |
| 69 | +sudo openssl x509 -noout -modulus -in /etc/letsencrypt/live/biimages.biodiversity.ku.edu/cert.pem | openssl md5 |
| 70 | +sudo openssl rsa -noout -modulus -in /etc/letsencrypt/live/biimages.biodiversity.ku.edu/privkey.pem | openssl md5 |
| 71 | +``` |
| 72 | + |
| 73 | +verify the expiration date of the cert: |
| 74 | +``` |
| 75 | +sudo openssl x509 -in fullchain.pem -noout -dates; |
| 76 | +``` |
| 77 | + |
| 78 | +restart nginx |
| 79 | +```bash |
| 80 | +sudo systemctl restart nginx.service |
| 81 | +#sudo systemctl restart web-asset-server.service |
| 82 | +sudo systemctl status web-asset-server.service |
| 83 | +``` |
| 84 | + |
| 85 | +## web-portal certificate |
| 86 | + |
| 87 | +here are the lines in the `/etc/nginx/conf.d/webportal-nginx.conf` nginx file |
| 88 | +``` |
| 89 | +server_name collections.biodiversity.ku.edu; |
| 90 | +ssl_certificate /home/specify/keystore/collections_biodiversity_ku_edu_cert.cer; |
| 91 | +ssl_certificate_key /home/specify/keystore/collections_biodiversity_ku_edu.key; |
| 92 | +``` |
| 93 | + |
| 94 | +```bash |
| 95 | +cat collections_biodiversity_ku_edu.pem collections_biodiversity_ku_edu_interm.cer > fullchain.pem |
| 96 | +``` |
| 97 | + |
| 98 | +```bash |
| 99 | +sudo cp collections_biodiversity_ku_edu_cert.cer /home/specify/keystore/cert.pem |
| 100 | +sudo cp ~/webportal-keys/webportal_server.key /home/specify/keystore/privkey.pem |
| 101 | +sudo cp ~/webportal-keys/fullchain.pem /home/specify/keystore/fullchain.pem |
| 102 | +``` |
| 103 | + |
| 104 | +```bash |
| 105 | +sudo chown specify:bi-sp7access cert.pem; |
| 106 | +sudo chown specify:bi-sp7access privkey.pem; |
| 107 | +sudo chown specify:bi-sp7access fullchain.pem; |
| 108 | +``` |
| 109 | + |
| 110 | +```bash |
| 111 | +sudo systemctl restart nginx.service |
| 112 | +#sudo systemctl restart webportal-solr.service |
| 113 | +sudo systemctl status webportal-solr.service |
| 114 | +``` |
| 115 | + |
| 116 | +## specify.ku.edu ssl cert update |
| 117 | + |
| 118 | +uses apache server |
| 119 | +```bash |
| 120 | +sudo systemctl status httpd.service |
| 121 | +sudo ls -la /etc/httpd/conf.d |
| 122 | +sudo vim /etc/httpd/conf.d/ipt+specify. # server config file |
| 123 | + |
| 124 | +sudo openssl req -new -newkey rsa:2048 -nodes -keyout specify.ku.edu.key -out specify.ku.edu.csr |
| 125 | + |
| 126 | +# Verify the private key |
| 127 | +sudo openssl rsa -in /home/anhalt/ssl/2024/specify_ku_edu.key -check |
| 128 | +# Verify the SSL certificate |
| 129 | +sudo openssl x509 -in /home/anhalt/ssl/2024/certs/specify_ku_edu_cert.cer -text -noout |
| 130 | +# Verify the certificate matches the private key |
| 131 | +sudo openssl x509 -noout -modulus -in /home/anhalt/ssl/2024/certs/specify_ku_edu.cer | openssl md5 |
| 132 | +sudo openssl rsa -noout -modulus -in /home/anhalt/ssl/2024/specify_ku_edu.key | openssl md5 |
| 133 | +# Check the certificate chain |
| 134 | +sudo openssl verify -CAfile /home/anhalt/ssl/2024/certs/specify_ku_edu_interm.cer /home/anhalt/ssl/2024/certs/specify_ku_edu_cert.cer |
| 135 | + |
| 136 | +# Test apache config |
| 137 | +sudo httpd -t |
| 138 | +sudo systemctl restart httpd |
| 139 | +sudo systemctl status httpd |
| 140 | +sudo tail -f /var/log/httpd/error_log |
| 141 | +``` |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | +nevermind, just need to do this, copy the `specify.ku.edu.key` file from the previous year, it remains the same, just need the new `specify_ku_edu_cert.cer` and `specify_ku_edu_interm.cer` files |
| 146 | + |
| 147 | + |
| 148 | + |
0 commit comments