0
Answered

Help How to for ubuntu 14 headless?

Yukaputz Mike 9 years ago updated by Gamal Farag Abdelnaser 7 years ago 21

Does anyone have a comprehensive write up for setting up ubooquity on a headless ubuntu server 14.04 Or perhaps help me fill in the blanks? I'm pulling my hair out with how to configure, nix isn't my strongest suit but this is the last piece I need to complete a full media server for my kids so they stop watching youtube!


sudo apt-get install openjdk-7-jre-headless
sudo mkdir /etc/opt/ubooquity
cd /etc/opt/ubooquity
sudo wget http://vaemendis.net/ubooquity/service/download.php -O ubooquity.zip
sudo apt-get install unzip
unzip ubooquity.zip -d ubooquity
wget http://vaemendis.net/ubooquity/downloads/scripts/ubooquity.sh
sudo apt-get install dos2unix -y
dos2unix ubooquity.sh
sudo chmod u+x ubooquity.sh
./ubooquity.sh start


Then I went and did the below and it says ubooquity starts but the page displays nothing.

sudo chown root /etc/init.d/ubooquityd
sudo chgrp root /etc/init.d/ubooquityd
sudo chmod 755 /etc/init.d/ubooquityd
sudo update-rc.d /etc/init.d/ubooquityd defaults
sudo update-rc.d ubooquityd defaults
sudo service ubooquityd stop
sudo nano /etc/init.d/ubooquityd

+1
Under review

I think you should start by trying to run Ubooquity manually and see how it goes.

Just put the jar file in a dedicated (writable) directory and run:


java -jar Ubooquity.jar -headless

Once you have it running and you have successfully accessed a few shared files, then you can try setup something more permanent.

Hi Mike. Tom is right. First you need to make sure that Ubooquity.jar actually runs on your system. Here is what I suggest:


#Make a directory called "download" in your home directory.
mkdir /home/download
#Go to the new download directory.
cd /home download
#Download the Ubooquity archive and save it as ubooquity.zip
wget <a href="http://vaemendis.net/ubooquity/service/download.php">http://vaemendis.net/ubooquity/service/download.php</a> -O ubooquity.zip
#Unarchive the contents of the archive to a temporary directory from where we'll try to run the program.
unzip ubooquity.zip -d ubooquity
#Go in to the recently created ubooquity folder.
cd ubooquity
#Try to run the program!
java -jar Ubooquity.jar -headless -webadmin

Enter the IP address of the computer you started ubooquity on followed with :2202 (192.168.1.3:2202). Does it show the black Ubooquity screen?

+1

Yes, I can get ubooquity to start using the jar method. All of my content is visible. How do I get it to start with the server at start up?

I'm installing Ubuntu 14.04.3 Server just now inside VirtualBox so I can make sure I give you the right location to put the start up script. I'll get back to you in a few minutes. :)

I'm glad the program starts, Mike. We'll use upstart to start Ubooquity when your server starts.

  1. Make sure upstart is installed with apt-get install upstart
  2. Create the upstart configuration file with sudo vi /etc/init/ubooquity.conf
  3. You should be in a program called vi. This lets you edit files. Press the letter i on your keyboard to enter --INSERT-- mode and type the following in to the file:
    start on started httpd-user
    stop on runlevel [06]
    exec java -Dfile.encoding=UTF-8 -jar /home/download/uooquity/Ubooquity.jar -port 2202 -webadmin -headless
        
  4. See where it reads "/home/download/ubooquity/" ? That's where you unzipped ubooquity.jar. If you put it in a different directory change that line to where you placed ubooquity.jar.
  5. Press escape to leave --INSERT-- mode then hold LEFT-SHIFT on your keyboard and press the letter z twice. Shift+z+z should save and close the configuration file.
  6. Restart your computer.
  7. Once you're back type ps aux | grep uboo. This should show you a list of the processes with 'uboo' in their name. This is what I see when I do that:

One of those processes should be Ubooquity.jar. Let me know if you see that process running or not. If it's running you'll be able to connect to your server through a browser using the IP address appended with the port :2202.


If you ever want to manually start or stop ubooquity you can use a simple command instead of restarting your server! The commands are sudo start ubooquity and sudo stop ubooquity.

+1

ok, so my conf is here


exec java -Dfile.encoding=UTF-8 -jar /etc/opt/uooquity/Ubooquity.jar
-port 2202 -webadmin -headless


Do I need to change permissions on this directory because I am getting an error displaying the page and grep show the service up.

yukaputz 2741 0.0 0.0 11748 2304 pts/0 S+ 14:40 0:00 grep --color=auto uboo

The "yukaputz 2741 0.0 0.0 11748 2304 pts/0 S+ 14:40 0:00 grep --color=auto uboo" line you gave is the process that is looking for other processes :) If that is the only line you see then Ubooquity is not running.


If "exec java -Dfile.encoding=UTF-8 -jar /etc/opt/uooquity/Ubooquity.jar" is the line you want ran when your server starts try running it from the command line and seeing if it actually starts Ubooquity.


java -Dfile.encoding=UTF-8 -jar /etc/opt/uooquity/Ubooquity.jar


If it doesn't start Ubooquity then maybe the path you gave (/etc/opt/ubooquity) is wrong.


If it does start Ubooquity then make sure you have the

start on started httpd-user
stop on runlevel [06]

lines at the top of your ubooquity.conf file.

+1

Ok, I did have an issue with the path in the conf file and I fixed that. Rebooted. Still no auto loading. Thankyou so much for your help.


Grep


yukaputz@media-1:~$ ps aux | grep uboo
yukaputz 1452 0.0 0.0 11748 2280 pts/0 S+ 18:33 0:00 grep --color=auto uboo
yukaputz@media-1:~$


Here is the current conf file.


start on started httpd-user
stop on runlevel [06]
exec java -Dfile.encoding=UTF-8 -jar /etc/opt/ubooquity/Ubooquity.jar
-port 2202 -webadmin -headless


My current install path


yukaputz@media-1:/etc/opt$ cd ubooquity/
yukaputz@media-1:/etc/opt/ubooquity$ ls
cache logs preferences.xml themes ubooquity-4.h2.db Ubooquity.jar ubooquity.sh webadmin.cred
yukaputz@media-1:/etc/opt/ubooquity$

When starting Ubooquity from java it executes except this last time it gave a bunch of errors.


yukaputz@media-1:/etc/opt/ubooquity$ java -Dfile.encoding=UTF-8 -jar /etc/opt/ubooquity/Ubooquity.jar
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Running with the following parameters - headless: false, port: -1, webadmin: false, host: null, debug: false, execdir: /etc/opt/ubooquity
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - #############################
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - # Starting Ubooquity #
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - #############################
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Java version: 1.7.0_95
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Java vendor: Oracle Corporation
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Max heap size available: 880 MB
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - OS name: Linux
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - OS version: 3.19.0-49-generic
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - OS architecture: amd64
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Loading local version info
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Ubooquity 1.8.2 built on 2015-08-23 at 16:10
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Creating application folders
20160208 18:38:09 [main] INFO com.ubooquity.Ubooquity - Loading preferences
20160208 18:38:10 [main] INFO com.ubooquity.c - Starting internal server...
20160208 18:38:10 [Scanner thread] ERROR com.ubooquity.data.database.d - Error while creating/updating generic param in database: FeedingHints/true,true,false,false,false
org.h2.jdbc.JdbcSQLException: The database is read only; SQL statement:
merge into genericparam(paramkey, paramvalue)key(paramkey) values(?, ?) [90097-187]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) ~[h2-1.4.187.jar.6995477047527404462.tmp:1.4.187]

Just in case you have a new line in your "exec" sentence: This whole thing needs to be on a single line in the .conf file.

exec java -Dfile.encoding=UTF-8 -jar /etc/opt/ubooquity/Ubooquity.jar -port 2202 -webadmin -headless


The error you got when starting Ubooquity looks to be a permissions error. Perhaps /etc/opt is too tight. Try moving the program to /home/yukaputz/ubooquity/Ubooquity.jar


I know for sure that you will be able to run things from /home/yukaputz.


If you move your ubooquity folder to /home also update the /etc/init/ubooquity.conf file so you have the correct path.


After moving the folder to home paste this in your console and tell me what it does:


rm -f /home/yukaputz/ubooquity/ubooquity-4.h2.db && java -jar /home/yukaputz/ubooquity/Ubooquity.jar -webadmin

+1

How frustrating. So I started over. Deleted everything.


Setup ubooquity in a new folder in home.

yukaputz@media-1:~/projects/ubooquity$ ls
cache fonts logs preferences.xml themes ubooquity-4.h2.db Ubooquity.jar ubooquity.zip webadmin.cred
yukaputz@media-1:~/projects/ubooquity$


Tested it by running


java -Dfile.encoding=UTF-8 -jar /home/yukaputz/projects/ubooquity/Ubooquity.jar


Created the new conf


yukaputz@media-1:/etc/init$ more ubooquity.conf
start on started httpd-user
stop on runlevel [06]
exec java -Dfile.encoding=UTF-8 -jar /home/yukaputz/projects/ubooquity/Ubooquity.jar -port 2202 -webadmin -headless
yukaputz@media-1:/etc/init$


Rebooted. No Joy. ...sigh

yukaputz@media-1:~/projects/ubooquity$ ps aux | grep uboo
yukaputz 2705 0.0 0.0 11748 2296 pts/2 S+ 13:42 0:00 grep --color=auto uboo
yukaputz@media-1:~/projects/ubooquity$


Yuka, I'm replicating what you did.


  1. Setup ubooquity in a new folder in home. Done. ( /home/yukaputz/projects/ubooquity )
  2. Tested the .jar. Done. It starts Ubooquity. ( java -Dfile.encoding=UTF-8 -jar /home/yukaputz/projects/ubooquity/Ubooquity.jar )
  3. Created the new configuration file. Mike, your .conf file was pointing to the wrong place! I fixed it to point to /home/yukaputz/projects/ubooquity.

Okay, I found out that for Ubuntu server 14.04 there are some tweaks that need to be done for the .conf file :)

Here is the complete .conf that worked for me after a reboot!


description "Ubooquity Server"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 5

exec java -Dfile.encoding=UTF-8 -jar /home/yukaputz/projects/ubooquity/Ubooquity.jar -port 2202 -webadmin -headless



It works now. You are so close. All you have to do is update your .conf to match what I pasted above. Use ps -ef | grep uboo after a sudo reboot and tell me if it works.


WOOOOOTTT!!!! MATT YOU ROCK! That did it. ......so.....ya know anything about getting the opensource version of minecraft running? :-) The kids are askin not me. LOL


Start minetest server on Ubuntu server 14.04.3

  1. Take a note of the IP address of your server with ifconfig | grep "inet addr"

    In this example my Ubuntu server has the IP address 192.168.56.101 (127.0.0.1 just means "itself").
  2. Install the minetest server with sudo apt-get install minetest-server
  3. Start the minetest server with minetestserver

Connect to the minetest server

  1. Download the minetest game to your kids' computers.
  2. Start the game.
  3. From the main menu choose the "Client" tab.
  4. In the Address field to the right enter the IP address of your Ubuntu server then click "Connect".
+1

All hail the Matt! :-)

@Yukaputz Mike,

If i were you, i would make a seperate document and put your own tutorial of how to get those things to work. SO with other words, what you have learned just now, put them in a document for in the future. In the future i am more then sure you are going to put for example Ubuntu 16.04 on your server.

I have been using Linux Ubuntu since 2008 on Desktop as well as Server and i can guarantee you, you will forget many steps if you do not make your own tutorial. Been there done..that ;). Learn from MY mistakes, don't make the same ones be wiser :P.

+1

Thanks for the tip, Think. Tom, the site owner, has recently added a wiki. Putting this tutorial in there is in my todo list :)

Sorry to jump in at the end of this conversation. I have followed info from this thread plus a guide over at htpcbeginner to get Ubooquity installed and starting with on my headless DigitalOcean VPS. Everything looks good but I can't connect from remote connections. Is there a variable (e.g. -host 0.0.0.0) that can be added to the start up command to allow remote connections?


I managed to set up an SSH tunnel so I could at least finalise setup / secure the server. But I would like access directly, especially as I am running DDNS on the VPS.


Cheers

Unless you use the "--host" command line parameter ("-host" works too), Ubooquity listens to everything coming to your server on the specified port. There is no need to enable anything for remote connections, they are allowed by default.


I'm afraid your problem is somewhere else on the network.

Right. I wonder what the problem is then... I did notice that in netstat it was listening on ipv6. I don't know much about ipv6 but I am pretty sure on my NAS it's not doing that.


I guess I'll keep poking around, cheers!

@Matthew Sanders  can you pls help guide me on making the upstart file for centos 7 ??