Daqinv

From DaqWiki
Jump to navigation Jump to search

Welcome

Welcome to the DAQ inventory database. Please follow links below to enter the inventory database webapp. Use username and password "inv".

Links

News

  • 2015-Aug-11 - inventory web app access restricted, use username "inv", password "inv"

Installation instructions

  • start with base SL6
  • install: yum install mod_ssl apr-devel apr-util-devel httpd-devel
  • install ruby gems packaging system: yum install rubygems ruby-devel
  • install ruby on rails:
    • gem install rails -v '2.3.5'
    • gem install fastthread
    • gem install mysql
    • gem install passenger -v4.0.59 ### or -v4.0.8 as on ladd00
    • gem install rdoc
  • install passenger_mod (apache httpd module)
    • find passenger location (look under "Installed at"): gem list -d passenger
    • cd /usr/lib/ruby/gems/1.8/gems/passenger-4.0.8
    • ./bin/passenger-install-apache2-module
    • say "yes" to all prompts, at the end the script will print information similar to that below:
   LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.8/buildout/apache2/mod_passenger.so
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.8
   PassengerDefaultRuby /usr/bin/ruby
  • configure apache
    • cd /etc/httpd/conf.d
    • edit daqinv.conf to read: (the LoadModule, etc lines are copied from the output of passenger-install-apache2-module above)
# config file for DAQ inventory "ruby on rails" app 
 
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.8/buildout/apache2/mod_passenger.so 
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.8 
PassengerDefaultRuby /usr/bin/ruby 
 
PassengerLogLevel 0 
 
PassengerDefaultUser daqinv 
 
RailsBaseURI /daqinv

<Location /daqinv> 
        SSLRequireSSL 
</Location> 
 
#end 
  • ln -s /home/daqinv/inventory2/public /var/www/html/daqinv
  • create crontab for mysql backups and old session cleanup: /etc/cron.d/daqinv.cron
# daqinv.cron cron job for daq inventory system periodic activity
#11 * * * * root wget --spider localhost:3000/config/trigger
#11 2 * * * root wget --spider --no-check-certificate https://localhost:3001/config/trigger >& /dev/null
11 2 * * * root cd /var/tmp; wget --spider --no-check-certificate https://ladd00/daqinv/config/trigger   >& /dev/null
10 1 * * * root find /home/daqinv/inventory2/tmp/sessions -mtime +8 -exec /bin/rm -vf {} \; >& /dev/null

php update & etc

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
~yum remove php-common
~yum install "php56w*" --exclude "php56w-conflicting"
https://daq03.triumf.ca/~bcitinv/public/index.php?token=JDVJKUYCMTUQWCQ
https://daq03.triumf.ca/~bcitinv/inventory3/public/index.php/home
https://ladd00.triumf.ca/~daqinv/inventory3/public/index.php/home

migrate to daq00 ubuntu

apt install php-pear ### install pecl
apt install php7.4-dev ### install phpize
apt install mcrypt libmcrypt-dev
pecl install mcrypt
xemacs -nw /etc/php/7.4/apache2/php.ini ### add "extension=mcrypt.so"
systemctl restart apache2
ssh daqinv@ladd00
mysqldump -h localhost -u daqinv -p daqinv > backup.sql
ssh root@daq00
mysql -p
MariaDB [(none)]> CREATE DATABASE daqinv;
MariaDB [(none)]> CREATE USER 'daqinv'@'localhost' IDENTIFIED BY '123';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON daqinv.* TO 'daqinv'@'localhost' WITH GRANT OPTION;
ssh daqinv@daq00
mysql -udaqinv -p daqinv < backup.sql