Magento Multiwebsite With Single Database & Single Admin - magento

Friends
Can i create multiple web store with single admin and database *in Magento*. i want to host these stores from different servers. In other words my database and code (different code for different site) would be on different servers.
for ex: i have abc.com and xyz.com stores created in Magento hosted on different servers but the database is same.
i have already created multi-store concept in Magento with Magento's default functionality but in that case we can't host different website from different server because there is a single code for both of the site or store
why i wanted to use this concept just because of security purpose and in case of server crash there will be no harm to other web store because they are hosted from different servers
Thanks....

Haven't seen such scheme before but I don't think this will work.
From the implementation's view, it requires a dedicated empty database in which the tables will be created as part of the installation process. So when you install a second Magento on the same database, all tables written by the previous Magento installation shall be erased.

Related

Laravel App on AWS Elastic Beanstalk: How can I use a different database (on the same RDS) according to subdomain?

We are running a B2B business and we have a Laravel (v8) app running on AWS.
Before, I created different environments for different customer companies.
One subdomain for each customer company and running on different environment as the configuration described here:
AWS: Pointing sub-domains to different elastic beanstalk environments
In the beginning it seemed perfect. But then, managing git branches, merges and then deployments on several machines proved to be too difficult to maintain, furthermore, too expensive.
So, I decided to point all the subdomains to the same environment for production.
BUT, ALSO I don't want that data of customer companies get mixed together; I want to keep them separate, even if on the same database server.
SO, FINALLY I want that my laravel app uses a different database (on the same RDS instance) according to subdomain.
1. Does it make sense?
2. How can I do it?

Autoscale Magento in the cloud

I have just entered into the world of e-commerce, and I am trying to get my Magento website up and running.
I am using AWS cloud for hosting my website. I am trying to use an architecture, where I can run multiple servers connected to a single DB server. Specifically, I want to use an AWS Auto scaling group along with ELB to start multiple EC2 instances, during high load. There is only one Mutli AZ RDS Database instance.
As initial trials, I tried creating 2 ec2 instances, and installed magento on both of them. I have used same RDS DB for both of them. But as is turns out, magento stores the base url of webserver in the database itself. Which means, I can only store one base url of magento website running one particular server.
To be precise magento stores base url in table core_config_data in column 'path' where row values ares "web/unsecure/base_url" and "web/secure/base_url", and the column 'value' for corresponding row specifies the url address of magento installed web server.
My question is how can I use multiple server using EC2 auto scaling, if magento permits only one server address in the base url.
Here's a partial view of the table with 2 rows -
config_id scope scope_id path value
5 default 0 web/unsecure/base_url http://server1.com/magento/
6 default 0 web/secure/base_url http://server1.com/magento/
Are there any other known methods to somehow use horizontal scaling during heavy load conditions in Magento.
I don't think load balancing works like that.
You need a load balancer that receives the requested URL and then passes it off to one of the servers running Magento - so I think you would pass the same url to both servers anyway, no?. I do not know how to do it.
You are trying to set up a very complicated system.
You could look to override some functions if you want to have different values for secure and non-secure urls. Try reading this code to get you started:
//file app/code/core/Mage/Core/Model/Store.php
//class Mage_Core_Model_Store
//function getBaseUrl()
//function getDistroServerVars()
//file app/code/core/Mage/Core/Model/Url.php
//class Mage_Core_Model_Url
//function getBaseUrl()
//file app/code/core/Mage/Core/Controller/Request/Http.php
//class Mage_Core_Model_Http
//function - I don't know, any of them, none of them
and look at any files with the string 'substDistroServerVars' in them or isDirectAccessFrontendName might expose something. getDistroServerVars is discussed at the end of this great article by the almighty Alan Storm.
But I don't think that is the real answer - for the real answer skip to the links at the end of this tedious monologue.
If this is your first foray into Magento and you really think you are going to get the volume of traffic into your shop that requires load balancing over two servers then you can afford, *must afford**, third party hosting and get professionals with many many many man years of experience running Magento on heavy loads across multiple servers. You will also want to hand off (at least) the images to a CDN.
*I mean, if your shop has that high a volume then it has a high revenue and you should invest that revenue in keeping your shop running: professional hosting with 24/7 support. Otherwise downtime will be expensive and a long implementation will mean lost revenue.
*If you are just trying this out for fun and to learn something about setting up Magento on multiple servers then I recommend two things:
1) Practice getting Magento running on one server first - and optimsing for volume there (caching, compilers, DB tuning, log file analysis, flat tables, cron jobs, CDNs, possibly combined JS and CSS, web server tuning and getting the headers right, possibly a full page cache and a sprinkling of Redis) - because that isn't a trivial list on one server never mind two + DB server and ELB.
And 2) practice getting Apache or nginx to serve load balanced content with your ecommerce SSL certificate in place. Only then should you try to join the two systems. Be prepared to spend many months on this - including figuring out Seige, AB or jmeter for simulated load testing.
But if you really want to get the AWS ELB set up here are a few excellent resources to get you started - particularly the detailed tutorial by Adrian Duke (first link) - pay great attention to the details in the last section of that article subtitled 'Magento', that may be the answer to your question.
Getting and scaling Magento in the cloud by Adrian Duke
Using AWS Auto Scaling with an Elastic Load Balancer cluster on EC2 (actually a WordPress install, not Magento, but Mr Shroder knows his Magento)
Running Magento in an AWS Environment (All hail Alan Storm)
I've had a rather large amount of success modifying the Magneto to be a beanstalk package. The steps (loosely) were:
Install GIT locally
Install AWS Command line tools
Install AWS Beanstlalk Command Line
Build module to upload image to s3 everytime it's uploaded in magento
Utilize OnePica's Magneto Extension
Use Amazon's REDIS Cache for caching data
Use RDS for database
Use Route53 for routing &
Use cloudfront for image, js & CSS Distro
Couple of drawbacks to AWS
Customizing magneto to look for things is a pain in the ass. As we speak I'm trying to get it to keep sessions persistent between EC2 instances as the loadbalancer chops it up.
Everytime you need to modify Magento in any way it's a git commit, (then we test locally, via a seperate beanstalk instance) and then push to production.
Short of that it's been fairly stable. We're not hitting high numbers yet, though.
Normally you put a load balancer in front of the nodes to distribute the load and each node is configured to use the same base_url. MySQL replication can be used if you want multiple db servers but I have never found the need to do this. Not used amazon ec2 with magento but have similar setup in a dedicated server environment with two nodes, one db server, load balancer, and shared media.
Diagram here is useful, especially with the shared storage for media, your going to need to do something like this. http://www.severalnines.com/blog/how-cluster-magento-nginx-and-mysql-multiple-servers-high-availability
Also, I found amazon seems to provide Elastic Load Balancing which is what your after I think. http://aws.amazon.com/documentation/elasticloadbalancing/

Moving magento site from one server to another server

i have a magento site version 1.4.1.1.
And i upgraded the site to 1.7.0.2.
Now want to move the upgraded magento into another server .
How can i do this?
i planed to do this by downloading all files and upload it into new server.and import the database into the same databsae name.
If there is any problem occur when i following the above steps.
Or if there is any rules to move magento site from one server to another server?
If your sites are not publick then just move the files and db and fix base_urls on db.
If your site is live then here's a thing or two to note down on moving sites:
CODE:
this is straightforward, static assets can be moved beforehand to new server
easy enough to perform with rsync or version control or even with plain old ftp
verify file-structure and permissions
DATABASE:
this is more complicated as you have to avoid the gap of getting more orders on old server database after you have switched to move your site database you need to take our site down for the time you move your database
first step move the database to new server for testing , test if everything works
make a not of all queries you need to run to make it work on new server (base urls etc)
repeat this process when you take down the site and open the other
THE PROCESS ON CODE AND DATABASE:
add a maintenance page on your old page with proper http header
while site is down move the database to new server
open up your new site and do a short run on verifying if all works
next step is to change the domains to point to a new server
MOVING THE DOMAINS
again moving domains is a bit tricky thing as there is a possible DNS blackout that some clients will see the old site and some are seeing the new.
change your domain rules to point to a new server
clients who's DNS is not changed jet will see the maintenance page
clients who have the new DNS already will end up on moved sites
this way you can ensure that you will not get orders on both sites. If your domain-changes completely then you also need to remap your URLS to new domains for every search engine

Moving one add on website to a new cPanel host

For several years now I have freely hosted several local organizations web pages at no cost. One of those organizations wishes to move to their own server that they manage with their own server provider (alas, not A Small Orange--a little too expensive for them).
They have
a couple add on domains/websites
advanced DNS records with Google Apps
several mailing lists
a database or two
and of course their hosting directory
I was just wondering if there is a way to just export that stuff, so it can be imported in another cPanel?
OPTION ONE: One by one move all the stuff to the new host. Create the mailing lists, manually import the databases, set up the DNSs, and upload the files.
OPTION TWO: I could export the entire site, download the entire site, go to the new provider and upload it, and then delete all my content.
OPTION THREE: Is it possible to export their parts of the site, and import that to the other hosts cPanel?
Or another option all together? No email, and I don't even need the hosting history to be there (but it would be nice).
if you are moving from cpanel hosting to another cpanel hosting then just create a full backup of the website that you want to move from WHM which will backed up emails , databases , SSLs , sub domains , addon domains , everything in .tar.gz file format. Download that back up file then upload it to the new servers and restore it from WHM from Restore backup option in WHM.
OR
You can do live migration from WHM itself with Copy Accounts function from WHM which will be easier option to move the websites and the stuff.
However after migration you will need to make sure that you have assigned dedicated IPs , have configured the name servers properly ( the DNS part ) etc..
I would suggest to hire an expert to do this migration in order to avoid any possible issues.

Is it possbile to change the webpages_Membership, roles etc table names from a simple template created with web matrix?

I've created a Web Matrix web site from the starter template which creates a database with the a few tables for the login details. Most of these are names webpages_Membership, webpages_Roles etc. The hosting company I use only gives me one database and I want to have more than one site on the server. I want to prefix the table name with something to make it unique, but it looks like the web matrix framework will only work with the set table name. Does anyone know if this is possible?
If you use SQL Server Compact Edition, you can have as many databases as you like in your App_Data folder. Certainly something to consider if your sites aren't likely to be hugely busy. Otherwise you can develop your own Provider inheriting from ExtendedMembershipProvider and make it "site-aware". Dig around in the WebMatrix.Data source code for more details (available as part of the MVC source download).

Resources