Difference between revisions of "Connecting Directly To The Development Database"
m |
|||
Line 29: | Line 29: | ||
[[Category:Website Version 3]] |
[[Category:Website Version 3]] |
||
+ | [[Category:IT]] |
Revision as of 23:58, 30 January 2019
Here are some quick instructions for allowing your local machine to query the filmsoc database server through an SSH tunnel on Windows.
- Run PuTTY
- Enter the hostname as filmsoc.warwick.ac.uk
- Select Connection->Data
- Input your username in the "Auto-login username" field
- Select Connection->Auth
- Under "Private key file for authentication:", select a private key that the server will recognise (ie. one of the one's you use in pageant)
- Select Connection->SSH->Tunnels
- Under "Add new forwarded port:", type 3306 into "Source port"
- In the "Destination" field, type: database.filmsoc.warwick.ac.uk:3306
- Click "Add"
- Select Session
- Under "Saved Sessions" type "database" into the field and click "Save"
- Click "Cancel" to close PuTTY
- Now, open your favourite text editor and put the following on one line:
- "C:\Program Files\PuTTY\plink" database
- Note: Change the path to wherever PuTTY is installed!)
- Save the file as database.bat (or similar) and put it somewhere convenient (best in the PuTTY program directory)
- "C:\Program Files\PuTTY\plink" database
- Create a shortcut to the batch file and place it in your start menu/quick launch/ desktop, wherever is convenient.
- Edit your hosts file to point database.filmsoc.warwick.ac.uk at the loopback interface (127.0.0.1). The hosts file is located at: C:\WINDOWS\System32\drivers\etc
- Just add a line like this: 127.0.0.1 database.filmsoc.warwick.ac.uk
- (This is so you don't have to modify the scripts when you've checked them out, nor do you have to change them back once you're done.)
- Note: On Vista or 7, the program editing the hosts file WILL need to be run as administrator, ie. you need to elevated it through UAC.
- Now, whenever you want to run the website locally, start up the batch script by activating the shortcut, and the website code should be able to access filmsoc's database server remotely.
- Be sure to close the Command Prompt once you are done, or type "quit" or "logout" at the SSH prompt
If something goes wrong, make sure that you have properly filled out all of the mentioned fields in PuTTY. If you miss anyone of them, plink will fail to launch properly. Make sure that your private key is not protected by a password.