Daqinv: Difference between revisions
Jump to navigation
Jump to search
Line 120: | Line 120: | ||
</pre> | </pre> | ||
* try https://daq00.triumf.ca/inventory3/public/index.php/home, seems to work ok. | * try https://daq00.triumf.ca/inventory3/public/index.php/home, seems to work ok. | ||
= migrate inventory2 from ladd00 to daq00 = | |||
AAA |
Revision as of 00:15, 8 February 2022
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
- touch /etc/crontab
- go to https://ladd00/daqinv, everything should work
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 inventory3 to daq00 ubuntu
- https://ladd00.triumf.ca/~daqinv/inventory3/public/index.php/home
- try https://daq00.triumf.ca/~daqinv/inventory3/public/index.php/home, "404 not found"
- ln -s ~daqinv/inventory3 /var/www/html/
- try https://daq00.triumf.ca/inventory3/public/index.php/home, "Mcrypt PHP extension required.", good
- add password protection:
- xemacs -nw /etc/apache2/sites-enabled/daq00-ssl.conf
- htpasswd -b /etc/apache2/htpasswd inv inv
- install mcrypt php extension:
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
- try https://daq00.triumf.ca/inventory3/public/index.php/home, "ErrorException (E_DEPRECATED) Function mcrypt_get_iv_size() is deprecated"
- xemacs -nw app/config/app.php ### add "error_reporting(error_reporting() & ~E_DEPRECATED);", see https://stackoverflow.com/questions/42515368/function-mcrypt-get-iv-size-is-deprecated-on-laravel-4/42515505
- chown www-data /home/daqinv/inventory3/app/storage/logs/laravel.log
- chown www-data /home/daqinv/inventory3/app/storage/sessions/
- try https://daq00.triumf.ca/inventory3/public/index.php/home, "SQLSTATE[HY000] [1045] Access denied for user 'daqinv'@'localhost' (using password: YES)", good we did not copy the database yet.
- copy database:
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
- try https://daq00.triumf.ca/inventory3/public/index.php/home, seems to work ok.
migrate inventory2 from ladd00 to daq00
AAA