The problem, after install django project in my domain foo.net, i need install a limesurvey in a subdomain, using a2hosting
limesurvey.foo.net
- Create a subdomain using a cpanel
limesurvey.foo.net
- Connect to account using ssh
ssh -l user foo.net
- Download limesurvey and install it.
https://www.limesurvey.com/ for more details
- Allow Cross Domain using .htaccess
vi limesurvey/.htaccess
# Add in your .htaccess the following lines
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
- Create an other subdomain
app.foo.net
- Create an .htaccess into your folder
vi app/.htaccess
# Prevent Apache from serving .ht* files:
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
# otherwise forward it to index.html
RewriteRule . index.html
</IfModule>
<script>
var url = 'http://limesurvey.foo.net/index.php/admin/remotecontrol';
var request.method = 'get_session_key';
request.params.username = 'UserName';
request.params.password = 'YourPassword';
$.post(url, JSON.stringify(request), function(result){
console.log('sessionKey', result.result);
}, 'json');
</script>