Відмінності між версіями «Налаштування DSpace»

(Ескізи при перегляді матеріалів)
м (Переключення Tomcat і DSpace з 8080 на порт 80)
(Не показано одну проміжну версію цього користувача)
Рядок 3: Рядок 3:
 
Дозвіл для Tomcat-у на порт 80.
 
Дозвіл для Tomcat-у на порт 80.
  
Система не пускає tomcat на привілейований порт (80), для цього редагуємо
+
Система не пускає tomcat на привілейований порт (80), для цього (у Debian) редагуємо
  
 
  sudo mc -e /etc/default/tomcat8
 
  sudo mc -e /etc/default/tomcat8
Рядок 156: Рядок 156:
 
Див. також:
 
Див. також:
 
* http://irbis.gpntb.ru/read.php?53,59259
 
* http://irbis.gpntb.ru/read.php?53,59259
 +
 +
= Налаштування пошти =
 +
 +
== SMTP-варіант ==
 +
 +
Редагуємо dspace.cfg у розділі „Email settings“
 +
 +
mail.server=smtp.univer.edu.ua                                                             
 +
mail.from.address = user@univer.edu.ua                                               
 +
feedback.recipient = user@univer.edu.ua                                               
 +
mail.admin = user@univer.edu.ua                                                       
 +
alert.recipient = user@univer.edu.ua                                                 
 +
registration.notify = user@univer.edu.ua                                             
 +
 +
sudo /etc/init.d/restart tomcat8
 +
 +
== GMail-варіант ==
 +
 +
Попередньо створити обліковий запис Google:
 +
 +
ІП = Ім'я Прізвище
 +
namesurname@gmail.com
 +
пароль=ПАРОЛЬ
 +
 +
Налаштування облікового запису > Доступ для менш безпечних додатків: Дозволено
 +
 +
Внести наступні зміни в dspace.cfg
 +
 +
mail.server=smtp.gmail.com
 +
mail.server.username = namesurname@gmail.com
 +
mail.server.password = ПАРОЛЬ
 +
 +
#mail.server.port = 25
 +
#mail.server.port = 587
 +
#mail.server.port = 465
 +
 +
mail.extraproperties = mail.smtp.socketFactory.port=465, \
 +
                        mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory, \
 +
                        mail.smtp.socketFactory.fallback=false
 +
 +
Також змінюємо
 +
 +
mail.from.address = namesurname@gmail.com
 +
feedback.recipient = namesurname@gmail.com
 +
mail.admin = namesurname@gmail.com
 +
alert.recipient = namesurname@gmail.com
 +
registration.notify = namesurname@gmail.com
 +
 +
Перевіряємо чи не занятий 465 порт
 +
 +
netstat -aunt | grep 465
 +
 +
з іншого компа перевіряємо відкриті
 +
 +
nmap dspace.univer.edu.ua
 +
 +
чи є прописаний в iptables
 +
 +
iptables -L -n
 +
 +
чи так
 +
 +
openssl s_client -connect smtp.gmail.com:465
 +
 +
(щодо 587 — openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587)
 +
 +
чи так
 +
 +
telnet smtp.gmail.com 465
 +
 +
додаємо цей порт в iptables
 +
 +
iptables -A INPUT  --protocol tcp -j ACCEPT --match tcp --destination-port 465
 +
iptables -A OUTPUT --protocol tcp -j ACCEPT --match tcp --source-port 465
 +
 +
Але краще додати у файл /etc/sysconfig/iptables додаємо правила
 +
 +
-A INPUT  --protocol tcp -j ACCEPT --match tcp --destination-port 465
 +
-A OUTPUT --protocol tcp -j ACCEPT --match tcp --source-port 465
 +
 +
Перезапуск iptables і tomcat
 +
 +
sudo service iptables restart
 +
sudo /etc/init.d/restart tomcat8
 +
 +
Перевіряємо дію пошти
 +
 +
/home/data/dspace/bin/dspace test-email
 +
 +
вивід
 +
 +
  About to send test email:
 +
  - To: user@univer.edu.ua
 +
  - Subject: DSpace test email
 +
  - Server: smtp.univer.edu.ua
 +
 +
Email sent successfully!
 +
 +
Див. також:
 +
* http://blog.stuartlewis.com/2009/09/05/using-gmail-with-dspace/
 +
* https://jira.duraspace.org/browse/DS-234
 +
* https://www.mail-archive.com/dspace-tech@lists.sourceforge.net/msg21962.html
 +
* http://dspace.2283337.n4.nabble.com/sending-mail-giving-error-td4675341.html
 +
* http://dspace.2283337.n4.nabble.com/Gmail-Authentication-td4674302.html#a4674310
 +
* http://dspace.2283337.n4.nabble.com/Gmail-Configuration-in-Dspace-4-1-td4674042.html
 +
* http://stackoverflow.com/questions/1516754/connecting-to-smtp-gmail-com-via-command-line
 +
* http://dspace.2283337.n4.nabble.com/Dspace-email-regitration-error-td4665752.html
  
 
= Sitemaps =
 
= Sitemaps =

Версія за 10:16, 22 травня 2017

Переключення Tomcat і DSpace з 8080 на порт 80

Дозвіл для Tomcat-у на порт 80.

Система не пускає tomcat на привілейований порт (80), для цього (у Debian) редагуємо

sudo mc -e /etc/default/tomcat8

і включаємо AUTHBIND

# If you run Tomcat on port numbers that are all higher than 1023, then you           
# do not need authbind.  It is used for binding Tomcat to lower port numbers.         
# (yes/no, default: no) 
AUTHBIND=yes


Now we need to tell "authbind" that Tomcat is allowed to use lower port numbers. Type the following commands:

sudo touch /etc/authbind/byport/80
sudo touch /etc/authbind/byport/443
sudo chmod 0755 /etc/authbind/byport/80
sudo chmod 0755 /etc/authbind/byport/443
sudo chown tomcat8.tomcat8 /etc/authbind/byport/80
sudo chown tomcat8.tomcat8 /etc/authbind/byport/443
cd /etc/authbind/byport
ls -l

Now we tell the Tomcat server to listen on the "authbind" ports. Edit the following file.

sudo mc -e /etc/tomcat8/server.xml

Find the connector for port 8080 and change it to port 80.

Замінити

<Connector port="8080" protocol="HTTP/1.1"                                        
              connectionTimeout="20000"                                              
              redirectPort="8443" /> 

на

<Connector port="80" protocol="HTTP/1.1"                                        
              connectionTimeout="20000" 
              redirectPort="443" /> 

/home/data/dspace/config/dspace.cfg

# DSpace base host URL.  Include port number etc.                                     
#dspace.baseUrl = http://localhost:8080                                               
dspace.baseUrl = http://localhost 
# DSpace base URL.  Include port number etc., but NOT trailing slash                  
# Change to xmlui if you wish to use the xmlui as the default, or remove              
# "/jspui" and set webapp of your choice as the "ROOT" webapp in                      
# the servlet engine.                                                                 
#dspace.url = http://localhost:8080/xmlui                                             
dspace.url = http://localhost/xmlui

/home/data/dspace/config/modules/oai.cfg

#solr.url=http://localhost:8080/solr/oai                                                                                                                                        
solr.url=http://localhost/solr/oai
#bitstream.baseUrl = http://localhost:8080/xmlui                                                                                                                                
bitstream.baseUrl = http://localhost/xmlui

/home/data/dspace/config/modules/discovery.cfg

#search.server = http://localhost:8080/solr/search                                                                                                                              
search.server = http://localhost/solr/search

/home/data/dspace/config/modules/solr-statistics.cfg

#server = http://localhost:8080/solr/statistics                                                                                                                                 
server = http://localhost/solr/statistics

/home/data/dspace/config/modules/rdf.cfg

#contextPath = http://localhost:8080/rdf                                                                                                                                        
contextPath = http://localhost/rdf 

/home/data/dspace/config/modules/swordv2-server.cfg

#error.alternate.url = http://localhost:8080/xmlui/contact                                                                                                                      
error.alternate.url = http://localhost/xmlui/contact 

#workspace.url-template = http://localhost:8080/xmlui/submit?workspaceID=#wsid#                                                                                                 
workspace.url-template = http://localhost/xmlui/submit?workspaceID=#wsid# 

/home/data/dspace/config/modules/sword-client.cfg

#targets = http://localhost:8080/sword/servicedocument, \                                                                                                                       
targets = http://localhost/sword/servicedocument, \ 

/home/data/dspace/config/modules/rdf/metadata-rdf-mapping.ttl

замінити localhost:8080 на localhost

/home/data/dspace/config/modules/rdf/constant-data-general.ttl

замінити localhost:8080 на localhost


Перезапуск Tomcat

sudo /etc/init.d/tomcat8 restart

Див. також

Веб-сервер Apache (порт 8080)

sudo apt-get install apache2

Оскільки 80 буде зайнятий Tomcat-ом, переналаштовуємо Apache на 8080.

Редагувати /etc/apache2/ports.conf:

#Listen 80
Listen 8080

та /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:8080>
…

Перезапуск Apache:

sudo /etc/init.d/apache2 restart

Ескізи при пошуку

Редагуємо dspace.cfg у розділі „Settings for Thumbnail creation“

# whether to display thumbnails on browse and search results pages (1.2+)
# If you have customised the Browse columnlist, then you must also
# include a 'thumbnail' column in your configuration (1.5+)
# (This configuration is not used by XMLUI.  To show thumbnails in the
#  XMLUI, you just need to create a theme which displays them)
#webui.browse.thumbnail.show = false
webui.browse.thumbnail.show = true

Ескізи при перегляді матеріалів

Редагуємо dspace.cfg у розділі „Settings for Item Preview“

#webui.preview.enabled = false
webui.preview.enabled = true

Кількість документів у фондах/зібраннях

Редагуємо dspace.cfg

webui.strengths.show = true
/etc/init.d/restart tomcat8

Див. також:

Налаштування пошти

SMTP-варіант

Редагуємо dspace.cfg у розділі „Email settings“

mail.server=smtp.univer.edu.ua                                                               
mail.from.address = user@univer.edu.ua                                                 
feedback.recipient = user@univer.edu.ua                                                
mail.admin = user@univer.edu.ua                                                        
alert.recipient = user@univer.edu.ua                                                   
registration.notify = user@univer.edu.ua                                               

sudo /etc/init.d/restart tomcat8

GMail-варіант

Попередньо створити обліковий запис Google:

ІП = Ім'я Прізвище
namesurname@gmail.com
пароль=ПАРОЛЬ

Налаштування облікового запису > Доступ для менш безпечних додатків: Дозволено

Внести наступні зміни в dspace.cfg

mail.server=smtp.gmail.com
mail.server.username = namesurname@gmail.com
mail.server.password = ПАРОЛЬ

#mail.server.port = 25
#mail.server.port = 587
#mail.server.port = 465

mail.extraproperties = mail.smtp.socketFactory.port=465, \
                       mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory, \
                       mail.smtp.socketFactory.fallback=false

Також змінюємо

mail.from.address = namesurname@gmail.com
feedback.recipient = namesurname@gmail.com
mail.admin = namesurname@gmail.com
alert.recipient = namesurname@gmail.com
registration.notify = namesurname@gmail.com

Перевіряємо чи не занятий 465 порт

netstat -aunt | grep 465

з іншого компа перевіряємо відкриті

nmap dspace.univer.edu.ua

чи є прописаний в iptables

iptables -L -n

чи так

openssl s_client -connect smtp.gmail.com:465

(щодо 587 — openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587)

чи так

telnet smtp.gmail.com 465

додаємо цей порт в iptables

iptables -A INPUT  --protocol tcp -j ACCEPT --match tcp --destination-port 465
iptables -A OUTPUT --protocol tcp -j ACCEPT --match tcp --source-port 465

Але краще додати у файл /etc/sysconfig/iptables додаємо правила

-A INPUT  --protocol tcp -j ACCEPT --match tcp --destination-port 465
-A OUTPUT --protocol tcp -j ACCEPT --match tcp --source-port 465

Перезапуск iptables і tomcat

sudo service iptables restart
sudo /etc/init.d/restart tomcat8

Перевіряємо дію пошти

/home/data/dspace/bin/dspace test-email

вивід

 About to send test email:
 - To: user@univer.edu.ua
 - Subject: DSpace test email
 - Server: smtp.univer.edu.ua

Email sent successfully!

Див. також:

Sitemaps

https://wiki.duraspace.org/pages/viewpage.action?pageId=34642415

Налаштувати robots.txt

User-agent: *

# Uncomment the following line ONLY if sitemaps.org or HTML sitemaps are used
# and you have verified that your site is being indexed correctly.
# Disallow: /browse

Host: elartu.tntu.edu.ua

# Disable access to Discovery search and filters
Disallow: /discover
Disallow: /search-filter

# This should be the FULL URL to your HTML Sitemap..
# Make sure to replace "[dspace.url]" with the value of your 'dspace.url' setting in your dspace.cfg file.
Sitemap: http://elartu.tntu.edu.ua/htmlmap

Створювати по крону

# Generate sitemaps
#  every day at 6:00
00 06 * * * /usr/share/dspace/bin/generate-sitemaps

Додати в Google та Яндекс ВебМайстри

http://elartu.tntu.edu.ua/htmlmap?map=0
http://elartu.tntu.edu.ua/htmlmap?map=1
http://elartu.tntu.edu.ua/htmlmap?map=2
http://elartu.tntu.edu.ua/htmlmap?map=3
http://elartu.tntu.edu.ua/htmlmap?map=4
http://elartu.tntu.edu.ua/sitemap?map=0

Переміщення/об’єднання підфондів

http://my_dspace/phppgadmin/

Вихідні дані

handle старого батьківського фонду =123456789/37
handle нового батьківського фонду = 123456789/18350
handle підфонду, що переміщується = 123456789/64


Через таблицю handle визначаємо внутрішні resource_id, що відповідають parent_comm_id та child_comm_id у таблиці community2community


handle=123456789/64         resource_id=27
handle=123456789/18350   resource_id=223
handle=123456789/37         resource_id=18

Далі робимо переміщення у таблиці community2community замінюючи 18 на 223

Однак залишається проблема з вилучення старого фонду. Його номер ще згадується у таблицях community_item_count та communities2item


В community_item_count легко замінити в community_id з 18 на 223 ! примітка: таблицю community_item_count, здається, можна й не чіпати


З таблицею communities2item трохи складніше. Тут є перелік всіх матеріалів, прив’язаних до фонду 18, рядків багато. Поміг SQL-Запит

UPDATE communities2item SET community_id='223' WHERE "community_id"='21';


Також див. тут

Прибирання 1 кроку

На цьому кроці відбувався вибір: опубліковане чи ні, про декілька назв та декілька файлів.

Щоб прибрати це у файлі item-submission.xml

закоментуйте блок

 <step> 
   <heading>submit.progressbar.initial-questions</heading> 
   <processing-class>org.dspace.submit.step.InitialQuestionsStep</processing-class> 
   <jspui-binding>org.dspace.app.webui.submit.step.JSPInitialQuestionsStep</jspui-binding>
   <xmlui-binding>org.dspace.app.xmlui.aspect.submission.submit.InitialQuestionsStep</xmlui-binding> 
   <workflow-editable>true</workflow-editable> 
</step> 

та розкоментуйте блок

 <step>
   <processing-class>org.dspace.submit.step.SkipInitialQuestionsStep</processing-class>
 </step>

Див. також