User:Bipface: Difference between revisions

From EHWiki
Jump to navigationJump to search
Bipface (talk | contribs)
Bipface (talk | contribs)
Line 59: Line 59:
Next, run:
Next, run:
<pre># apt show default-jre-headless</pre>
<pre># apt show default-jre-headless</pre>
You should expect to find a line in the output such as <code>Depends: openjdk-8-jre-headless, java-common</code>. 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 [[#Prerequesites]] section.
You should expect to find a line in the output such as <code>Depends: openjdk-8-jre-headless, java-common</code>. 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 by running:
Install the JRE by running:

Revision as of 13:11, 2 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.
  • An open port through which H@H can accept connections from the internet.
    You may need to choose a port number greater than 1023 to avoid having to run the H@H 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 wget or curl, to download the H@H software.
  • A zip-file extractor such as unzip.
  • A text editor such as nano or vi.

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 an appropriate 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.

Next, run:

# 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 by running:

# apt install default-jre-headless

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

https://<ip>:<port>/robots.txt systemctl status hath

See also