Odo.lv » Recipes » Xwiki satura pārvaldības sistēma » Xwiki satura pārvaldības servera uzstādīšana

Xwiki satura pārvaldības servera uzstādīšana


Priekšnoteikumi: JDK programmēšanas vide Tomcat tīmekļa lietotņu serveris MySQL datubāze
Ieteicams: Apache tīmekļa serveris
lv 
Tālāk

XWiki ir viki serveris, kas darbojas Java vidē.

  1. Savāc 2 failus no XWiki mājaslapas - xwiki-enterprise-web-x.y.war (uzlikšanai uz gatava Web konteinera), kā arī xwiki-enterprise-wiki-x.y.xar - Wiki inicializācijas faili (t.i. gandrīz tukša Wiki sākumsatura uzlikšanai).
  2. root kopē WAR failu xwiki-enterprise-web-x.y.war direktorijā /usr/share/tomcat5.5/webapps un pārstartē Tomcat:
    /etc/init.d/tomcat5.5 restart
    Tā rezultātā WAR arhīvs atarhivējas un izveidojas direktorija /usr/share/tomcat5.5/webapps/xwiki-enterprise-web-x.y.
  3. Pārsauc xwiki-enterprise-web-x.y par xwiki un pēc tam izdzēš WAR failu:
    cd /usr/share/tomcat5.5/webapps/
    mv xwiki-enterprise-web-x.y  xwiki
    rm xwiki-enterprise-web-x.y.war
    rm -fr xwiki-enterprise-web-x.y
  4. Failā /etc/init.d/tomcat5.5
    1. Pievieno rindas:
      …
      DEFAULT=/etc/default/$NAME

      # as xwiki make log in the current folder, change to cd /var/log/tomcat5.5 ...
    2. Izmaina Tomcat drošības iestatījumus, nomainot rindu TOMCAT_SECURITY=yes uz:
      # Use the Java security manager? (yes/no)
      TOMCAT5_SECURITY=no
      Tas vajadzīgs, jo XWiki raksta savu žurnāla (log) failu direktorijā /usr/share/tomcat5.5/webapps/xwiki/WEB-INF
    3. Izmaina Tomcat atmiņas apjoma iestatījumus failā /etc/init.d/tomcat5.5:
      if [ -z "$JAVA_OPTS" ]; then
          # JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
          JAVA_OPTS="-Djava.awt.headless=true -Xms256m -Xmx256m -XX:MaxPermSize=256m"	

      fi
  5. Failā: /usr/share/tomcat5.5/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 …
      We need to set the sql_mode to a 
      less strict value, see XWIKI-1945
      -->
          <property name="connection.url">jdbc:mysql://localhost…
          …
          <mapping resource="feeds.hbm.xml"/>
  6. Piekonfigurē 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
  7. Atver MySQL konsoli 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;
  8. Pārliecinās, ka failā /usr/share/tomcat5.5/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>
  9. Pārliecinās, ka failā /usr/share/tomcat5.5/webapps/xwiki/WEB-INF/xwiki.cfg arī ir UTF-8 kodējums:
    xwiki.encoding=UTF-8
  10. Rediģē failu /usr/share/tomcat5.5/conf/server.xml, papildinot visu konektoru konfigurācijas parametrus ar URIEncoding="UTF-8":
    …
    <Connector port="8180" maxHttpHeaderSize="8192"
                   URIEncoding="UTF-8" />
    …
    <Connector port="8009"
    …
                   URIEncoding="UTF-8" />
    ...
  11. Zem /usr/share/tomcat5.5/webapps/xwiki/WEB-INF/lib iekopē MySQL datubāzes draiveri (sk. "Connector/J" MySQL lejuplādes lapā).
    Warning: Līdz Xwiki 3.1 versijai strādā 5.1.10 mysql konektors. Ar jaunāku lamājas par hibernate.cfg kļūdu.
  12. Ja pieeja internetam ir caur staprniekserveri (proxy), tad /etc/init.d/tomcat5.5 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
  13. Pārstartē Apache2 un Tomcat5 serveri vēlreiz:
    /etc/init.d/apache2 stop
    /etc/init.d/tomcat5.5 restart
    /etc/init.d/apache2 start
  14. Izveido /var/www/robots.txt failu (maska 644) ar sekojošu saturu:
    User-agent: *
    Disallow: /*?
    Disallow: /XWiki/
    Disallow: /xwiki/bin/attach/
    Disallow: /xwiki/bin/cancel/
    Disallow: /xwiki/bin/commentadd/
    Disallow: /xwiki/bin/delattachment/
    Disallow: /xwiki/bin/delete/
    Disallow: /xwiki/bin/dot/
    Disallow: /xwiki/bin/download/
    Disallow: /xwiki/bin/downloadrev/
    Disallow: /xwiki/bin/edit/
    Disallow: /xwiki/bin/export/
    Disallow: /xwiki/bin/get/
    Disallow: /xwiki/bin/inline/
    Disallow: /xwiki/bin/jsx/
    Disallow: /xwiki/bin/lifeblog/
    Disallow: /xwiki/bin/login/
    Disallow: /xwiki/bin/loginerror/
    Disallow: /xwiki/bin/logout/
    Disallow: /xwiki/bin/objectremove/
    Disallow: /xwiki/bin/pdf/
    Disallow: /xwiki/bin/preview/
    Disallow: /xwiki/bin/propadd/
    Disallow: /xwiki/bin/propdelete/
    Disallow: /xwiki/bin/propupdate/
    Disallow: /xwiki/bin/register/
    Disallow: /xwiki/bin/save/
    Disallow: /xwiki/bin/skin/
    Disallow: /xwiki/bin/ssx/
    Disallow: /xwiki/bin/status/
    Disallow: /xwiki/bin/upload/
    Disallow: /xwiki/bin/viewattachrev/
    Disallow: /xwiki/bin/viewrev/
    Disallow: /xwiki/bin/xmlrpc/

Tālāk


Skatīt arī
Saites

Created by Valdis Vītoliņš on 2008/08/08 19:24
Last modified by Valdis Vītoliņš on 2012/01/09 11:42

XWiki Enterprise 2.7.33656 - Documentation
Creative Commons Attribution 3.0 Unported License