If it is not explicitly told in following recipe, setting up services are described for Ubuntu 16.04 server, but applications are described for Ubuntu 16.04 and/or Lubuntu 16.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

XWiki uzstādīšana no ražotāja vietnes

XWiki ir viki serveris, kas darbojas Java vidē. Jaunu XWiki sistēmu, rekomendējam uzstādīt, izmantojot Apt pakotni.
Šajā lapā ir aprakstīts, kā uzstādīt visjaunāko XWiki versiju, no izstrādātāja vietnes, izmantojot *.war failu.
  1. Savāc Stable versijas uzstādīšans failus no XWiki mājaslapas WAR Package for Servlet Container.
  2. Iekopē war failu xwiki-platform-distribution-war-...war mapē .../webapps un pārstartē Tomcat lietotņu serveri.
    Tā rezultātā war arhīvs atarhivējas un izveidojas mape ../webapps/xwiki-platform...
  3. Pārsauc xwiki-platfrom... par xwiki un pēc tam izdzēš war failu:
  4. Izmaina Tomcat atmiņas apjoma iestatījumus failā, piemēram, /etc/defaults/tomcat9:

    ...
        # JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"
        JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx512m -XX:MaxPermSize=256m -Dfile.encoding=utf-8 -XX:+UseParallelGC -XX:MaxGCPauseMillis=100"
    ...
  5. Failā: ../webapps/xwiki/WEB-INF/hibernate.cfg.xml
    1. Nokomentē noklusētās bāzes iestatījumus:

      <!-- Configuration for the default database.
               Comment out this section and uncomment other sections below if you want to use another database.
               Note that the database tables will be created automatically if they don't already exist.
          <property name="connection.url">jdbc:hsqldb:file:database/xwiki_db;shutdown=true</property>
          ...
         / <mapping resource="activitystream.hbm.xml"/>
          -->
    2. Atkomentē failā tos Hibernate iestatījumus, kuri  atbilst MySQL datubāzei:

          <!-- MySQL configuration.
      Uncomment if you want to use MySQL ...
      ...
      -->
          <property name="connection.url">jdbc:mysql://localhost...
          ...
          <mapping resource="feeds.hbm.xml"/>
    3. Ja, palaižot serveri parādās kļūda:

      com.mysql.cj.exceptions.InvalidConnectionAttributeException:
      The server time zone value 'EEST' is unrecognized or represents more than one time zone.
      ...

      rindu

      <property name="hibernate.connection.url">jdbc:mysql://localhost/xwiki?useSSL=false</property>

      nomaina uz

      <property name="hibernate.connection.url">jdbc:mysql://localhost/xwiki?useSSL=false&amp;serverTimezone=Europe/Riga</property>
  6. Atver MySQL konsoli un ar root tiesībām un ieraksta sekojošas komandas:

    CREATE DATABASE xwiki CHARACTER SET utf8 COLLATE utf8_general_ci;
    GRANT ALL PRIVILEGES ON xwiki.* TO 'xwiki'@'localhost' IDENTIFIED BY 'xwiki';
    FLUSH PRIVILEGES;
  7. Pārliecinās, ka failā .../webapps/xwiki/WEB-INF/web.xml ir UTF-8 kodējums:

    <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>com.xpn.xwiki.web.SetCharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>
  8. Pārliecinās, ka failā  .../webapps/xwiki/WEB-INF/xwiki.cfg arī ir UTF-8 kodējums:

    xwiki.encoding=UTF-8
  9. Ja nepieciešams, pārbauda failu /var/lib/tomcat9/conf/server.xml, papildinot visu konektoru iestatījumu parametrus ar URIEncoding="UTF-8":

    ...
    <Connector port="8080" maxHttpHeaderSize="8192"
                   URIEncoding="UTF-8" />
    ...
    <Connector port="8009"
    ...
                   URIEncoding="UTF-8" />
    ...
  10. Zem .../webapps/xwiki/WEB-INF/lib iekopē MySQL datubāzes draiveri (sk. "Connector/J" MySQL lejuplādes lapā).

  11. Pārstartē Tomcat serveri vēlreiz:

    /etc/init.d/tomcat9 restart

Papildu iestatījumi

  1. Ja pieeja internetam ir caur staprniekserveri (proxy), tad /etc/init.d/tomcat9 failā pievieno parametrus -Dhttp.proxyHost un -Dhttp.proxyPort, piemēram:

    # Set java.awt.headless=true if CATALINA_OPTS is not set so the
    ...
    if [[ -z "$JAVA_OPTS" ]]; then
    #  JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
     JAVA_OPTS="-Djava.awt.headless=true -Dhttp.proxyHost=144.36.116.39 -Dhttp.proxyPort=8080 -Xmx128M"
    fi
  2. Ja kā Tomcat fasādi lieto Apache tīmekļa serveri
    1. iestata Apache2 Jk konektoru tā, lai tas pieslēgtos Tomcat lietotnei /xwiki: pievieno /etc/apache2/apache2.conf faila beigās sekojošas 2 rindas (skatīt Tomcat integrācija ar Apache):

      JkMount /xwiki ajp13_worker
      JkMount /xwiki/* ajp13_worker
    2. Izveido /var/www/robots.txt failu ar sekojošu saturu:

      User-agent: *
      Disallow: /*?*
      Disallow: /Panels/
      Disallow: /Sandbox/
      Disallow: /XWiki/
      Disallow: /xwiki/
      Allow: /xwiki/bin/download/

Saites


  
Created by Valdis Vītoliņš on 2013-11-09 15:29
Last modified by Valdis Vītoliņš on 2020-05-07 00:03
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License