User:Bipface: Difference between revisions
| Line 24: | Line 24: | ||
* A zip-file extractor such as <code>unzip</code>. | * A zip-file extractor such as <code>unzip</code>. | ||
* A text editor such as <code>nano</code> or <code>vi</code>. | |||
On some distributions, such as ''Minimal Ubuntu'', standard command-line tools might not be present by default. Use <code>apt</code> to install these packages as needed. | On some distributions, such as ''Minimal Ubuntu'', standard command-line tools might not be present by default. Use <code>apt</code> to install these packages as needed. | ||
Revision as of 12:19, 4 March 2020
(draft)
Prerequisites
- Basic familiarity with Linux.
- A Linux server running Debian version 9 (Stretch) or newer, or Ubuntu version 16 (Xenial Xerus) or newer.
To use earlier versions you will need to determine how to install a Java 8 runtime, which may not be a straightforward process and is beyond the scope of this guide.
- Root access to your server (i.e.
su/sudo).
- PuTTY or any other SSH program to connect to your server. This allows for copying/pasting of commands.
- One or more 'active' Hentai@Home Clients on your account.
- An open port through which the client can accept connections from the internet, as explained in the minimum requirements section.
In particular, you may need to choose a port number greater than 1023 to avoid having to run the client as root.
- This guide assumes a server-style environment, typical of VPS/cloud-hosted systems. Installation on desktop or IoT systems, for example, may require doing some things differently.
Optional Tools
To perform the installation, you may also require the following:
- A command-line HTTP client such as
wgetorcurl.
- A zip-file extractor such as
unzip.
- A text editor such as
nanoorvi.
On some distributions, such as Minimal Ubuntu, standard command-line tools might not be present by default. Use apt to install these packages as needed.
Take Note
- Linux is case-sensitive with file names. Therefore, it is best to use lowercase names everywhere to make it easier for yourself.
- Commands starting with $ are to be run as current user, those starting with # as root.
- Before installing packages, refresh the package manager by running
# apt update.
- H@H 1.6.0 and above uses SSL certificates. For them to work properly, you need the ntp package (it syncs the server's date and time). It is normally installed by default, but package updates may make it fail.
Overview
At a glance, the steps to install H@H are as follows, with further details in the subsequent sections:
- Install a Java version 8 (or newer) runtime environment.
- Obtain and configure the latest H@H client software.
- Define a service (systemd 'unit' file) to run it.
Installing Java
Start by checking whether a Java runtime is already available by running:
$ java -version
A result such as openjdk version "1.8.0_242", where the version number is 1.8 or greater, indicates that your server has a suitable Java runtime and you can skip to the next section.
If you see a result such as java: command not found, no Java runtime is installed yet.
Examine the default JRE package:
# apt show default-jre-headless
You should expect to find a line in the output such as Depends: openjdk-8-jre-headless, java-common. If openjdk-7 or lower is listed instead, your OS version may be too old to install a Java 8 runtime by conventional means — refer to the Prerequisites section.
Install the JRE:
# apt install default-jre-headless
If you're planning to use H@H in GUI mode at any point, you should instead install the package default-jre (without the -headless suffix). Otherwise, the headless package will suffice.
Once complete, run $ java -version again to verify the result.
Preparing the H@H Client
It is recommended to create a dedicated service account to run the H@H client.
This is achieved with the command:
# adduser hath
Login as the newly created user, then download and extract the H@H client software:
(Replace VERSION with the version number of the latest release, which can be found on the Hentai@Home Clients page)
# login hath $ wget 'https://repo.e-hentai.org/hath/HentaiAtHome_VERSION.zip' $ unzip HentaiAtHome_VERSION.zip
Launch the client by running:
$ java -jar HentaiAtHome.jar
You should be prompted to enter your Client ID and Client Key, which can be found on the Hentai@Home Clients page.
Once the client has successfully authenticated with the server, press ctrl+C to quit the client, then proceed to the next section.
Defining the H@H Service
Using your preferred text editor (such as nano), create a new unit file to define the service:
# nano /etc/systemd/system/hath.service
Insert the following text and save the file:
[Unit] Description=Hentai@Home After=local-fs.target remote-fs.target network.target [Service] Type=simple User=hath WorkingDirectory=/home/hath SuccessExitStatus=143 ExecStart=/usr/bin/java -jar HentaiAtHome.jar Restart=on-failure [Install] WantedBy=multi-user.target
Ensure the new service is loaded by running:
# systemctl daemon-reload
Now start the service:
# systemctl start hath
Installing H@H
For more security let's create new user for H@H:
# adduser hath
Now login as the new user and create a directory for H@H client:
# login hath $ mkdir hath
Download H@H (check for the latest version here):
$ wget https://repo.e-hentai.org/hath/HentaiAtHome_1.4.2.zip
Unzip the downloaded archive (install unzip if you haven't yet):
$ unzip HentaiAtHome_1.4.2.zip -d hath/
Well done, let's launch it!
$ cd hath $ java -jar HentaiAtHome.jar
You will be prompted for your client ID and Password which you can find on your H@H page
You will need to configure your client settings on the above page before you get your client password. If you have not applied to run a H@H client yet, you will have to do so first.
To stop the server, press "Ctrl+C" and wait for a couple seconds.
Testing and Monitoring
(todo)
https://<ip>:<port>/robots.txt
systemctl status hath