Installing H@H on Ubuntu: Difference between revisions

From EHWiki
Jump to navigationJump to search
Melkeku (talk | contribs)
Installing H@H: its on repo now, + updated version
 
(38 intermediate revisions by 9 users not shown)
Line 1: Line 1:
This page will tell you how to set up a Hentai@Home client using a Linux Ubuntu Server
This page will tell you how to set up a [[Hentai@Home]] client using a Linux Ubuntu Server


Before you start reading at all, to use this guide you should be “above average” interested in computers, having a little more than “standard” equipment is recommended! (meaning this guide is for advanced users)
Before you start reading at all, to use this guide you should be “above average” interested in computers, having a little more than “standard” equipment is recommended! (Meaning this guide is for advanced users)


== Requirements ==
==Requirements==
*Being able to search Google.


* Being able to search google
*Basic Linux knowledge is recommended.


* Basic linux knowledge is recommended (google helps a lot)
*A running Linux server (I used version 12.04) (for setting one up refer to: https://www.howtoforge.com/perfect-server-ubuntu-12.04-lts-apache2-bind-dovecot-ispconfig-3  page 1 and 2)


* A running linux server (I used version 12.04) (for setting one up refer to: http://www.howtoforge.com/perfect-server-ubuntu-12.04-lts-apache2-bind-dovecot-ispconfig-3  page 1 and 2)
*It is recommended to use PuTTY or any other SSH program to connect to your server, this allows the copying/pasting of commands to the server.


* I recommend using putty or any other SSH program to connect to your server, this way you can copy/paste commands to your server
*You have an “active” H@H client (https://e-hentai.org/hentaiathome.php) if not you will have to request this first.


* You have an “active” H@H server (http://g.e-hentai.org/hentaiathome.php) if not you will have to request this first.
A couple things to be aware of before starting:


*Linux IS case sensitive on file names. Therefore, best thing is to create everything with lower case names to make it easier for yourself.


A couple things you should be aware of before you start:
*Commands you should type is given in <FONT COLOR="1FD30D">Green</FONT>, output from the command prompt is given in <FONT COLOR="C94649">Red</FONT>. Text in commands that is marked in <FONT COLOR="35A4D6">Blue</FONT> is part of a command that typically you would have to change.
 
* Linux IS case sensitive on file names. Therefore, best thing is to create everything with lower case names to make it easier for yourself.
 
* Commands you should type is given in <FONT COLOR="1FD30D">Green</FONT>, output from the command promt is given in <FONT COLOR="C94649">Red</FONT>. Text in commands that is marked in <FONT COLOR="35A4D6">Blue</FONT> is part of a command that typically you would have to change.
 
* when i created this manual i used a virtual server, if you use a physical server or another program than VMware to virtualize your server you might have to do some things different.
 
 
== Configuring the network ==


*This manual was developed based on a virtual server. The use of a physical server or another program than VMware to virtualize your server may require doing some things differently.


==Configuring the Network==
First thing you would want to do with your server is setting a static IP address.  
First thing you would want to do with your server is setting a static IP address.  
Use this command
Use this command


<FONT COLOR="1FD30D">sudo nano /etc/network/interfaces</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo nano /etc/network/interfaces</FONT></pre>
the file that is opened should look something like this:
The file that is opened should look something like this:


<FONT COLOR="C94649">This file describes the network interfaces available on your system
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="C94649">This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# and how to activate them. For more information, see interfaces(5).
   
   
# The loopback network interface
# The loopback network interface
auto lo
auto lo
iface lo inet loopback
iface lo inet loopback
   
   
# The primary network interface
# The primary network interface
auto eth0
auto eth0
iface eth0 inet dhcp</FONT>
iface eth0 inet dhcp</FONT></pre>


Below where it says “# The primary network interface”
Below where it says “# The primary network interface”
   
   
Type in this information:
Type in this information:
<FONT COLOR="1FD30D">auto eth0
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">auto eth0
iface eth0 inet static
iface eth0 inet static
address <FONT COLOR="35A4D6">192.168.0.100</FONT>
address <FONT COLOR="35A4D6">192.168.0.100</FONT>
netmask <FONT COLOR="35A4D6">255.255.255.0</FONT>
netmask <FONT COLOR="35A4D6">255.255.255.0</FONT>
gateway <FONT COLOR="35A4D6">192.168.0.1</FONT>
gateway <FONT COLOR="35A4D6">192.168.0.1</FONT>
dns-nameservers <FONT COLOR="35A4D6">192.168.0.1</FONT></FONT>  
dns-nameservers <FONT COLOR="35A4D6">192.168.0.1</FONT></FONT></pre>


Change the IP addresses with what you is relevant for your network.
Change the IP addresses with what is relevant for your network.


When you have made the changes to the file press “ctrl+o” and press enter to save changes.
When you have made the changes to the file press “ctrl+o” and press enter to save changes.
Line 62: Line 57:
When you have exited the file, type this command to restart the network interface and activate the new configuration.
When you have exited the file, type this command to restart the network interface and activate the new configuration.


<FONT COLOR="1FD30D">sudo /etc/init.d/networking restart</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo /etc/init.d/networking restart</FONT></pre>


you can check and see if your IP has changed by typing:
You can check and see if your IP has changed by typing:
<FONT COLOR="1FD30D">ifconfig</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">ifconfig</FONT></pre>


you should see something like this:
You should see something like this:
<FONT COLOR="C94649">eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="C94649">eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
inet6 addr: ffff::fff:ffff:ffff:ffff/64 Scope:Link
inet6 addr: ffff::fff:ffff:ffff:ffff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 MB)  TX bytes:0 (0.0 GB)</FONT>
RX bytes:0 (0.0 MB)  TX bytes:0 (0.0 GB)</FONT></pre>


The second line is what is important.
The second line is what is important.


You can test and see if the network is working by pinging an internet server:
You can test and see if the network is working by pinging an internet server:
<FONT COLOR="1FD30D">ping google.com</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">ping google.com</FONT></pre>
If this returns an error try pinging:
If this returns an error try pinging:
<FONT COLOR="1FD30D">ping 8.8.8.8</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">ping 8.8.8.8</FONT></pre>
If this last one works and not the first, there is a problem with your DNS settings (refer to “dns-nameservers” that was typed in when you configured the network, this setting is typically the same as you gateway).
If this last one works and not the first, there is a problem with your DNS settings (refer to “dns-nameservers” that was typed in when you configured the network, this setting is typically the same as you gateway).


If none of them work there is no connection to internet. If this is the case you can try pinging your inside router(gateway) to check if you have network connection at all, if not check the IP you set for your server, make sure it's not in use by another computer and make sure you server is physically connected to the network.
If none of them work there is no connection to internet. If this is the case you can try pinging your inside router(gateway) to check if you have network connection at all, if not check the IP you set for your server, make sure it's not in use by another computer and make sure you server is physically connected to the network.


That’s it for setting up the network
That’s it for setting up the network.


P.S: Important thing to do when you have confirmed network connection on your server, run these commands to update you server with latest security patches.
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo apt-get update
sudo apt-get upgrade</FONT></pre>


PS: important thing to do when you have confirmed network connection on your server, run these commands to update you server with latest security patches.
==Installing Java (Pick 6 or 7)==
<FONT COLOR="1FD30D">sudo apt-get upgrade
sudo apt-get update</FONT>


===apt-get OpenJDK Installation===


== Installing Java ==
OpenJDK is a free and open source implementation of Sun's Java SE Platform. It is also the default Java software package included in Ubuntu Package archive.  
(source: http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/  rewritten by Melkeku)


It allows you to install Java through the usual apt-get command, and is the easiest way to install Java on your Ubuntu machine. This will install OpenJDK 6 on Ubuntu 12.04 and earlier and OpenJDK 7 on 12.10+.


To run the H@H server you will have to have java installed on the server.
Despite earlier reports, the latest H@H client works perfectly with OpenJDK.  


As far as i was told on the forums and as i installed you have to use Sun's(/Oracle's) Java. it will not work with other versions.
First, update the package index:


This is the trickiest part of the installation since you are not easily able to install this version of java on ubuntu from the "repositories"
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">sudo apt-get update</pre>


The tricky part here is getting the java installation file onto the server itself.
Then, check if Java has already been installed:
you have to accept the license agreement for downloading, which is hard when working from a command line... this is why you're not able to directly download it to the server…


So if you know an easy way of transferring files from another computer over to the server, go for it. I'll tell how I did it.
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">java -version</pre>


If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:


since I set up the server in a VMware environment I have the possibility to connect an .iso file to the server (just like a cd if you are running the server on a physical computer). There are most likely 100 other ways to do it. you could for example do it using TFTP (read about it here: http://manpages.ubuntu.com/manpages/hardy/man1/tftp.1.html).
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">sudo apt-get install default-jre</pre>


This will install the Java Runtime Environment (JRE). Finally, check if Java has been installed correctly:


I’m going to explain the “iso” way in this guide since it is what I used.
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">java -version</pre>


First of all we need to download the java file from a computer with a gui. Go to:
If properly installed, the expected output is:


http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
</pre>


accept the license agreement and download either the file named: jdk-6u32-linux-i586.bin (for 32 bit system(x86) OR jdk-6u32-linux-x64.bin (for 64 bit system(x64)
===Oracle Java 6 Installation===
(old source: http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/ rewritten by Melkeku and Fyxie)


you will be asked to log in, you will have to create an account (to download old version… I know it’s a pain…)
To run the H@H server you will have to have java installed on the server.
 
 
when you have downloaded the file, make it into an iso file. You can use a program called “imgburn” or another program able to do the same thing. (or you can burn the java file to a cd and insert it in the computer if you are running this installation on a physical computer)
 
 
When you have the iso file, mount it in the server through VMware.(or as a cd as stated above)


Go to the server console (or use putty(recommended) to connect to the servers IP address) and type the following command:
As far as I was told on the forums and as I installed you have to use Sun's(/Oracle's) Java. It will not work with other versions.
<FONT COLOR="1FD30D">ls –l /dev/cdrom</FONT>


You should get an output looking something like this:
<FONT COLOR="C94649">lrwxrwxrwx 1 root root 3 Jun  2 00:04 /dev/cdrom -> sr0</FONT>


The info we are after is the last part, in my case "sr0". If what you get is different change it in the next command as well.
First download the JDK can be with the following command.
(Official download is here https://www.oracle.com/technetwork/java/javase/downloads/index.html)


<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/6u32-b05/jdk-6u32-linux-x64.bin"</FONT></pre>


Now we have to mount the cdrom so we can access the files on the "cd". type:
Extract the (bin) file:
<FONT COLOR="1FD30D">sudo mount /dev/<FONT COLOR="35A4D6">sr0</FONT> /media/cdrom</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">./jdk-6u32-linux-x64.bin</FONT></pre>


to check if everything was successful type:
If you type «ls» you should now see 2 files:
<FONT COLOR="1FD30D">ls /media/cdrom</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="C94649">jdk1.6.0_32  jdk-6u32-linux-x64.bin</FONT></pre>
you should see the file names of what is located on the cd drive, in my case i see:
<FONT COLOR="C94649">jdk-6u32-linux-x64.bin</FONT>


first, transfer the file to a folder locally (change “username” with your actual username) (as 2 separate commands):
Now move the extracted file:
<FONT COLOR="1FD30D">sudo mkdir /home/<FONT COLOR="35A4D6">”username”</FONT>/java</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo mv jdk1.6.0_32 /usr/lib/jvm/</FONT></pre>
<FONT COLOR="1FD30D">sudo cp /media/cdrom/jdk-6u32-linux-x64.bin /home/<FONT COLOR="35A4D6">”username”</FONT>/java/</FONT>


go to the directory where the copied file is located:
Now type in these commands to “install” Java (as 3 separate commands)
<FONT COLOR="1FD30D">cd /home/<FONT COLOR="35A4D6">”username”</FONT>/java</FONT>


now, make the file we just copied executable (type "ls" to see the file name):
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
<FONT COLOR="1FD30D">chmod +x jdk-6u32-linux-x64.bin</FONT>
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1</FONT></pre>


extract the (bin) file:
Now tell the server that this java installation is the default one (as 3 separate commands):
<FONT COLOR="1FD30D">./jdk-6u32-linux-x64.bin</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws</FONT></pre>


if you type «ls» you should now see 2 files:
To verify the installation is complete type:
<FONT COLOR="C94649">jdk1.6.0_32  jdk-6u32-linux-x64.bin</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">java -version</FONT></pre>


now move the extracted file:
You should see this message:
<FONT COLOR="1FD30D">sudo mv jdk1.6.0_32 /usr/lib/jvm/</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="C94649">java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)</FONT></pre>


now type in these commands to “install” Java(as 3 separate commands)
===Oracle Java 7 Installation===
Note that 7 is said to have issues with the graphical client. 7 Should be fine for a headless machine.


<FONT COLOR="1FD30D">sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1</FONT>


Become root
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">su -</FONT></pre>


now tell the server that this java installation is the default one(as 3 separate commands):
Download and exract files
<FONT COLOR="1FD30D">sudo update-alternatives --config javac
(Official download is here https://www.oracle.com/technetwork/java/javase/downloads/index.html)
sudo update-alternatives --config java
<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/7u9-b05/jdk-7u9-linux-x64.tar.gz"
sudo update-alternatives --config javaws</FONT>
tar xvfo jdk-7u9-linux-x64.tar.gz</FONT></pre>




to verify the installation is complete type:
Move java files into their place
<FONT COLOR="1FD30D">java -version</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">mkdir /usr/lib/jvm
mv jdk1.7.0_09 /usr/lib/jvm/jdk1.7.0_09</FONT></pre>


you should see this message:
<FONT COLOR="C94649">java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)</FONT>


This should wrap it up for the java installation.
Set alternatives links
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_09/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_09/bin/javac" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_09/bin/javaws" 1</FONT></pre>


Now onto downloading and using the H@H program.


Config alternatives links
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javaws</FONT></pre>




== “Installing” H@H ==
Verify java version
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">java -version</FONT></pre>


Download Hentai at home (check what the newest version is here: http://g.e-hentai.org/hentaiathome.php)
(Expected output)
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="C94649">java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)</FONT></pre>


(when this is written, 1.0.9 is the current version)
==Installing H@H==
Download H@H (check the newest version in [https://e-hentai.org/hentaiathome.php here])


To download H@H first make a new directory for where you want to run the files from:
To download H@H first make a new directory for where you want to run the files from:
<FONT COLOR="1FD30D">sudo mkdir /home/”username”/hath</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo mkdir /home/”username”/hath</FONT>


<FONT COLOR="1FD30D">cd /home/”username”/hath</FONT>
<FONT COLOR="1FD30D">cd /home/”username”/hath</FONT></pre>
this creates a folder called “hath” in your home directory and moves you to it. now download the H@H program by typing:
This creates a folder called “hath” in your home directory and moves you to it. Now download the H@H program by typing:
<FONT COLOR="1FD30D">sudo wget hentaiathome.net/get/HentaiAtHome_1.0.9.zip</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo wget repo.e-hentai.org/hath/HentaiAtHome_1.6.1.zip
</FONT></pre>
This might take time depending on your network speed.
This might take time depending on your network speed.


When finished downloading you will have to install “unzip” to unzip the file. Type:
When finished downloading you will have to install “unzip” to unzip the file. Type:
<FONT COLOR="1FD30D">sudo apt-get install unzip</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo apt-get install unzip</FONT></pre>
 


Now unzip the file by typing:
Now unzip the file by typing:
<FONT COLOR="1FD30D">sudo unzip HentaiAtHome_1.0.9.zip</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo unzip HentaiAtHome_1.6.1.zip</FONT></pre>
If you type «ls» you should see all the files extracted from the zip file.
If you type «ls» you should see all the files extracted from the zip file.


Now, if everything went as planned before you can type:
Now, if everything went as planned before you can type:
<FONT COLOR="1FD30D">java –jar HentaiAtHome.jar</FONT>
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">java -jar HentaiAtHome.jar</FONT></pre>
And the server should start up.
And the server should start up.


You will be prompted for your client ID and Password which you can find on your H@H page:
You will be prompted for your client ID and Password which you can find on your H@H page:
http://g.e-hentai.org/hentaiathome.php
https://e-hentai.org/hentaiathome.php
 
You will need to configure the server settings on the above page before you get you 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.
 
If you restart the server or for some reason are not in the folder where the H@H program is located you can also start it by typing
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}"><FONT COLOR="1FD30D">sudo java -jar /home/<FONT COLOR="35A4D6">"username"</FONT>/hath/HentaiAtHome.jar</FONT></pre>


you will need to configure the server settings on the above page before you get you client password. if you have not applied to run a H@H client yet you will have to do so first.
If you want to start the server in the background so that you can access the console or close the console without closing the server together, use "nohup" and append a "&" at the end of the command:


<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">nohup java -jar /home/"username"/hath/HentaiAtHome.jar &</pre>


To stop the server press "ctrl+c" and wait for a couple seconds.
or


If you restart the server or for some reason are not in the folder where the H@H program is located you can also start it by typing
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">nohup java -jar HentaiAtHome.jar &</pre> when you are inside the directory where H@H client is located.
<FONT COLOR="1FD30D">sudo java -jar /home/<FONT COLOR="35A4D6">"username"</FONT>/hath/HentaiAtHome.jar</FONT>
 
If you want to close the background process, use the following command to identify the process ID (PID):
 
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">ps aux | grep -i hentai</pre>


== Troubleshooting ==
Result similar to the following will be returned:


If you are having trouble when downloading updates or when installing the unzip program, if the command prompt is stuck on ”[waiting for headers]” please refer to this page(it’s a common/known problem):
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">
http://askubuntu.com/questions/37753/how-can-i-get-apt-to-use-a-mirror-close-to-me-or-choose-a-faster-mirror
user@host:~# ps aux | grep -i hentai
user      xxxx  0.4  7.0 1366476 71976 ?      Sl  Jan15  39:09 java -jar HentaiAtHome.jar
user      yyyy  0.0  0.0  11744  932 pts/2    S+  16:35  0:00 grep --color=auto -i hentai
</pre>


where xxxx is the PID of the HentaiAtHome.jar. Execute the following command to kill the process:


As always check the H@H FAQ first! [[Technical_Issues#H.40H]]
<pre<includeonly></includeonly> style="overflow: auto;{{{style|}}}">sudo kill xxxx</pre>


==Troubleshooting==
If you are having trouble when downloading updates or when installing the unzip program, if the command prompt is stuck saying ”[waiting for headers]” please refer to this page (it's a common/known problem):
https://askubuntu.com/questions/37753/how-can-i-get-apt-to-use-a-mirror-close-to-me-or-choose-a-faster-mirror


for problems after starting the H@H program that are not explained in the FAQ make a forum post. http://forums.e-hentai.org/index.php?showforum=7
As always check the [[Technical_Issues#H.40H | H@H technical issues]] first!


For problems after starting the H@H program that are not explained in the FAQ make a forum post [https://forums.e-hentai.org/index.php?showforum=7 here].


for problems related to putty, Ubuntu or Java please use "insert favorite search engine here".
For problems related to putty, Ubuntu or Java please use a search engine.


<!-- will try to add "autostart/stop" function as well -->
==See also==
*[[Hentai@Home]]
*[https://forums.e-hentai.org/index.php?showtopic=19795&st=0&p=797807&#entry797807 Advanced Linux Installation]


----
[[Category:E-Hentai Galleries]]
will try to add "autostart/stop" function as well

Latest revision as of 19:19, 21 March 2021

This page will tell you how to set up a Hentai@Home client using a Linux Ubuntu Server

Before you start reading at all, to use this guide you should be “above average” interested in computers, having a little more than “standard” equipment is recommended! (Meaning this guide is for advanced users)

Requirements

  • Being able to search Google.
  • Basic Linux knowledge is recommended.
  • It is recommended to use PuTTY or any other SSH program to connect to your server, this allows the copying/pasting of commands to the server.

A couple things to be aware of before starting:

  • Linux IS case sensitive on file names. Therefore, best thing is to create everything with lower case names to make it easier for yourself.
  • Commands you should type is given in Green, output from the command prompt is given in Red. Text in commands that is marked in Blue is part of a command that typically you would have to change.
  • This manual was developed based on a virtual server. The use of a physical server or another program than VMware to virtualize your server may require doing some things differently.

Configuring the Network

First thing you would want to do with your server is setting a static IP address. Use this command

sudo nano /etc/network/interfaces

The file that is opened should look something like this:

This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet dhcp

Below where it says “# The primary network interface”

Type in this information:

auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1

Change the IP addresses with what is relevant for your network.

When you have made the changes to the file press “ctrl+o” and press enter to save changes. Then press “ctrl+x” to exit the text editor.

When you have exited the file, type this command to restart the network interface and activate the new configuration.

sudo /etc/init.d/networking restart

You can check and see if your IP has changed by typing:

ifconfig

You should see something like this:

eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00
inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
inet6 addr: ffff::fff:ffff:ffff:ffff/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 MB)  TX bytes:0 (0.0 GB)

The second line is what is important.

You can test and see if the network is working by pinging an internet server:

ping google.com

If this returns an error try pinging:

ping 8.8.8.8

If this last one works and not the first, there is a problem with your DNS settings (refer to “dns-nameservers” that was typed in when you configured the network, this setting is typically the same as you gateway).

If none of them work there is no connection to internet. If this is the case you can try pinging your inside router(gateway) to check if you have network connection at all, if not check the IP you set for your server, make sure it's not in use by another computer and make sure you server is physically connected to the network.

That’s it for setting up the network.

P.S: Important thing to do when you have confirmed network connection on your server, run these commands to update you server with latest security patches.

sudo apt-get update
sudo apt-get upgrade

Installing Java (Pick 6 or 7)

apt-get OpenJDK Installation

OpenJDK is a free and open source implementation of Sun's Java SE Platform. It is also the default Java software package included in Ubuntu Package archive.

It allows you to install Java through the usual apt-get command, and is the easiest way to install Java on your Ubuntu machine. This will install OpenJDK 6 on Ubuntu 12.04 and earlier and OpenJDK 7 on 12.10+.

Despite earlier reports, the latest H@H client works perfectly with OpenJDK.

First, update the package index:

sudo apt-get update

Then, check if Java has already been installed:

java -version

If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:

sudo apt-get install default-jre

This will install the Java Runtime Environment (JRE). Finally, check if Java has been installed correctly:

java -version

If properly installed, the expected output is:

java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

Oracle Java 6 Installation

(old source: http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/ rewritten by Melkeku and Fyxie)

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

As far as I was told on the forums and as I installed you have to use Sun's(/Oracle's) Java. It will not work with other versions.


First download the JDK can be with the following command. (Official download is here https://www.oracle.com/technetwork/java/javase/downloads/index.html)

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "https://download.oracle.com/otn-pub/java/jdk/6u32-b05/jdk-6u32-linux-x64.bin"

Extract the (bin) file:

./jdk-6u32-linux-x64.bin

If you type «ls» you should now see 2 files:

jdk1.6.0_32  jdk-6u32-linux-x64.bin

Now move the extracted file:

sudo mv jdk1.6.0_32 /usr/lib/jvm/

Now type in these commands to “install” Java (as 3 separate commands)

sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 1

Now tell the server that this java installation is the default one (as 3 separate commands):

sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws

To verify the installation is complete type:

java -version

You should see this message:

java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)

Oracle Java 7 Installation

Note that 7 is said to have issues with the graphical client. 7 Should be fine for a headless machine.


Become root

su -

Download and exract files (Official download is here https://www.oracle.com/technetwork/java/javase/downloads/index.html)

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


Move java files into their place

mkdir /usr/lib/jvm
mv jdk1.7.0_09 /usr/lib/jvm/jdk1.7.0_09


Set alternatives links

update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_09/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_09/bin/javac" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_09/bin/javaws" 1


Config alternatives links

update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javaws


Verify java version

java -version

(Expected output)

java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

Installing H@H

Download H@H (check the newest version in here)

To download H@H first make a new directory for where you want to run the files from:

sudo mkdir /home/”username”/hath

cd /home/”username”/hath

This creates a folder called “hath” in your home directory and moves you to it. Now download the H@H program by typing:

sudo wget repo.e-hentai.org/hath/HentaiAtHome_1.6.1.zip

This might take time depending on your network speed.

When finished downloading you will have to install “unzip” to unzip the file. Type:

sudo apt-get install unzip

Now unzip the file by typing:

sudo unzip HentaiAtHome_1.6.1.zip

If you type «ls» you should see all the files extracted from the zip file.

Now, if everything went as planned before you can type:

java -jar HentaiAtHome.jar

And the server should start up.

You will be prompted for your client ID and Password which you can find on your H@H page: https://e-hentai.org/hentaiathome.php

You will need to configure the server settings on the above page before you get you 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.

If you restart the server or for some reason are not in the folder where the H@H program is located you can also start it by typing

sudo java -jar /home/"username"/hath/HentaiAtHome.jar

If you want to start the server in the background so that you can access the console or close the console without closing the server together, use "nohup" and append a "&" at the end of the command:

nohup java -jar /home/"username"/hath/HentaiAtHome.jar &

or

nohup java -jar HentaiAtHome.jar &

when you are inside the directory where H@H client is located.

If you want to close the background process, use the following command to identify the process ID (PID):

ps aux | grep -i hentai

Result similar to the following will be returned:

user@host:~# ps aux | grep -i hentai
user      xxxx  0.4  7.0 1366476 71976 ?       Sl   Jan15  39:09 java -jar HentaiAtHome.jar
user      yyyy  0.0  0.0  11744   932 pts/2    S+   16:35   0:00 grep --color=auto -i hentai

where xxxx is the PID of the HentaiAtHome.jar. Execute the following command to kill the process:

sudo kill xxxx

Troubleshooting

If you are having trouble when downloading updates or when installing the unzip program, if the command prompt is stuck saying ”[waiting for headers]” please refer to this page (it's a common/known problem): https://askubuntu.com/questions/37753/how-can-i-get-apt-to-use-a-mirror-close-to-me-or-choose-a-faster-mirror

As always check the H@H technical issues first!

For problems after starting the H@H program that are not explained in the FAQ make a forum post here.

For problems related to putty, Ubuntu or Java please use a search engine.

See also