[Loris-dev] Installation MySQL in different sever

Morales Pinzon, Alfredo AMORALESPINZON at bwh.harvard.edu
Mon Nov 6 10:13:47 EST 2017


Dear LORIS Dev Team,

Here are the configuration steps that the BIC Admins and I did in order to get MySql running in an external machine and allowing connections from Loris server:

1. iptables rules for port 3306 in the mysql machine

iptables -I INPUT -p tcp -s <ip-loris-machine> --dport 3306 -j ACCEPT

2. File /etc/hosts.allow must contain the line

mysqld: <ip-loris-machine>

This second instruction was necessary as all the connections were block in the MySql sever, this is because the file "/etc/hosts.deny" contains "ALL: ALL".

3. Configure MySql to accept connections from outside. ( I mostly used this post: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/mysql_remote.html)

3.1 Modify bind-adress. Modify this file (/etc/mysql/mysql.conf.d/mysqld.cnf) like this:
- bind-address          = 127.0.0.1
+ bind-address          = <ip-mysql-machine>

3.2 Grant access from the LORIS ip machine in the MySql database
// Login into mysql
GRANT ALL ON *.* TO root@<ip-loris-machine> IDENTIFIED BY '<root password>'
// Refresh grants using flush
FLUSH PRIVILEGES;
// Logout from MySql and restart the service
service mysql restart

That's it! Hope you can add this information to your github-wiki, that will ease/help the installation for future users.

Regards,
Alfredo.
________________________________
From: loris-dev-bounces at bic.mni.mcgill.ca [loris-dev-bounces at bic.mni.mcgill.ca] on behalf of Morales Pinzon, Alfredo [AMORALESPINZON at bwh.harvard.edu]
Sent: Friday, November 03, 2017 4:13 PM
To: David MacFarlane, Mr; loris-dev at bic.mni.mcgill.ca
Subject: Re: [Loris-dev] Installation MySQL in different sever

Hi David,

Thank you for your answer. Indeed I am dealing with point 3, as I am not a sysadmin guy I was looking for some light! We are figuring it out with the BIC Admins. I will share what I will learn :)

Best,
Alfredo.
________________________________
From: David MacFarlane, Mr [david.macfarlane2 at mcgill.ca]
Sent: Friday, November 03, 2017 3:22 PM
To: Morales Pinzon, Alfredo; loris-dev at bic.mni.mcgill.ca
Subject: Re: Installation MySQL in different sever


Hi Alfredo,


There should be nothing special from the LORIS side about configuring MySQL whether it's on the same server or not. LORIS doesn't do anything special with the host that it connects to and uses the standard PHP PDO objects.


Things to keep in mind are that:

  1.  MySQL accounts are tied to the domain that the account is connecting from, so just because you can connect locally doesn't mean your same credentials will work remotely
  2.  There may be firewalls between your servers blocking the MySQL port.
  3.  There may be some kind of security settings (ie SELinux or apparmor) set up by your sysadmin which further restrict connections (particularly from web servers.) that need to be relaxed.


The first thing to do is work with your sysadmin to make sure you can connect to MySQL from the command line on the same server/with the same credentials as your LORIS instance. If you can get that working, LORIS itself should work fine (unless the problem is 3, in which case you can test by temporarily disabling it and seeing if that fixes it..)


- Dave

________________________________
From: loris-dev-bounces at bic.mni.mcgill.ca <loris-dev-bounces at bic.mni.mcgill.ca> on behalf of Morales Pinzon, Alfredo <AMORALESPINZON at bwh.harvard.edu>
Sent: November 3, 2017 11:36:53 AM
To: loris-dev at bic.mni.mcgill.ca
Subject: [Loris-dev] Installation MySQL in different sever

Dear LorsiDev team,

My LORIS setup has the MySql server in a different machine and it seems to require a more advanced configuration of MySql that default installation your provide in the Loris GitHub. As I think you might have done this type of setups, I was wondering if you have some documentation that can help me with this configuration process.

Regards,
Alfredo.

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20171106/d8426441/attachment-0001.html>


More information about the Loris-dev mailing list