Deploy Dspace 7.4 with Add HTTPS support

167 views
Skip to first unread message

Мухаметали Кусайынов

unread,
Jan 10, 2023, 7:59:00 AM1/10/23
to DSpace Community
Hello everyone! I really need your help. I can't deploy the website. Please help me! My settings below:
Server OS:
Ubuntu server without GUI
Ip address server - 10.17.0.12
I installed browsh - is  text-based browser. Dspace was running at localhost:4000
Frontend directory location:
~/dspace-angular-dspace-7.4
Backend directory location:
/dspace
SSL crt. location:
/dspace/ssl
I have included ajp connector in tomcat9 server.xml:
  <Connector port="8080" protocol="HTTP/1.1"
               minSpareThreads="25"
               enableLookups="false"
               redirectPort="8443"
               connectionTimeout="20000"
               disableUploadTimeout="true"
               URIEncoding="UTF-8"/>

   
 <Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443"
               URIEncoding="UTF-8" />


local.cfg location:
/dspace/config$
Local.cfg configuration
dspace.dir=/dspace
dspace.name = DSpace KazNU

Config.prod.yml configuration
config.prod.yml location:
~/dspace-angular-dspace-7.4/config$ 
ui:
  ssl: false
  host: localhost
  port: 4000
  nameSpace: /

rest:
  ssl: true
  host: repository.kaznu.kz
  port: 443
  nameSpace: /server

Next, I will describe in detail how I tried to create a VirtualHost for Dspace.
I copied the default-ssl.conf and created the repository_kaznu_kz.conf  in /etc/apache2/sites-available directory.

VirtualHost apache2 located:
/etc/apache2/sites-available/repository_kaznu_kz.conf
Did I write the configuration file VirtualHosts correctly?
It seems to me that somewhere I could be mistaken. If I'm wrong, can you show me how to correctly write the VirtualHost configuration? Complete VirtualHost Configuration:
VirtualHost setting
<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
               
    ServerName repository.kaznu.kz
               
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
         
        SSLEngine on
                SSLCertificateFile      /dspace/ssl/STAR_kaznu_kz.crt
                SSLCertificateKeyFile /dspace/ssl/STAR_kaznu_kz.key

         # Proxy all HTTPS requests to "/server" from Apache to Tomcat via AJP connector
                ProxyPass /server ajp://localhost:8009/server
                ProxyPassReverse /server ajp://localhost:8009/server

        # Proxy all HTTPS requests from Apache to PM2 on localhost, port 4000
                ProxyPass / http://localhost:4000/
                ProxyPassReverse / http://localhost:4000/

         #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
       </VirtualHost>
</IfModule>


Next, I wrote the command - sudo a2ensite repository_kaznu_kz.conf
And then, I wrote the command - sudo systemctl restart apache2
Status apache2:

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2023-01-10 09:58:56 UTC; 13min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 950 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 1081 (apache2)
      Tasks: 55 (limit: 9442)
     Memory: 11.1M
     CGroup: /system.slice/apache2.service
             ├─1081 /usr/sbin/apache2 -k start
             ├─1082 /usr/sbin/apache2 -k start
             └─1083 /usr/sbin/apache2 -k start

Jan 10 09:58:54 dspace7 systemd[1]: Starting The Apache HTTP Server...
Jan 10 09:58:56 dspace7 apachectl[1010]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerNam>
Jan 10 09:58:56 dspace7 systemd[1]: Started The Apache HTTP Server.

I also opened port 443:
sudo ufw enable
sudo ufw allow ssh
sudo ufw allow 443
As a result it shows:
Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere
443                        ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
22/tcp (v6)                ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
Apache Full (v6)           ALLOW       Anywhere (v6)

After this setup, when I again type localhost:4000 again in browsh, my site stops working and throws the following error:

500
Service Unavailable
The server is temporarily unable to service your request due to maintenanse downtime or capasity problems. Please try again later.


I deployed the repository for the first time and I can't fully understand what I'm doing wrong. I've been trying to do this for two months and already despaired. Can you describe step by step how to properly deploy Dspace 7.4? Please. Sincerely, Kusainov M.

Tim Donohue

unread,
Jan 13, 2023, 2:21:14 PM1/13/23
to DSpace Community
Hello,

Whenever you receive a 500 error, that implies that the backend has thrown an exception.  You should check the backend logs for the details of that error, as it will contain clues as to what has gone wrong.  See our troubleshooting guide for how to find the exception details: https://wiki.lyrasis.org/display/DSPACE/Troubleshoot+an+error#Troubleshootanerror-DSpace7.x(orabove)

Overall, for installation, you should be following the Install Guide at https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace   However, if you find the details behind the 500 error, it's possible it will give clues as to which step is incorrect.

Once you find the error, if the details do not make sense you can send the full exception to our dspace-tech mailing list or one of the other support options listed at https://wiki.lyrasis.org/display/DSPACE/Support

Tim

Reply all
Reply to author
Forward
0 new messages