Evaluating SC and trying to see how I can do this deployment...

I’ll be writing an app and hosting it on my own server.

Each company that wants to use it, will need to sign up. They will have their own sub-domain (comp1.domain.com, comp2.domain.com, etc). They will have their own database also, so no chance of Comp 1 accessing Comp 2 information.

I need to develop an automatic process that creates the environment for each company when they sign up. I know how to configure Apache with virtual hosts, etc. My concern is: I do not want to have to manually go into the production server each time a new company signs up (especially for a trial) and have to change their DB connection information.

Is there a way of doing this in a PHP script behind the scenes? Not sure where the information is stored for each project that is deployed.

I know I can just copy the deployment files to the subdir of the virtual host site, but not sure how I can configure their database settings automatically.

Thanks
Chris

Re: Evaluating SC and trying to see how I can do this deployment…

There is a file: app/_lib/conf/prod.ini

This contains the connection information created by their installer. It seems that it is encrypted by the installer.
You may have to contact support direct for details on how to get around this.

Regards,
Scott.

Re: Evaluating SC and trying to see how I can do this deployment…

There is a USE_BASE

Perhaps you can change this and use plain text? I have not tried.

Regards,
Scott.

Re: Evaluating SC and trying to see how I can do this deployment…

Ok, thank you Scott!

Re: Evaluating SC and trying to see how I can do this deployment…

Hi Chris,
I am going to give you my 2-cents worth of advice, as I have developed a system for companies where I too had a unique filesystem install and database and subdomain for each company who uses my service. It has been working flawlessly, but I have nevertheless been working for months on a different approach. As soon as I can get mine completed, I will slowly migrate all my sites over. Here is my experience:

I too have something like company A paying $20 / month for a “site”, company B another site, etc. I know python and used that language on my hosted server to copy each site’s filesystem from a special install/version2.3 folder, etc. Just a straight copy. But each site had some configuration - DB name, DB password, initial admin user/passwed, site name, etc. I had a config file that I would copy and then use Python to insert or overwrite certain lines, like a pattern replace function. Then used python and my hosting services API to create a DB, populated it with some basic data, etc. Then the same API to create a subdomain. All works great - no chance of one site polluting or corrupting another, plus sites (filesystem) could be spread out over multiple servers - which I do use 3 right now for about 45 sites. Loads are all great.

The downside: The biggest issues are patching bugs and doing upgrades. It turns out that is a BIG pain in the ass, with so many file systems. I automated that too, but the problem becomes hard to manage. Also, when you upgrade, say, one of the php files for a particular grid or form, then you may have to (my biggest fear) change the database schema. Now these are all on “running” sites. So you never do anything till you develop on a development filesystem/database - then move to a testing filesyatem/database - and finally deploy to production. You have to make tons of backups for all filesystems and databases before doing ANYTHING, no matter how much you test. THERE WILL BE PROBLEMS 5% of the time, so you have to be able to roll back both.

Second downside is just sheer number of backups that stack up. How to management that? I have scripts that log into a system database everything my scripts do (upgrades, etc) then make filesystem backups and database dumps. That is all at 1am every night. I have been very lucky and have not had to do much with the backups, but if you don;t do it, it is 110% sure you will need it…

So my solution - I am redoing my entire scheme to have a single large MYSQL database, with a siteID field in almost all my tables. So the SQL SELECTs have to filter on siteID on most pages, so that a user on a subdomain only ever knows there is their own site. Me or other admin can have a different interface that lets us see all tables for sites, etc.

Scalability - there are lots of ways to scale up for higher demand websites. Be on better server, have multiple front ends feeding off one DB, etc. I would rather tackle those issues than the way I spread them across multiple servers.

The main tricky thing for me is that I have what I call “teams”, which a team leader (a registered user who agrees to pay and be responsible, etc) can create one or more teams and invite user to join one or more teams. Teams then have ability to work on one or more sites. That may be way more than you need, but in my business model for my application, it will be terrific for the customers.

I am evaling SC right now and am 99% sure I will use it to be a the core of my systems, as it seems to have really create custom scripting system. I need lots of that for my logic. But SC has the BEST grids/PDF/print/export stuff built in I have ever seen. That saves me tons of time over how I coded stuff before. I also have used another code system phpmaker, it was good but it is more primitive than SC IMHO.

So anyway, I hope that helps you a bit. Glad to answer any questions if I can help. MY advice if you are starting out is to go thru your list of features and decide on the smallest functional system you can start with. Program that with SC or whatever combination of tools you need, then deploy - get some users going, even if free beta users. Get soem feel for how running the site and upgrading and fixing bugs goes. Meanwhile, create the next iteration list of features for version 2, etc etc. Better to have 99% of a smaller feature set making some customers (and you) happy, than 45% of everything working - with unhappy people. Mostly it will be you.

Plus as you run a system, and users are actually using it, your whole scheme will probably morph. You can add all those cool ideas and focus on adding in new stuff, rather than reprogramming things you spent a lot of time on.

One last thing, read some of the books or the blog of Seth Godin - his books Tribes and Purple Cow are really good. Not technical, but about digital business schemes and ideas.

OK, one final last point, to you and anyone else out there - build your business systems into your programming. By that I mean, how do you handle and track 'returns" or refunds? Not by cell hone calls to you I hope. How do you know if someone has referred someone via a link? Viral marketing is key these days, so put that in. How about help and support. SC has this forum (I am working on one using SC for my system) , help docs, faqs, etc. Put all that in your system. People will not be impressed if you don’t have that at launch. I would almost build the help before I programmed everything. Users seem to barley be able to click a mouse out there - at least the ones that have questions. So have someone go thru it step by step and build the help. If you do it all yourself, it will be too technical.

Really, I am done now.
Peace,
Jamie

Re: Evaluating SC and trying to see how I can do this deployment…

Hi Jamie,

I appreciate all that you wrote. At this point, that is what I’m going to have to do. SC does NOT have the capability to do the production site in an automated way and no way to modify the prod.ini file (which houses all of the settings for the connection, etc) via a script, so it will have to be one big database.

I have been programming for about 24 years but newer to PHP. Was originally using the Yii framework but I’m struggling a lot. What I’ve been struggling for the last 2 months attempting to do, I had accomplished in 2 hours or so in SC. So I’m happy about using SC. I hate to be tied into 1 particular product but I think for now, I’ll take the chance.

Luckily I’m not far into database configuration so that I’ll have to add siteid to the tables. Again, thank you for all the insight, you pretty much made up my mind to go that route.

Thanks again!
Chris

Re: Evaluating SC and trying to see how I can do this deployment…

Hi Chris, Glad to hear it was helpful. I sort of had it all bottled up inside LOL. Guess I am living and dreaming this stuff 24/7, and not many people around me know what the hell I am talking about. I also spent a TON of time working with a framework (NOLOH) which is php offshoot. Super cool but I loved learning it and got caught up into the programming language too much. Frameworks can be a mixed blessing. I haven’t given up on NOLOH, but like you, SC can really blast out good looking products. I know a purist probably has fits when they read posts likes ours, but then again, I would rather have a functioning web app system producing usefulness for users and/or money for me :slight_smile: Nobody cares about what is behind a Facebook or Amazon web app anyway, just that it works well.

I too did not start out in PHP (done everything from assembler to Pascal to Python). PHP is a great language - over the past years I have become very proficient with it, even its object oriented features. I purposely haven’t looked at the code SC is generating, but my tests seem to indicate a good level of efficiency in terms of page load time, etc. I hope I never have to look at it anyway, as all custom stuff should be done thru the SC interface for making future upgrades easy.

I hope we can stay in touch periodically to see how each is doing. Feel free to send me a message thru this forum or its dircet message sytem.
Good luck!
Jamie

Re: Evaluating SC and trying to see how I can do this deployment…

I have been programming for about 24 years but newer to PHP

I got you by 2 years … does this mean I am starting to get old <vbg>

Was originally using the Yii framework but I’m struggling a lot. What I’ve been struggling for the last 2 months attempting to do, I had accomplished in 2 hours or so in SC

It depends on the app …The instant apps of SC can get you hooked.
SC is one of the best generators that I have seen. It has a lot of options and room for adjustments. As with any generator, you will have certain limitations.

In some cases, I was able to use SC apps. In other cases, I had to use another framework that allowed for complete control over the app. (i.e: open the editor and start typing)

Regards,
Scott.

Re: Evaluating SC and trying to see how I can do this deployment…

Hi Scott,
I am catching up on the number of posts - only 1014 to go :slight_smile:

I might be older than you guys. I graduated from USF in 1985 in Computer Engineering, but I also got my first chance to program a computer when I was in 5th grade. There was a class on computers, which the computer consisted of a terminal with a printer output and with a paper tape (like 1/2 inch wide with holes) for data and programs. Amazingly ancient even at that time (must have been if they let a bunch of 5th graders touch it), it must have tied into a mainframe at the school system or something. I can’t even remember who taught us, I was mesmerized by the computer.

Did you guys watch Star Trek? The low budget actually has saved that show over the decades. If they had more $$$$$ they would have built the bridge with O-scopes or those banks of flashing lights (aka Lost in Space), old teletypes or massive CRTs. I love the minimalism :slight_smile: Guess that’s why I like Google so much.

Oh I must confess, I do love to walk into servers rooms in the dark and see all the drive array LEDs flashing!
Peace,
Jamie