Install Java (open java works)
sudo apt-get install openjdk-8-jdk
If you forgot to get MySQL and Apache and stuff, you may also want to
grab the LAMP stack:
sudo apt-get install lamp-server^
don't forget the caret on the end of that command
Download ofbiz, and I'm assuming it went into your downloads folder
sudo -i
-you'll just be essentially root from here on
mv /home/userdownloadingofbiz/Downloads/apache-ofbiz-x.x.x.zip /
-change x.x.x with correct version number
mv /apache-ofbiz-x.x.x.zip /ofbiz
useradd -m ofbiz
chown -R ofbiz:ofbiz /ofbiz
#-----------------------------------------------------------------------
# MySQL -- Create DBs, grant everything to ofbiz user, and make OFBiz
# use it
#-----------------------------------------------------------------------
create database ofbiz;
create database ofbizolap;
create database ofbiztenant;
grant all on ofbiz.* to 'ofbiz'@localhost identified by 'g1t3rdun';
grant all on ofbizolap.* to 'ofbiz'@localhost identified by 'g1t3rdun';
grant all on ofbiztenant.* to 'ofbiz'@localhost identified by 'g1t3rdun';
Change D to M in build.gradle (line 401-ish -- we're going to stop using
derby and start using MySQL)
Forgot that this time around (4-15-17), and I appear to be using MySQL
anyway. But just in case, I changed it afterward to M.
Copied mysql-connector-java-5.1.41-bin.jar to /ofbiz/framework/entity,
after I grabbed it from the MySQL site. This version number will change
over time
Added:
runtime 'mysql:mysql-connector-java:5.1.41'
to build.gradle (line 149 in dependencies section)
#----------------------------------------------------------------------
# MAKE SURE colon is between java and the version
# A dash doesn't work, even though the filename has the dash...
#----------------------------------------------------------------------
Edit /ofbiz/framework/entity/config/entityengine.xml
Three groups of three lines refer to derby -- change them to mysql:
These used to say localderby, localderbyolap, and localderbytenant
Remember, there's three groups of these
#-----------------------------------------------------------------------
# This will get OFBiz running manually
#-----------------------------------------------------------------------
su - ofbiz
cd /ofbiz
./gradlew cleanAll loadDefault
./gradlew ofbiz
gradlew stands for gradle wrapper; if that's ever on Jeopardy, don't forget
#-----------------------------------------------------------------------
# This will run it as a daemon:
#-----------------------------------------------------------------------
cp /ofbiz/tools/rc.ofbiz.for.debian /etc/init.d/ofbiz
edit so that any gradlew command is preceeded by /ofbiz
(as in /ofbiz/gradlew ofbiz -- there's maybe a couple three spots)
-maybe if I added /ofbiz to the ofbiz user's path, I could do without this...
-I tried that. /ofbiz is now in ofbiz's path, and I can run gradlew, but
getting errors that there's no cleanAll or loadDefault. same command worked
fine when I first cd-ed to /ofbiz
-so screw it, just precede gradlew commands with /ofbiz/
chown ofbiz:ofbiz /etc/init.d/ofbiz
chmod u+x /etc/init.d/ofbiz
-There appears to be an error in that file. Line 77
echo_success
ought to be:
echo success
Space instead of underscore.
su - ofbiz
/etc/init.d/ofbiz start
If that works, then create a file called /etc/init.d/start_ofbiz that says:
#!/bin/bash
sudo -u ofbiz /etc/init.d/ofbiz start
and then get it to start at boot with:
sudo update-rc.d start_ofbiz defaults