Tuesday, October 22, 2019

Setting Cron Job for Auto RunningTomcat for DSpace

Open following file in a Terminal (Ctrl+Alt+t)

$ sudo gedit  /etc/init.d/tomcat                               (on Cloud server  $ sudo nano /etc/init.d/tomcat)

Add following lines in the file,

#!/bin/bash
### BEGIN INIT INFO
# Provides:        tomcat9
# Required-Start:  $network
# Required-Stop:   $network
# Default-Start:   2 3 4 5
# Default-Stop:    0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

start() {
 sh /opt/tomcat/bin/startup.sh
}

stop() {
 sh /opt/tomcat/bin/shutdown.sh
}

case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac

save and close the file.

Apply the following commands too;

sudo chmod +x /etc/init.d/tomcat
sudo update-rc.d tomcat defaults

Start Tomcat server,

sudo service tomcat start

Now you can start and stop Tomcat server using the following commands;

sudo service tomcat start
sudo service tomcat stop
sudo service tomcat restart

Thursday, October 17, 2019

Creating New Users in DSpace

If you have not configured email with DSpace, then you can create User in DSpace using bellow command line:

Open terminal in Ubuntu.

issue the below commands:

/home/dspace/bin/dspace user --add --email youremilID -g FirstName -s LastName --password yourpassword


Create Superuser in Mysql

Login MySQL using mysql -u root -p CREATE USER 'superuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGE...