Closed lutaylor closed 7 years ago
I got an error on something you didn't change but should be updated. Ghost script URL changes to http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-9.05.tar.gz
But the part where you added between JAVA and FITS I is really difficult to follow. The formatting looks like it may not be translating correctly. Would you mind looking at this?
Adds Fedora User and adds fedora environment variables to /etc/profile.d/fedora.sh
FEDORA_USER_TEST=`getent passwd $FEDORA_USER`
if [ "$FEDORA_USER_TEST" = "" ]; then
useradd -m -d $FEDORA_HOME -s /bin/false $FEDORA_USER
` Make environment variables match with what we set above:
echo -e 'export FEDORA_HOME=/usr/local/fedora\nexport CATALINA_HOME=/usr/local/fedora/tomcat\nexport CATALINA_PID="$CATALINA_HOME/catalina.pid"\nexport JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -Djavax.net.ssl.trustStore=/usr/local/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat"\nexport JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre\nexport FEDORA_USER=fedora' > /etc/profile.d/fedora.sh sed -i "s|JAVA_OPTS=\"-Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -Djavax.net.ssl.trustStore=/usr/local/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat\"|JAVA_OPTS=\"$JAVA_OPTS\"|g" /etc/profile.d/fedora.sh sed -i "s|FEDORA_HOME=\"/usr/local/fedora\"|FEDORA_HOME=\"$FEDORA_HOME\"|g" /etc/profile.d/fedora.sh sed -i "s|CATALINA_HOME=\"/usr/local/fedora/tomcat\"|CATALINA_HOME=\"$CATALINA_HOME\"|g" /etc/profile.d/fedora.sh sed -i "s|FEDORA_USER=fedora|FEDORA_USER=$FEDORA_USER|g" /etc/profile.d/fedora.sh sed -i "s|JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre|JAVA_HOME=$JAVA_HOME|g"/etc/profile.d/fedora.sh
else
echo -e "fedora user already exists\n"`fi
@DonRichards I cleaned up the markup and fixed that gs link. Did you want to take another look?
Thanks!
Will do right now.
I'm still not sure about this line "Adds Fedora User and adds fedora environment variables to /etc/profile.d/fedora.sh"
Is this telling me what was added or something that needs to be added to fedora.sh?
Does that make more sense? I just updated it. @DonRichards
-bash: getent: command not found
You're referencing Variables that aren't set yet?
@DonRichards
You likely have to re-source if you exited out.
see section
Source environment (Please note: this must be redone if you close your shell mid-install):
chmod +x ~/islandora-install.properties
. ~/islandora-install.properties
My bad. Thanks. Cannot get this line to work.
$ echo -e 'export FEDORA_HOME=/usr/local/fedora\nexport CATALINA_HOME=/usr/local/fedora/tomcat\nexport CATALINA_PID="$CATALINA_HOME/catalina.pid"\nexport JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -Djavax.net.ssl.trustStore=/usr/local/fedora/server/truststore -Djavax.net.ssl.trustStorePassword=tomcat"\nexport JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre\nexport FEDORA_USER=fedora' > /etc/profile.d/fedora.sh
-bash: /etc/profile.d/fedora.sh: Permission denied
OK, so here how I'm looking at it. https://gist.github.com/e9fb70b397aab03567e2d6d355e802b8 What am I missing at this part?
@DonRichards
Ah I think the problem is that the guide was written assuming that you were logged in as root e.g. sudo bash -l
not really as a complete shell script running under a non-root user account. I might put a note about this.
If you don't source the variables and re-source with sudo the variables might not carry forward when running sudo since I don't think it preserves by default.
e.g. sudo . ~/islandora-install.properties
In your case for the echo -e you didn't sudo it so you couldn't write to the /etc/profile.d?
Are you proposing to replace the guide with the script or are you just doing that for testing?
Can you look at the Monit part? Formatting seems to be an issue.
@DonRichards
mmm I ran though what is in my current pull and it worked ok. I compared what is in your script vs the pull and it seems to be missing a bunch of whitespace the section it is trying to edit looks like this so the whitespace would have to match
# set httpd port 2812 and
# use address localhost # only accept connection from localhost
# allow localhost # allow localhost to connect to the server and
# allow admin:monit # require user 'admin' with password 'monit'
# allow @monit # allow users of group 'monit' to connect (rw)
# allow @users readonly # allow users of group 'users' to connect readonly
Line 334
I think your IDE might be making it look correctly but if you navigate to the PR
The lines don't look right and aren't executing for me.
Odd I retested from the README in my fork as well as directly from your link and I am unable to replicate the issue.
This is what I see and it works fine when I copy and paste it
echo -e "check process openoffice\n matching \"/usr/lib/libreoffice/program/soffice.bin\"\n start program = \"/etc/init.d/openoffice start\"\n stop program = \"/etc/init.d/openoffice stop\"\n if failed host 127.0.0.1 port 8100 then restart\n if 5 restarts within 5 cycles then timeout" > $MONIT_CONF_DIR/openoffice.conf
sed -i 's|# set httpd| set httpd|g' $MONIT_CONFIG_FILE
sed -i 's|# use address| use address|g' $MONIT_CONFIG_FILE
sed -i 's|# allow localhost| allow localhost|g' $MONIT_CONFIG_FILE
sed -i 's| allow admin:monit|# allow admin:monit|g' $MONIT_CONFIG_FILE
sed -i 's| allow @monit |# allow @monit |g' $MONIT_CONFIG_FILE
sed -i 's| allow @users readonly |# allow @users readonly |g' $MONIT_CONFIG_FILE
service monit restart
Is github doing something strange? Can you paste the code that you are seeing?
I admit I'm not 100% paying attention to this thread, but is there a reason we're centralizing on running an OpenOffice service rather than running unoconv per-process? The latter is less fiddly in my experience...
@axfelix Thanks for pointing that out. Was it in this repo before and/or somewhere else here?
I know I brought it up on a call once... but that might be the extent of the discussion here.
@axfelix Might want to open up a Jira ticket with your suggestion? Changes would have to be made to module code to work with per-process vs service.
@DonRichards
Any luck with the monit section? Still not understanding why you seem to be seeing something different from what I am seeing. Can you copy and paste the code block here and let me know what errors you are getting?
@lutaylor Yes, from what you pasted into this thread I was able to get it. I'm note sure why when I copied it out of the original md it failed.
@DonRichards
odd for the
There's a a mismatch of single and double quotes on the echo for "Add a mysql backup script:"
I just tested it and it worked fine?
This is what I copied out of the md from the pull
if [ ! -d /root/bin ]; then
mkdir -p /root/bin
fi
echo -e '#!/bin/bash\n#\n# Dumps all MySQL databases and removes backups older than 1 week\n# With optional scp to another host\n\nBackupFolder=/dbbackups\nMySQLUser=root\nMySQLPass=PASSWORD\n# These next few are just used for scp, which is optional if DO_SCP != yes\nDO_SCP=no\nREMOVE_LOCAL_COPY=no\nFOLDER=dbBACK/mysql-newdb\nBACKUP_USER=backupuser\nBACKUP_HOST=backuppass\n\nDATE=$(date +%Y%m%d)\nOLDDATE=$(date +%Y%m%d -d ' 7 days ago')\n\nif [ ! -d "$BackupFolder" ]; then\n mkdir -p "$BackupFolder"\n if [ $? -gt 0 ]; then\n echo "ERROR: Could not create $BackupFolder"\n exit 1\n fi\nfi\n\nfor dbname in $(mysql --user="$MySQLUser" --password="$MySQLPass" -Bse "show databases"); do\n rm -f "$BackupFolder/$dbname-$OLDDATE.bz2"\n DumpName="$BackupFolder/$dbname-$DATE.bz2"\n mysqldump --user="$MySQLUser" --password="$MySQLPass" --opt "$dbname" | bzip2 -9 >"$DumpName"\n if [ $? -gt 0 ]; then\n echo "Backup of $dbname failed! (mysqldump)"\n else\n if [ "$DO_SCP" == 'yes' ]; then\n scp -B -o StrictHostKeyChecking=no "$DumpName" "$BACKUP_USER"@"$BACKUP_HOST":"$FOLDER/"\n if [ $? -gt 0 ]; then\n echo "Backup of $dbname failed! (scp)"\n fi\n if [ "$REMOVE_LOCAL_COPY" == 'yes' ]; then\n rm -f "$DumpName"\n fi\n fi\n fi\ndone\n' > /root/bin/mysqlBackup.sh && chmod a+x /root/bin/mysqlBackup.sh
@DonRichards Did you happen to try the code that I referenced regarding the echo for the mysql backup script?
Running it right now
I was able to successfully run through each line but this is going to seem naive but I got no website.
I have a vagrant machine running with this but I think I'm missing something simple.
My ports opened by vagrant. Are these causing the issue?
22 (guest) => 2222 (host)
3306 (guest) => 3306 (host)
8000 (guest) => 8000 (host)
8080 (guest) => 8080 (host)
Can you curl against http://localhost on the vagrant box? Is apache started?
curl: (7) Failed to connect to localhost port 80: Connection refused
8000 curl: (52) Empty reply from server
8080 curl: (52) Empty reply from server
Is apache service running? You might have to change the port 80 listening port and reference in the vhost config to 8000 and access with http://localhost:8000. e.g. kinda like how we are doing it here https://github.com/Islandora-Labs/islandora_vagrant_base_box/blob/master/scripts/drupal.sh#L49-L61
This might help. After completing the setup on vagrant/virtualbox I had to add the following line to my Vagrantfile in order to be able to access the web server via the host OS:
config.vm.network "private_network", type: "dhcp"
After the halt and "vagrant up" a quick ifconfig within the VM shows I now have a "host only" IP 172.28.128.3 that I put into a browser on the host OS and was able to see Islandora.
...
Update Hmm after reading again it does seem that apache may not be running within the VM if
curl localhost
...is not showing you something like:
<div class="content">
<span>Powered by <a href="https://www.drupal.org">Drupal</a></span> </div>
</div>
</div>
</div> <!-- /#footer -->
</div></div> <!-- /.section, /#footer-wrapper -->
</div></div> <!-- /#page, /#page-wrapper -->
</body>
</html>
Good catch @wballum and @DonRichards !
I see the problem I have updated the quotes.
@DonRichards Think we are close to being able to merge this?
I'll try to walk through this today to see if we can wrap this up.
Need to put in a pull similar to https://github.com/Islandora-Labs/islandora_vagrant_base_box/pull/23 on this. However should try to get this merged first to avoid merge conflicts.
@DonRichards
Could we merge this? I want to follow up with additional pulls/fixes. In the future I will do smaller pulls to make it more manageable. A lot of formatting etc got fixed in this one which makes it difficult to follow up with other pulls. The longer we leave it the more followup fixes will be needed. The difficulty of the documentation is that it should be considered "living" since various packages end up changing or not being available overtime.
On it.
But I've somehow lost admin access to this...?
Not sure what's up there @DonRichards but I have put you back into the Admin group for this repo
See issue #15 for more information. Bringing versions to be closer to vagrant environment.
PR 17 to see other changes.
-Note java opts vary between java versions things like -XX:MaxPermSize=512m are retried and CMSClassUnloadingEnabled is enabled by default.
Broke out external tomcat to match tomcat version in vagrant box.
Removed multi fgs notes and added a link at the bottom if people are interested in learning more. multifgs updaters not default in vagrant box. People also need to be careful enabling it by default since it can drastically increase HEAP pressure.