Line 1: |
Line 1: |
| {{WIP box}} | | {{WIP box}} |
| | | |
− | this how-to is an help to install mediawiki libraries (mwlib) on SME 9 | + | this how-to is an help to install mediawiki libraries (mwlib) on SME 9 and SME 10 |
| | | |
| === install === | | === install === |
| + | <tabs container=""><tab name="For SME 10"> |
| + | <syntaxhighlight lang="bash"> |
| + | yum install smeserver-extrarepositories-epel -y |
| + | |
| + | yum install pdftk gcc gcc-c++ cpp make python-devel libjpeg-devel zlib-devel freetype-devel lcms-devel lcms2-devel libxslt-devel libxml2-devel git ocaml python-pip python-gevent python-py python-apipkg ImageMagick texlive-latex texlive-texvc blahtexml openssl-devel python-devel libffi-devel pyOpenSSL python2-pyasn1 python2-pyasn1-modules--enablerepo=epel --enablerepo=extras -y |
| + | </syntaxhighlight> |
| + | note, those are not available on SME10, but it seems to work out: texlive-texvc, blahtexml |
| + | |
| + | ===== python pip ===== |
| + | <syntaxhighlight lang="bash"> |
| + | # apipkg provided in the repo is 1.4 and does not work with python 2.6 |
| + | pip install apipkg==1.2 |
| + | # Pillow is required, but the version 4.0 has a syntax error when running with python 2.6 |
| + | pip install -i http://pypi.pediapress.com/simple/ Pillow==3.4.2 --trusted-host pypi.pediapress.com |
| + | # last version fails with python 2.6 |
| + | pip install -i http://pypi.pediapress.com/simple/ --trusted-host pypi.pediapress.com pygments==1.6 |
| + | easy_install -i http://pypi.pediapress.com/simple/ mwlib mwlib.rl pyfribidi |
| + | cd ~ |
| + | git clone https://github.com/pediapress/texvc |
| + | cd texvc; make; make install |
| + | |
| + | pip install ndg-httpsclient |
| + | |
| + | </syntaxhighlight> |
| + | |
| + | ===== configure services ===== |
| + | <syntaxhighlight lang="bash"> |
| + | mkdir /var/log/mediawiki/ |
| + | chown www:www -R /var/log/mediawiki/ |
| + | config set nserve service status enabled access localhost TCPPort 19737 |
| + | config set mw-qserve service status enabled access localhost TCPPort 19252 |
| + | config set nslave service status enabled access localhost |
| + | |
| + | cat >/etc/systemd/system/nslave.service <<- EOM |
| + | [Unit] |
| + | Description=Mediawiki_collection_extension nslave |
| + | After=network-online.target mw-qserve.service nserve.service |
| + | |
| + | [Service] |
| + | Type=simple |
| + | User=www |
| + | Group=www |
| + | Environment=PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin |
| + | ExecStart=/bin/bash -c 'nslave --serve-files-port=20361 --host=localhost --port=19252 --numprocs=1 --cachedir /var/log/mediawiki/ ' |
| + | |
| + | [Install] |
| + | WantedBy=sme-server.target |
| + | |
| + | EOM |
| + | |
| + | cat >/etc/systemd/system/mw-qserve.service <<- EOM |
| + | [Unit] |
| + | Description=Mediawiki_collection_extension mw-qserve |
| + | After=network-online.target nserve.service |
| + | |
| + | [Service] |
| + | Type=simple |
| + | User=www |
| + | Group=www |
| + | Environment=PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin |
| + | ExecStart=/bin/bash -c 'mw-qserve -p 19252 -i localhost ' |
| + | |
| + | [Install] |
| + | WantedBy=sme-server.target |
| + | EOM |
| + | |
| + | |
| + | cat >/etc/systemd/system/nserve.service <<- EOM |
| + | [Unit] |
| + | Description=Mediawiki_collection_extension nserve |
| + | After=network-online.target |
| + | |
| + | [Service] |
| + | Type=simple |
| + | User=www |
| + | Group=www |
| + | Environment=PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin |
| + | ExecStart=/bin/bash -c 'nserve --port=19737 --qserve=localhost:19252 ' |
| + | |
| + | [Install] |
| + | WantedBy=sme-server.target |
| + | |
| + | EOM |
| + | |
| + | /etc/e-smith/events/actions/systemd-default |
| + | /usr/bin/systemctl start nserve.service mw-qserve.service nslave.service |
| + | </syntaxhighlight> |
| + | |
| + | |
| + | </tab><tab name="For SME 9"> |
| | | |
| you will need pdftk from dag (this repo does not exist anymore so here a way to get the files) | | you will need pdftk from dag (this repo does not exist anymore so here a way to get the files) |
Line 62: |
Line 152: |
| if the previous fails: | | if the previous fails: |
| | | |
− | <syntaxhighlight> | + | <syntaxhighlight lang="bash" > |
| easy_install -i http://pypi.pediapress.com/simple/ mwlib mwlib.rl pyfribidi | | easy_install -i http://pypi.pediapress.com/simple/ mwlib mwlib.rl pyfribidi |
| </syntaxhighlight>install texvc | | </syntaxhighlight>install texvc |
Line 77: |
Line 167: |
| def tostring(self): return self.tobytes() | | def tostring(self): return self.tobytes() |
| | | |
− | === startup script === | + | ===== startup script ===== |
| mkdir /var/log/mediawiki/ | | mkdir /var/log/mediawiki/ |
| chown www:www -R /var/log/mediawiki/ | | chown www:www -R /var/log/mediawiki/ |
Line 116: |
Line 206: |
| popd | | popd |
| | | |
− | logrotate :<syntaxhighlight lang="bash"> | + | ===== logrotate : ===== |
| + | <syntaxhighlight lang="bash"> |
| cat > /etc/logrotate.d/mwlib <<- EOM | | cat > /etc/logrotate.d/mwlib <<- EOM |
| | | |
Line 138: |
Line 229: |
| EOM | | EOM |
| </syntaxhighlight> | | </syntaxhighlight> |
| + | ===You might also need to do === |
| + | if python complains too much of SSL and SNI |
| + | yum install openssl-devel python-devel libffi-devel -y |
| + | pip install pyOpenSSL ndg-httpsclient pyasn1 |
| + | |
| + | see https://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package |
| + | </tab> |
| + | |
| + | </tabs> |
| | | |
| ===Sources=== | | ===Sources=== |
Line 145: |
Line 245: |
| | | |
| | | |
− | ===ALternatives === | + | ===Alternatives === |
| use rpm for centos7 | | use rpm for centos7 |
| https://gitlab.com/harbottle/epypel | | https://gitlab.com/harbottle/epypel |
| | | |
| https://harbottle.gitlab.io/epypel/7/x86_64/ | | https://harbottle.gitlab.io/epypel/7/x86_64/ |
− |
| |
− | ===You might also need to do ===
| |
− | if python complains too much of SSL and SNI
| |
− | yum install openssl-devel python-devel libffi-devel -y
| |
− | pip install pyOpenSSL ndg-httpsclient pyasn1
| |
− |
| |
− | see https://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package
| |
− |
| |
| | | |
| === to test === | | === to test === |