I am trying to construct a credit card applicatoin in PHP that helped me to configure new websites.
New sites will be with different specific "codebase", that contains all necessary web files. I would like my PHP script copying individuals web files in one domain's webspace to a different domain's webspace. After I click a control button, a clear webspace is populated with files from another domain. Both domain names are on a single Linux/Apache server.
Being an experiment, I attempted using spend and professional instructions in PHP to do actions as "root". (I understand this could open major security holes, therefore it is not my ideal method.) However I still had similar permission issues and could not have that approach to work either.
But I am encountering permission/possession issues when copying across domain names. Perhaps a CGI script is really a better idea, but I am unsure how to overcome it.
Any advice is appreciated. Or, knowing of the better resource for this kind of information, please point me toward it. I am sure this kind of "website setup" application continues to be built before.
i am also doing something similar to this. Only difference is the fact that i am not making copies from the core files. the machine has one core and just specific files are replicated.
if you wish to copy files then you've to take consideration the next:
a simple (less guaranteed way) is by using exactly the same user for those websites
otherwise (just in case you need to provide different accesses) - you have to produce a different owner for every website. you have to set the dog ownerOrteam for that replicated files (this is made by root).
for that new website setup: either primary domain will run as root, after which it'll have the ability to perform new website creation, or if you do not would like your primary domain to become root, that you can do the next: produce a cronjob (or php script that runs inside a loop under CLI), that'll be performed by root. it'll check some database record every 2 minutes for instance, and you will add out of your primary domain an archive with setup info for brand new located website (or simply execute some script that gains root access and will it without cron).
the script that produces this is often completed in php. it may be completed in any language you want, it does not really matter as lengthy because it will get the right access.
during my situation i am utilizing the same user being that they are my websites. disadvantage is the fact that OS will not create limitations, my php code will (i am losing the benefit of customers/groups permissions between different websites).
observe that open_basedir may cause you some hassle, make certain you exclude correct pathways (or disable it).
also, you will find some minor variations between fastCGI and suPHP (in my opinion it will not result in an excessive amount of trouble).