I'm facing an issue that's beyond my Zend Framework knowledge, i hope you guys could help.
I have a old fully-functional system installed in my server (let's call it http://stable.server.com), which has a very old PHP version. I'm planning to upgrade my PHP version to the latest (and hopefully in a few months, to 7!) but my code uses a lot of deprecated functions and has some code that isn't valid for PHP 5.6 but it was for older versions. I've made a division of modules in order to migrate each module, test it and then upload it to a parallel server with the latest PHP version (let's call it http://updated.server.com). Of course each one has a different Zend installation, with the same version and configuration file.
Of course those modules has some communication between themselves, and I want to keep the change the most transparent for my users. So when I call from updated.server.com to stable.server.com and viceversa, my app asks me to login again. When I'm logged in the two systems, this communication goes straight, but I want to avoid the users to login again.
¿Any of you have made something like this? I'd like of course a secure way to avoid that login between systems, so nobody could mount a fake system and login from it.
Thank you all in advance.
I think you are looking at the two different problem.
Session is written on disk this information needs to be shared between two servers.
Cookie needs to be persistent through out the domain/subdomain.
for session sharing you can use mysql session storage.
http://framework.zend.com/manual/1.12/en/zend.session.savehandler.dbtable.html
http://framework.zend.com/manual/1.12/en/learning.multiuser.sessions.html
https://github.com/sprain/PHP-MySQL-Session-Handler/blob/master/MySqlSessionHandler.php
you can google it there are so many solution out there.
2.Domain set cookie for subdomain
you can set your cookie to be ".server.com" then it will live through out of your all domains.
This is not simple fix!! but once you are done with this implementation you can run both version at the same time on different machine with same session information.
Related
I have a web application written on Code Igniter and almost ready for the release.
I'm looking into ways to do "automatic" updates for the clients.
Now there are going to be versions of the application on which the users will choose to update and when to do it.
I'm curious on how to update the files for the user.
What i used to do before using a framework i used to make a zip file of the new-edited files store it on an FTP and on the user side when he updated i just unziped the file and replace the ones on his side.
For the database schema and other updates i intend to keep a file with the required queries and run during the update.
Should i go with that way or is there something other that i can implement on Code Igniter?
A more straight forward road?
Also i'm still figuring out the part where a user will have to update from say version 1.0.0 to 1.0.3 (2 or 3 versions apart) and the requirements on the files side but on the database also.
Thank you
If you are willing to put it under version control with Git, you can use PHPloy to push only the latest change to the server through FTP. Check it out on Github: https://github.com/banago/PHPloy
Disclaimer: I've written PHPloy
I'm looking for a way to build a php application (in Laravel) that reuses the existing users we have in a Drupal installation.
I found two suggested solutions on stackoverflow:
1) include the Drupal bootstrap and use their user_authenticate() method.
One thing I suppose will be a problem is that our PHP application is running on a different server. This approach will probably not work in such a case or can that be fixed by pointing to the Drupal sql server?
2) use the Drupal services module to authenticate users over REST
This might work over different servers/domains I suppose, but there won't be a way to automatically login users in our php app that are already logged into Drupal, or am I wrong.
3) synchronise the Drupal user data to our own SQL server
This would be a final resort, since this won't solve automatic login.
Are my thought correct in these situations. What would you suggest doing when Drupal and the PHP app are on two completely different servers/domains?
I ended up writing a custom provider in Laravel.
If you're interested in doing the same thing, here's what I did: Create a custom Drupal 7 authentication driver/provider in Laravel 4
I have two Joomla 3.0 sites installed on the same hosting account, each in their own directory on their own database. Both are subdomains of the same domain. The are hosted with Bluehost shared hosting at the moment, but I will be upgrading to VPS hosting once I go live.
Hosting environemnt:
Apache version 2.2.25
PHP version 5.4.17
MySQL version 5.5.33-log
Architecture x86_64
Operating system linux
Site #1:
subdomain1.domain.com
- is an online magazine with login/registration and ability to comment on articles. I am using the Zoo component for content articles rather than the Joomla default.I am also using the JFBConnect component and SCLogin module.
Site #2
subdomain2.domain.com
- is an installation of Jomsocial 3.0 with login/registration only, also using the FBConnect component and SCLogin module.
Both are using the same responsive Yootheme warp framework template. I intentionally installed them in different directories under the theory that if one were to malfunction, at least the other would be viable in the interim.
My question(s):
Is it possible for users to login and register just once in order to be recognized by both sites/databases and have full use of all functions in both?
Is my installation of Jomsocial on a separate directory the best course of action, given my rationale?
Are there any other considerations to the above scenaio that I might have overlooked?
Thank you in advance for your help!
Hmm, I have to say it's probably not the best method you've chosen here.
It's not so much the files that you have to worry about, it's the database as all data is stored here. I would personally suggest having you're main site on the main domain and taking daily backups of the database and a backup of the folder/files every time you, for example, install an extension which adds new files and folders..
If something goes wrong, simply uploads the backup.
Yes it is possible using jFusion. The warp framework, jomsocial etc has zero relevance. http://www.jfusion.org
That said, your assumptions for implementing this method for having a viable site available are seriously flawed.
I am developing an application with Ruby on Rails (will be more to come) and it has got to the stage where I would like to remotely host a development version, followed by a production one. I have done lots of rails development but I am reviewing my current setup and would like to make sure I do things the industry recommended way form now on.
I already have a dedicated server which is running parallels plesk and has several domains on it. I have currently had some success by creating a new user "passenger" to run the rails app and deploying via that user to an apps directory under
/var/www/vhosts/myrailsapp.com/subdomains/dev/
which is the parallels-format for site directories, deploying using capistrano and running the passenger module for apache. I have basically been putting my rails files where I would put them if it were a plain php site or similar and I was wondering if this was the way things are usually done?
I also found some information online which points at putting my rails apps under
/var/apps/
or similar, but then it would conflict with the parallels plesk way of doing things which could potentially cause issues, or could it?
I have already looked at solutions like Heroku and they won't quite work as I need to run other programs alongside my rails app on the same server to handle some real time server to server file syncing of files uploaded using the app. Added to this I need to ideally be able to host normal PHP applications alongside my RoR ones to make best use of the server.
How should I ideally go about implementing this sort of setup for secure hosting and deployment? If needs be (i.e my current setup is far less than ideal) you could assume I am starting from a vanilla ubuntu server install which I would be open to if it produced a nicer system to manage.
I figured many people would have had similar situations and so any advice from any of you veteran Rails/PHP developers or server admins would be greatly appreciated.
Many Thanks,
Peter
Normally it's a bad idea to put your Rails project files anywhere in your public html space because you don' want anybody to be able to put something like http://yoursite.com/config/database.yml and access sensitive information. Even if that's not possible under normal situations, it could still happen if you have problems with Passenger starting up correctly or something similar.
So I would recommend putting your Rails apps in /var/apps or /srv/apps (as we've done) and setup the Apache config to point your domain or subdomain to that directory.
If you want to have your app accessible by a subdirectory on an existing domain it takes some additional setup but that can also be done.
I have developed a Portal using Microsoft ASP.NET and MSSQL. Now, I want to include vBulletin to my site for that purpose I need to have PHP and MySQL(or MSSQL will do?). With single login feature for both the Portal and Forum.
I have hosted my site on Dedicated IIS webserver hosted on MS Server 2008.
I can install PHP on it. (and MySQL too if required)
The problem here is how can I integrate the user's of my portal with vBulletin forum??
Is there any way to Install vBulletin using IIS+PHP+MSSQL?
or
I have to use IIS+PHP+MysQL and integrate users of users of both the databases? (HOW?)
At the moment vBulletin only supports MySQL. There is talk of adding support for other databases however right now with all versions of VB MySQL is your only option. So without heavily modifying VB this cannot use MSSQL (in fact I would strongly recommend that you don't even try embarking on that)
The other complication is that you are using two different code frameworks, PHP for vBulletin and ASP.NET (C#?) for your portal. All these frameworks can sit together on the same dedicate box but you need them to communicate with each other.
With all this in mind the easiest way of having SSO across the two platforms (portal & vbulletin) would be to use the vBulletin user table in MySQL for your portal authentication. There is a .NET MySQL driver that you can use for this purpose and running the necessary queries via that, from ASP.NET, should be fairly simple.
The only other thing that you will have to consider is a user logging in on your portal page not having to relog when they go to the forums. This can be done by setting cookies etc so you will have to look at vBulletins login.php script to work out how these are handled.
There is also another option, that you may or may not want to consider (depending on how much work you have put into your portal ;)). There is already a free portal product for vBulletin called vbAdvanced:
http://www.vbadvanced.com/
This may already meet your portal requirements and is developed specifically for vBulletin.