Xwiki8.4.5 install


Xwiki 8.4.5 インストール

1.Xwikiのダウンロード

  1. 自分の仮想マシンにログインする。
    Teratermの場合:
    172.16.95.xx (教室の後ろの自分用の仮想サーバ)
    ログインID: root
    ログインパスワード: LinuxServer@pass
    でログインする。
    Linuxのsshの場合:
    ssh  root@1722.16.95.xx
    パスワード:LinuxServer@pass
     
  2. 大元のダウンロードサイト:(ここからはダウンロードせず、下記3.の項のようにダウンロードする。)
    https://www.xwiki.org/xwiki/bin/view/Download/
    8.4.5 を選び、下記 zip 版を、自分の仮想マシン内にダウンロードする。
    ZIP Package
    ファイル名:
    xwiki-enterprise-jetty-hsqldb-8.4.5.zip
     
  3. 皆でダウンロードすると時間がかかるので、
    今回は、下記に置いてあります。
    http://192.168.0.76/dl/Xwiki.zip

    コピー方法:各自の仮想マシンから以下を実行する。
    cd でホームディレクトリに移動後、
    wget  http://192.168.0.76/dl/xwiki.zip
     

2.Xwikiの解凍と配置

  1. 解凍する。
    cd
    unzip  xwiki.zip
    ls
    xwiki-enterprise-jetty-hsqldb-8.4.5 というディレクトリができる。
     
  2. 配置する。(ディレクトリのまるごと移動)注意: xwikiくらいまで打ってからTABキーで補完できます。
    mv xwiki-enter prise-jetty-hsqldb-8.4.5  /var/www/xwiki845

3.ポートの変更

  1. 配置したディレクトリに移動
    cd  /var/www/xwiki845
     
  2. 下記ファイルのポートを変更(変更方法は以下を参照)
    vi  start_xwiki.sh
    8080→8090
    8079→8091

    vi  stop_xwiki.sh
    8080→8090
    8079→8091

    変更方法
    vi エディタで、:(コロン)を打って、下記コマンドで一括変更
    注意: %s は、先頭行から最終行まで全て変換、 g は、1行に複数あっても全て変換、の意味。
    s/A/B/ は、AをBに置き換え(substitute)する、の意味。

    :%s/8080/8090/g
    :%s/8079/8091/g

4.起動

  1. 下記コマンドで起動する。
    ./start_xwiki.sh &
     
  2. しばらく待つ。[root@localhost xwiki83]# ./start_xwiki.sh &
    Starting Jetty on port 8090, please wait...

    (途中略) JavaのException (at ・・・・のようなメッセージ)がでていないか注意する。

    6250d33c{HTTP/1.1}{0.0.0.0:8090}
    2016-11-01 10:37:08.133:INFO:oejs.Server:main: Started @71222ms
    2016-11-01 10:37:08.133:INFO:oxtjl.NotifyListener:main: ----------------------------------
    2016-11-01 10:37:08.146:INFO:oxtjl.NotifyListener:main: Server started, you can now open http://localhost:8090/ in your browser to access your wiki.
    2016-11-01 10:37:08.146:INFO:oxtjl.NotifyListener:main: ------------------------
    こんな感じのメッセージがでたら、エンターキーを押して、コマンドラインにしておいてよい。(放置してもよい。)

    [root@localhost xwiki83]#

     

5.ブラウザでアクセス、ログイン

  1. Linux外(手元のWindows)からのブラウザでアクセスする場合:
    1. LinuxのIPアドレスを確認
      各自の仮想サーバ: 172.16.95.xx です。
       
    2. ポート 8090, 8091を下記コマンドで開く。
      コマンド:

      firewall-cmd --add-port=8090/tcp --permanent

      firewall-cmd --add-port=8091/tcp --permanent

      firewall-cmd --reload

      firewall-cmd  --list-all   表示される内容に、8090, 8091があることを確認する。
       
  2. 手元のWindowsのブラウザから下記でアクセス。

    http://172.16.95.xx:8090/

    しばらく、%表示が上がっていくので、待つ。
     
  3. ログインする。
    画面右上の横三本線(三)をクリックし、ログインする。
    ID: Admin
    初期パスワード: admin

6.一般ユーザに登録させない設定

  1. 画面右上三本線(三)クリックし、
    Administer Wiki
    を選択。
     
  2. Users&Groupsの、Rights(権限)をクリック
     
  3. Usersのラジオボタンをクリック選択する。
     
  4. Unregisterred User (未登録ユーザ)の、「Register」をクリックして
    チェックを外し、xwiki-batsu.PNG(侵入禁止マーク)にする。
     
  5. 画面左上「Xwikiロゴ」をクリックして、ホームに戻る。

7. ページの作成、編集

  1. 画面真ん中右寄りの「+」マークで文書作成、適宜タイトルをつける。
    手順はここを参照(PDF)
     
  2. 画面真ん中右寄りの「鉛筆マーク」で文書編集できます。
    リンク
    画像挿入
    などやってみましょう。

8. 編集機能の追加

  1. URLに下記を入れる。
    192.168.1.11:8090/xwiki/bin/edit/CKEditor/EditSheet?editor=object

    ckedit-tuning.PNG

     
  2. 下記をクリック
    JavaScriptExtension 0: CKEditor Loader

    下記のような編集テキストが表示される。

    /*
    #set ($ckeditorPath = $services.webjars.url('org.xwiki.contrib:application-ckeditor-webjar', 'ckeditor'))
    #set ($bootstrap3typeaheadPath = $services.webjars.url('org.webjars.npm:bootstrap-3-typeahead', 'bootstrap3-typeahead.min'))
    #if ("$!ckeditorPath" == '')
      ## Before 6.3RC1
      #set ($ckeditorPath = $services.webjars.url('application-ckeditor-webjar/1.8.5/ckeditor.js'))
      #set ($bootstrap3typeaheadPath = $services.webjars.url('bootstrap-3-typeahead/4.0.1/bootstrap3-typeahead.min.js'))
    #elseif ($ckeditorPath.indexOf('?') >= 0)
      ## Before 7.1M1 the WebJar resource path was included in the query string which means we have to specify the '.js'
      ## extension (Require.js doesn't add it in this case).
      #set ($ckeditorPath = "${ckeditorPath}.js")
      #set ($bootstrap3typeaheadPath = "${bootstrap3typeaheadPath}.js")
    #end
    #set ($ckeditorBasePath = $stringtool.removeEnd($stringtool.removeEnd($ckeditorPath, '.js'), 'ckeditor'))
    #set ($resourcePickerBundlePath = "${ckeditorBasePath}plugins/xwiki-resource/resourcePicker.bundle.min")
    #set ($macroWizardBundlePath = "${ckeditorBasePath}plugins/xwiki-macro/macroWizard.bundle.min")
    #set ($modalPath = "${ckeditorBasePath}plugins/xwiki-dialog/modal.min")
    #if ($resourcePickerBundlePath.indexOf('?') >= 0)
      ## Before 7.1M1 the WebJar resource path was included in the query string which means we have to specify the '.js'
      ## extension (Require.js doesn't add it in this case).
      #set ($resourcePickerBundlePath = "${resourcePickerBundlePath}.js")
      #set ($macroWizardBundlePath = "${macroWizardBundlePath}.js")
      #set ($modalPath = "${modalPath}.js")
    #end
    */
    require.config({
      paths: {
        ckeditor: '$!ckeditorPath',
        resource: '$!resourcePickerBundlePath',
        resourcePicker: '$!resourcePickerBundlePath',
        entityResourcePicker: '$!resourcePickerBundlePath',
        entityResourceSuggester: '$!resourcePickerBundlePath',
        entityResourceDisplayer: '$!resourcePickerBundlePath',
        modal: '$!modalPath',
        macroWizard: '$!macroWizardBundlePath',
        'bootstrap3-typeahead': '$!bootstrap3typeaheadPath',
        'autosave': "$xwiki.getSkinFile('js/xwiki/editors/autosave', true)"
      },
      shim: {
        ckeditor: {
          exports: 'CKEDITOR',
          // This includes dependencies of the plugins bundled with the CKEditor code.
          deps: ['jquery', 'resource', 'resourcePicker', 'macroWizard']
        }
      }
    });

    (function() {
      window.CKEDITOR_BASEPATH = "$!ckeditorBasePath";

      var init = function($, ckeditor, xwikiMeta) {
        $('.ckeditor-textarea').each(function() {
          var editor = ckeditor.replace(this, {
            allowedContent: true,
            // Modify the strike and underline core styles to match what the XWiki Rendering is generating and expecting.
            // See CKEDITOR-52: Unable to un-strike or un-underline saved content
            coreStyles_strike: {
              element: 'del',
              overrides: ['s', 'strike']
            },
            coreStyles_underline: {
              element: 'ins',
              overrides: 'u'
            },
            // Don't convert Latin characters to the corresponding named HTML entities in the HTML output because the HTML
            // cleaner used on the server side doesn't recognize some of them (XCOMMONS-929).
            // See CKEDITOR-38: CKEditor converts Umlaute to HTML equivalents
            entities_latin: false,
            filebrowserUploadUrl: XWiki.currentDocument.getURL('get', $.param({
              sheet: 'CKEditor.FileUploader',
              outputSyntax: 'plain',
              form_token: xwikiMeta.form_token
            })),
            // This is used in CKEditor.FileUploader so we must keep them in sync.
            fileTools_defaultFileName: '__fileCreatedFromDataURI__',
            fullPage: true,
            height: 500,
            linkShowAdvancedTab: false, ← trueに変更!
            linkShowTargetTab: false,   ← trueに変更
        // removeButtons: 'Find,Anchor',
        //removePlugins: 'bidi,colorbutton,font,justify,save,specialchar',
        removePlugins: 'save',  ← saveだけ残し、あとは消す。
            toolbarGroups: [
              {name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
              {name: 'paragraph',   groups: ['list', 'indent', 'blocks', 'align', 'bidi']},
              {name: 'clipboard',   groups: ['clipboard', 'undo']},
              {name: 'editing',     groups: ['find', 'selection', 'spellchecker']},
              {name: 'forms'},
              '/',
              {name: 'links'},
              {name: 'insert'},
              {name: 'styles'},
              {name: 'colors'},
              {name: 'document',    groups: ['mode', 'document', 'doctools']},
              {name: 'tools'},
              {name: 'others'},
              {name: 'about'}
            ],
            'xwiki-resource': {
              dispatcher: XWiki.currentDocument.getURL('get', 'sheet=CKEditor.ResourceDispatcher&outputSyntax=plain')
            },
            'xwiki-save': {
              leaveConfirmation: true
            },
            'xwiki-source': {
              htmlConverter: XWiki.currentDocument.getURL('get', 'sheet=CKEditor.HTMLConverter&outputSyntax=plain')
            }
          });
        });
      };

      var loadTreeCode = function(callback) {
        if (!require.specified('tree')) {
          // Before 6.4
          require.config({
            paths: {
              jsTree: "$!services.webjars.url('jstree', 'jstree.min.js')",
              JobRunner: "$!services.webjars.url('org.xwiki.platform:xwiki-platform-job-webjar', 'jobRunner.min.js')",
              tree: "$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'tree.min.js')"
            }
          });
        }
        require(['tree'], function() {
          callback();
        });
      };

      require([
        'jquery',
        'ckeditor',
        // Used to access the form token.
        'xwiki-meta',
        // Used to catch form action events fired from Prototype.js code (actionButtons.js).
        'xwiki-events-bridge',
        // Activate the auto-save feature.
        'autosave',
        // Configures the path to the tree widget module and its dependencies.
        "$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'require-config.min.js', {'evaluate': true})",
        // Used on the link, image and macro dialogs to select pages and attachments.
        'entityResourcePicker', 'entityResourceSuggester', 'entityResourceDisplayer'
      ], function($, ckeditor, xwikiMeta) {
        // xwiki-meta module is available only since 6.3M2
        xwikiMeta = xwikiMeta || {
          form_token: $('meta[name="form_token"]').attr('content')
        };
        // Load the tree used by the page and attachment pickers.
        loadTreeCode(function() {
          init($, ckeditor, xwikiMeta);
        });
      });
    })();

  3. 下記を変更
            linkShowAdvancedTab: false,   ← false をtrueに変更
            linkShowTargetTab: false,    ← false をtrueに変更
     
  4. 下記を変更(saveのみ残し、あとは消す。)
    removePlugins: 'bidi,colorbutton,font,justify,save,specialchar',

    removePlugins: 'save',
     
  5. 最後に、画面下の方の Save & View ボタンをクリックして、保存する。
  6. 画面左上の「Xwiki」ロゴをクリックする。
  7. 適当なページを選び、編集(鉛筆アイコン)をクリックして、編集ボタン群で下記を確認。
    フォントカラー、背景カラー、URLリンクのターゲットが表示されることを確認。
Tags:
Created by Akiyoshi Yamakawa on 2016/10/31 20:54
    

Tips

You can click on the arrows next to the breadcrumb elements to quickly navigate to sibling and children pages.

Need help?

If you need help with XWiki you can contact: