Ticket #166 (closed defect: fixed)
certs / domain names for dev and test sites
Reported by: | chris | Owned by: | chris |
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | Dev server | Keywords: | |
Cc: | ed, jim, john | Estimated Number of Hours: | 1.0 |
Add Hours to Ticket: | 0 | Billable?: | yes |
Total Hours: | 1.6 |
Description
The dev server has a https certificate set up for *.transitionnetwork.org but the dev and test sites are set to run on *.webarch.net domain names so people get certificate warnings.
When this is fixed various scripts on the dev server like the wiki:DevelopmentServer#live2dev script will also need updating...
Change History
comment:2 Changed 5 years ago by chris
Well, we can leave it for now and perhaps fix it if/when we next migrate the site, the current cert is valid till 10/02/12.
Or it could be changed now, Jim - what do you think, this is the ticket text:
The dev server has a https certificate set up for *.transitionnetwork.org but the dev and test sites are set to run on *.webarch.net domain names so people get certificate warnings.
When this is fixed various scripts on the dev server like the wiki:DevelopmentServer#live2dev script will also need updating...
comment:3 Changed 5 years ago by chris
- Add Hours to Ticket changed from 0.0 to 0.06
- Total Hours changed from 0.0 to 0.06
I think it would make sense to do the domain name switch for the dev site at the same time as switching it to HTTPS only for auth sessions, see ticket:224#comment:8
Would that be OK with all?
comment:5 Changed 5 years ago by chris
- Add Hours to Ticket changed from 0.0 to 0.25
- Total Hours changed from 0.06 to 0.31
The database will need dumping and the following reg ex's running on it:
s/http://dev\.transitionnetwork\.org\.webarch\.net/http://dev.transitionnetwork.org/g s/https://dev\.transitionnetwork\.org\.webarch\.net/https://dev.transitionnetwork.org/g s/http://workspaces\.dev\.transitionnetwork\.org\.webarch\.net/http://workspaces.dev.transitionnetwork.org/g s/https://workspaces\.dev\.transitionnetwork\.org\.webarch\.net/https://workspaces.dev.transitionnetwork.org/g
And the following files will need editing in /web/dev.transitionnetwork.org.webarch.net/www:
./sites/workspaces.dev.transitionnetwork.org.webarch.net/settings.php ./sites/default/settings.php
And also the wiki:DevelopmentServer#live2dev script will need updating but this shouldn't be tested till the live site has been updated to match the dev one.
And finally there will be some updates in the apache configuration.
I'll chack on with these things.
comment:6 Changed 5 years ago by chris
- Add Hours to Ticket changed from 0.0 to 0.1
- Total Hours changed from 0.31 to 0.41
The database will need dumping and the following reg ex's running on it
Jim can you let me know when would be a good moment to do the domain name switch, it'll take about 30mins and I don't want you to make any changes to the dev or the test databases while I'm doing it.
I'll start now on the test database now since I don't think you are working on that at the moment and I'll start on the dev one when you give me the all clear.
comment:8 Changed 5 years ago by chris
- Add Hours to Ticket changed from 0.0 to 0.2
- Total Hours changed from 0.41 to 0.61
Regular expressions run on the dumped test database tables, of which there don't seem to be many?
Get a list of files to edit from the directory with the dumped SQL files:
grep -l "http://test.transitionnetwork.org.webarch.net" *test* | xargs
Nothing to edit...
I'll do the dev databases now...
comment:9 Changed 5 years ago by chris
- Add Hours to Ticket changed from 0.0 to 0.75
- Total Hours changed from 0.61 to 1.36
In the /usr/local/bin/live2dev script these lines have been changed:
DEV_DOMAIN=dev.transitionnetwork.org.webarch.net TEST_DOMAIN=test.transitionnetwork.org.webarch.net
And the version here wiki:DevelopmentServer#live2dev has been updated.
Database dump editing, first search:
grep -l http://dev\.transitionnetwork\.org\.webarch\.net *dev* | xargs
Run this on them:
:1,$s;http://dev\.transitionnetwork\.org\.webarch\.net;http://dev.transitionnetwork.org;g :1,$s;https://dev\.transitionnetwork\.org\.webarch\.net;https://dev.transitionnetwork.org;g :1,$s;http://workspaces\.dev\.transitionnetwork\.org\.webarch\.net;http://workspaces.dev.transitionnetwork.org;g :1,$s;https://workspaces\.dev\.transitionnetwork\.org\.webarch\.net;https://workspaces.dev.transitionnetwork.org;g
Search for other files to edit:
grep -l https://dev\.transitionnetwork\.org\.webarch\.net *dev* | xargs grep -l http://workspaces\.dev\.transitionnetwork\.org\.webarch\.net *dev* | xargs grep -l https://workspaces\.dev\.transitionnetwork\.org\.webarch\.net *dev* | xargs
Use the same reg ex's on these files.
Then import the files back into mysql:
cat *_dev\.* | mysql dev cat *_devworkspace\.* | mysql devworkspace cat *_dev_sharingengine\.* | mysql dev_sharingengine
Edit:
/web/dev.transitionnetwork.org.webarch.net/sites/workspaces.dev.transitionnetwork.org.webarch.net/settings.php /web/dev.transitionnetwork.org.webarch.net/sites/default/settings.php
Check for files to edit in /web/dev.transitionnetwork.org.webarch.net/www:
grep -rl webarch\.net . | xargs ./sites/workspaces.dev.transitionnetwork.org.webarch.net/settings.php ./sites/default/settings.php
These lines were changed:
$cookie_domain = '.dev.transitionnetwork.org';
Edit Apache config files in /etc/apache2/sites-available
dev.transitionnetwork.org.webarch.net news.dev.transitionnetwork.org.webarch.net test.transitionnetwork.org.webarch.net
Lines changed:
RedirectPermanent /user https://dev.transitionnetwork.org/user RedirectPermanent /admin https://dev.transitionnetwork.org/admin RedirectPermanent /user https://news.dev.transitionnetwork.org.webarch.net/user RedirectPermanent /admin https://news.dev.transitionnetwork.org.webarch.net/admin
And it all appears to work, however when I'm logged in the top admin menu has gone -- Jim any ideas what could have happened here?
comment:10 Changed 5 years ago by jim
Admin menu got it knickers in a twist because of caching/domain/session issues. Chose 'wipe and rebuild' from here: https://dev.transitionnetwork.org/admin/settings/admin_menu
Then flushed all the caches for good measure. Seems ok now.
comment:11 Changed 5 years ago by chris
- Add Hours to Ticket changed from 0.0 to 0.24
- Status changed from new to closed
- Resolution set to fixed
- Total Hours changed from 1.36 to 1.6
I've also done some testing and think we can close this ticket :-)
This is an issue that users are logged off when visiting the http version of the site but I'll follow that up on ticket:224 (though I should probably have opened a ticket specifically for the HTTPS stuff).
Also when I login I get redirected to some 404 pages, which is weird, see:
https://dev.transitionnetwork.org/admin/reports/event/1393736
This is the 404 page:
https://dev.transitionnetwork.org/sites/default/files/uploaded/u4/gort%20admin%20grab.png
But this is an issue for another ticket...
Also cron jobs were also updated to use the transitionnetwork.org domain:
35 * * * * /usr/sbin/ab -v 1 -n 1 http://test.transitionnetwork.org/cron.php 5 * * * * /usr/sbin/ab -v 1 -n 1 http://dev.transitionnetwork.org/cron.php */15 * * * * /usr/sbin/ab -v 1 -n 1 http://news.dev.transitionnetwork.org/cron.php
And this is generating some errors, eg:
https://dev.transitionnetwork.org/admin/reports/event/1393838
But again this is one for another ticket...
this need any attention?