Installing H@H on Debian: Difference between revisions

From EHWiki
Jump to navigationJump to search
m Make the H@Home execute command more CP friendly
Updated to latest Java and H@H version.
Line 32: Line 32:


Download the JRE can be with the following command:
Download the JRE can be with the following command:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jre-7u51-linux-x64.tar.gz"</FONT></pre>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "https://download.oracle.com/otn-pub/java/jdk/7u67-b01/jre-7u67-linux-x64.tar.gz"</FONT></pre>


Create directory for JVM in /opt:
Create directory for JVM in /opt:
Line 38: Line 38:


Unpack the downloaded archive in /opt:
Unpack the downloaded archive in /opt:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D"># tar -zxf <FONT COLOR="35A4D6">jre-7u51-linux-x64.tar.gz</FONT> -C /opt/java-oracle</FONT></pre>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D"># tar -zxf <FONT COLOR="35A4D6">jre-7u67-linux-x64.tar.gz</FONT> -C /opt/java-oracle</FONT></pre>


Set our JVM to be used as the default Java on the system:
Set our JVM to be used as the default Java on the system:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ Java_Home=/opt/java-oracle/<FONT COLOR="35A4D6">jre1.7.0_51</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ Java_Home=/opt/java-oracle/<FONT COLOR="35A4D6">jre1.7.0_67</FONT>
# update-alternatives --install /usr/bin/java java ${Java_Home%*/}/bin/java 20000
# update-alternatives --install /usr/bin/java java ${Java_Home%*/}/bin/java 20000
# update-alternatives --install /usr/bin/javac javac ${Java_Home%*/}/bin/javac 20000
# update-alternatives --install /usr/bin/javac javac ${Java_Home%*/}/bin/javac 20000
Line 48: Line 48:
Verify (or set) JVM to be used as a default Java on the system:
Verify (or set) JVM to be used as a default Java on the system:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D"># update-alternatives --config java
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D"># update-alternatives --config java
<FONT COLOR="C94649">There is only one alternative in link group java (providing /usr/bin/java): /opt/java-oracle/jre1.7.0_51/bin/java
<FONT COLOR="C94649">There is only one alternative in link group java (providing /usr/bin/java): /opt/java-oracle/jre1.7.0_67/bin/java
Nothing to configure.</FONT></FONT></pre>
Nothing to configure.</FONT></FONT></pre>


Verify Java version:
Verify Java version:
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ java -version
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ java -version
<FONT COLOR="C94649">java version "1.7.0_51"
<FONT COLOR="C94649">java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)</FONT></FONT></pre>
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)</FONT></FONT></pre>


==Installing H@H==
==Installing H@H==
Line 67: Line 67:


Download H@H (check for the latest version [http://g.e-hentai.org/hentaiathome.php here]):
Download H@H (check for the latest version [http://g.e-hentai.org/hentaiathome.php here]):
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ wget http://hentaiathome.net/get/HentaiAtHome_1.2.0.zip</FONT></pre>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ wget http://hentaiathome.net/get/HentaiAtHome_1.2.1.zip</FONT></pre>


Unzip the downloaded archive (install unzip if you haven't yet):
Unzip the downloaded archive (install unzip if you haven't yet):
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ unzip HentaiAtHome_1.2.0.zip -d <FONT COLOR="35A4D6">hath/</FONT></FONT></pre>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">$ unzip HentaiAtHome_1.2.1.zip -d <FONT COLOR="35A4D6">hath/</FONT></FONT></pre>


Well done, let's launch it!
Well done, let's launch it!

Revision as of 02:08, 17 August 2014

Requirements

  • Being able to use Google.
  • Basic Linux knowledge.
  • A running Debian GNU/Linux server.
  • PuTTY or any other SSH program to connect to your server. This allows for copying/pasting of commands.


A couple things to be aware of before starting

  • Linux IS case sensitive on file names. Therefore, it is best to use lower case names everywhere to make it easier for yourself.
  • Commands you should type are given in Green;
  • Output from the command prompt is given in Red;
  • Text in commands that you'll probably need to change is given in Blue.
  • Commands starting with $ are to be run as current user, those starting with # - as root (using su/sudo).
  • This manual is based on a virtual server (VPS/VDS). The use of a physical server, home PC or any program other than VMware to virtualize your server may require doing some things differently.

Installing Java

To run the H@H server you will have to have Java installed on the server.

Now select Java package on official download page, accept license and copy download link depending on your OS (32-bit/64-bit).

For our case JDK isn't needed. If you need some monitoring tools (and know how to use them) - pick Server JRE. Otherwise, your choice is JRE.


Download the JRE can be with the following command:

$ wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "https://download.oracle.com/otn-pub/java/jdk/7u67-b01/jre-7u67-linux-x64.tar.gz"

Create directory for JVM in /opt:

# mkdir /opt/java-oracle

Unpack the downloaded archive in /opt:

# tar -zxf jre-7u67-linux-x64.tar.gz -C /opt/java-oracle

Set our JVM to be used as the default Java on the system:

$ Java_Home=/opt/java-oracle/jre1.7.0_67
# update-alternatives --install /usr/bin/java java ${Java_Home%*/}/bin/java 20000
# update-alternatives --install /usr/bin/javac javac ${Java_Home%*/}/bin/javac 20000
# update-alternatives --install /usr/bin/javaws javaws ${Java_Home%*/}/bin/javaws 20000

Verify (or set) JVM to be used as a default Java on the system:

# update-alternatives --config java
There is only one alternative in link group java (providing /usr/bin/java): /opt/java-oracle/jre1.7.0_67/bin/java
Nothing to configure.

Verify Java version:

$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

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 http://hentaiathome.net/get/HentaiAtHome_1.2.1.zip

Unzip the downloaded archive (install unzip if you haven't yet):

$ unzip HentaiAtHome_1.2.1.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.

Run H@H as service

Now, finally, we've got our H@H. But to start it manually every single time is quite a bother.

Here's the init script to make work with H@H more comfortable.


Download the script:

$ wget https://github.com/Yukariin/hath-scripts/raw/master/hentaiathome -O hentaiathome

If you haven't created new user for H@H - edit presented script and replace USER and DIR variables to your correct:

$ nano hentaiathome

Copy script into /etc/init.d:

# cp hentaiathome /etc/init.d/

Fix chmod:

# chmod 755 /etc/init.d/hentaiathome

Stop H@H if it already running and start is as a service:

# /etc/init.d/hentaiathome start

And check if it is working properly:

# /etc/init.d/hentaiathome status

Or by using top/htop. You can also see the server status on your H@H page.


Now let's make H@H auto start:

# update-rc.d hentaiathome defaults

So if your server will reboot, H@H will start automatically right after boot.

You can start/stop/restart H@H as a simple service.


Also you can get systemd service for H@H here

See also