linkchecker/doc/install.txt

193 lines
6.7 KiB
Text
Raw Permalink Normal View History

2009-03-11 22:29:50 +00:00
Installation
============
If you are upgrading from older versions of LinkChecker you should
2011-07-25 17:44:12 +00:00
also read the upgrading documentation stored in upgrading.txt.
2009-03-11 22:29:50 +00:00
Installing a LinkChecker release uses pre-built distribution packages. Building
the distribution packages requires hatchling_ and hatch-vcs_, and for application
translations to be compiled polib_ needs to be installed. After the sdist/wheel
has been built polib_ can be removed. pip-run_ may be useful for this.
There are several steps to resolve problems with detecting the character
encoding of checked HTML pages:
first ensure the web server, if used, is not returning an incorrect charset in
the Content-Type header; second, if possible add a meta element to the HTML
page with the correct charset; finally, check chardet_ is not installed,
Requests >= 2.26 will install charset-normalizer_, Beautiful Soup has
its own encoding detector but will use in order of preference cchardet_,
chardet_ or charset-normalizer_ (Beautiful Soup >= 4.11). You might find that
one of the other three detectors works better for your pages.
There may already be a system copy of e.g. chardet installed;
installing LinkChecker in a Python venv_ gives control over which packages are
used.
.. _chardet: https://pypi.org/project/chardet/
.. _charset-normalizer: https://pypi.org/project/charset-normalizer/
.. _pip-run: https://pypi.org/project/pip-run/
.. _cchardet: https://pypi.org/project/cchardet/
.. _polib: https://pypi.org/project/polib/
.. _hatchling: https://pypi.org/project/hatchling/
.. _hatch-vcs: https://pypi.org/project/hatch-vcs/
.. _venv: https://docs.python.org/3/library/venv.html#creating-virtual-environments
Setup with pip(x)
2014-04-24 17:42:50 +00:00
------------------
pip_ or pipx_ can be used to install LinkChecker on the local system.
To install the latest release from PyPI:
``pip3 install linkchecker``
or:
``pipx install linkchecker``
There is no need to wait for releases, every update to LinkChecker gets a unique
version number and is subjected to the test suite.
You can easily install the latest source from the LinkChecker GitHub repository.
First, if you want application translations:
``pip3 install polib``
Then:
``pip3 install https://github.com/linkchecker/linkchecker/archive/master.tar.gz``
2020-08-23 16:24:09 +00:00
.. _pip: https://pypi.org/project/pip/
2009-03-11 22:29:50 +00:00
.. _pipx: https://pypi.org/project/pipx/
2011-04-14 10:21:37 +00:00
Setup for Windows
-----------------
Python from the Microsoft Store does include pip_, but installing
within Windows Subsystem for Linux (WSL) is the preferred option:
https://docs.microsoft.com/en-us/windows/python/beginners
2011-04-14 10:21:37 +00:00
Setup for macOS
2011-04-14 10:21:37 +00:00
------------------
Python from Homebrew includes pip_. Otherwise ``python3 -m ensurepip --upgrade`` can be
used to install pip_ (untested):
2021-11-22 19:30:33 +00:00
https://pip.pypa.io/en/stable/installation/
2011-04-14 10:21:37 +00:00
2011-07-25 17:44:12 +00:00
Setup for GNU/Linux
-------------------
2023-08-28 18:32:28 +00:00
On major Linux distributions (Debian, Gentoo, Fedora, Ubuntu),
the ``linkchecker`` package is available for installation.
To install the latest LinkChecker pip_ will be available, often as a package
e.g. ``python3-pip``, a pipx_ package may also be found e.g. ``pipx``.
2011-07-25 17:44:12 +00:00
You may wish to install your distribution's copies of LinkChecker's dependencies
before using pip to install LinkChecker. e.g. for Debian/Ubuntu:
``apt install python3-bs4 python3-dnspython python3-requests``
If those packages are too old pip will install newer versions.
To use the dependencies from your distribution if installing LinkChecker with pipx:
2023-08-28 18:32:28 +00:00
``pipx install --system-site-packages linkchecker``
2011-07-25 17:44:12 +00:00
Manual setup for Unix systems
-----------------------------
2011-04-14 10:21:37 +00:00
First, install the required software.
2009-03-11 22:29:50 +00:00
1. Python hatchling package from https://pypi.org/project/hatchling/
2. Python hatch-vcs package from https://pypi.org/project/hatch-vcs/
2009-03-11 22:29:50 +00:00
3. Python Requests package from https://pypi.org/project/requests/
2009-03-11 22:29:50 +00:00
4. Python Beautiful Soup package from https://pypi.org/project/beautifulsoup4/
5. Python dnspython package from https://pypi.org/project/dnspython/
6. *Optional, build time only, for translations:*
2022-12-05 19:22:35 +00:00
Python polib package from https://pypi.org/project/polib/
7. *Optional, for bash-completion:*
2022-12-05 19:22:35 +00:00
Python argcomplete package from https://pypi.org/project/argcomplete/
2009-03-11 22:29:50 +00:00
8. *Optional, for displaying country codes:*
2022-12-05 19:22:35 +00:00
Python GeoIP package from https://pypi.org/project/GeoIP/
2009-03-11 22:29:50 +00:00
2022-12-05 19:22:35 +00:00
9. *Optional, for reading PDF files:*
2022-12-05 19:22:35 +00:00
Python pdfminer.six package from https://pypi.org/project/pdfminer.six/
2022-12-05 19:22:35 +00:00
10. *Optional, used for Virus checking:*
ClamAv from https://www.clamav.net/
2009-03-11 22:29:50 +00:00
2022-12-05 19:22:35 +00:00
11. *Optional, to run the WSGI web interface:*
Apache from https://httpd.apache.org/
mod_wsgi from https://pypi.org/project/mod-wsgi/
2009-03-11 22:29:50 +00:00
Note for developers: if you want to regenerate the po/linkchecker.pot template
from the source files, you will need xgettext with Python support. This is
available in gettext >= 0.12.
2009-03-11 22:29:50 +00:00
Clone the LinkChecker repository:
``git clone https://github.com/linkchecker/linkchecker.git``
``cd linkchecker``
Build the distribution wheel:
``hatchling build``
Now install the application from the wheel:
``pip install --no-index --user dist/LinkChecker-<version>-py3-none-any.whl``
Note that you may have to adjust your PATH and PYTHONPATH environment variables,
eg. by adding the commands ``export PYTHONPATH=$HOME/lib/python`` and
``export PATH=$PATH:$HOME/bin`` to your shell configuration file.
For more information look at the `Modifying Python's search path`_
documentation.
.. _Modifying Python's search path:
https://docs.python.org/3/install/#inst-search-path
2009-03-11 22:29:50 +00:00
After installation
------------------
LinkChecker is now installed. Have fun!
WSGI web interface
2009-03-11 22:29:50 +00:00
-----------------------
The included WSGI script can run LinkChecker with a nice graphical web
2009-03-11 22:29:50 +00:00
interface.
You can use and adjust the example HTML files in the lconline directory
to run the script.
2011-07-25 19:37:35 +00:00
1. Note that running LinkChecker requires CPU and memory resources.
Allowing a WSGI script to execute such a program for possibly a
2009-03-11 22:29:50 +00:00
large number of users might deplete those resources.
Be sure to only allow access from trusted sites to this script.
2. Copy the script lc.wsgi in the WSGI directory.
2009-03-11 22:29:50 +00:00
3. Adjust the "action=..." parameter in lconline/lc_cgi.html
to point to your WSGI script.
2009-03-11 22:29:50 +00:00
4. If you use Apache, copy config/linkchecker.apache2.conf
into your Apache configuration directory (eg. /etc/apache2/conf.d)
and enable it.
5. Load the lconline/index.html file, enter an URL and click on the
2010-07-29 19:04:58 +00:00
check button.
2009-03-11 22:29:50 +00:00
6. If something goes wrong, check the following:
2009-03-11 22:29:50 +00:00
a) look in the error log of your web server
b) be sure that you have enabled WSGI support in your web server,
for example by installing mod_wsgi for Apache
c) be sure that you have enabled the negotiation and versioning
modules for Apache:
a2enmod version
a2enmod negotiation