Opsworks Chef 12.0 manage two cookbook with one common file - aws-opsworks

I am using AWS Opsworks and have a stack of Chef 12.0 .. Question since in Chef 12 cookbook dependency is not supported.. I managed to create a cookbook that install my webserver and deploy an APP .. to support 2 APP in different stack they have different cookbook but has a common file which is installing the webserver (/recipes/webserver.rb) , is there a method that the cookbooks can just inherit/call a common file? Coz I don't want that if there are changes in the webserver recipe I have to update two cookbooks.
Thanks in advance

You can use include_recipe to include one recipe in another. You also might want to look in to putting the common logic in a custom resource and using that in both application recipes. Check out https://github.com/poise/application_examples/ for some examples of resource-driven application deployment.

Related

How to integrate two Symfony projects that are on different servers?

I have two symfony projects and that share the same database servers.
I would like to, if possible, from one project call some Entity/Repository of another. The problem is:
Both project are in different servers.
So, is there some way to, maybe using services, make the projects talk to each other?
I tried to create a service passing SERVER IP + folder directory but it returns an error like:
what i did:
Ia\:
resource: "ftp://172.21.0.6/src/"
what returns:
Warning: file_exists(): connect() failed: Connection refused in
Short anwser: no. You cannot use php classes of another project hosted on another host.
What you could do:
Talk http: Expose functionality of project A in api endpoints and call those endpoints from project B.
Introduce your own library: Factor out common functionality into a third project, namely a library that you install in both projects (using composer).

Is it possible to have both Magnolia Public and Author under 1 instance? If so, how?

Is it possible to have both Magnolia Public and Author under 1 instance in Jelastic? If so, how?
According to your request, I'm glad to inform you that you can easily deploy Magnolia Public and Magnolia Author under 1 instance.
As a first step, you should deploy the primary Magnolia application, you can find out that it's can be done in-one-click with help of the appropriate Magnolia CMS widget at our Marketplace
in the Portal/CMS section.
You can manage your applications and files there using Jelastic dashboard, FTP, WebDav or SSH access. In your case there is necessary to establish the SSH Access to the Tomcat instance
and perform the following:
cd /opt/tomcat/webapps/ && cp ROOT.war ROOT2.war
After the copying was finished restart the Tomcat instance.
Having reached this goal, you will obtain two separate Magnolia CMS applications.
Installed files are located at webapps directory which after the mentioned above actions will have two contexts
According to the official Magnolia documentation, it will be necessary to provide the changes in corresponding configuration files
also, it should be mentioned that the copied Magnolia application will have the same settings as an original context ROOT
so before the performing the required changes you should create another DB at your MySQL instance and then specify it for using of the second/copied application.
As a result, you will have two independent Magnolia application one of which could be set Public mode and another one to Author.

Tomcat or JBoss hosting 1 webapp with multiple websites

I want to have 3 websites, all with distinct public domain names but they all share a common java back-end SpringMVC server and use common static web resources like js and css files.
Rather than maintaining the UI code in 3 places, I'd rather run 1 server and deploy 1 WAR on a Tomcat8, Jboss or Wildfly cloud instance like OpenShift or AWS, but still be able configure my dns CNAME's to point to different paths on that WAR.
For example, here is where each domain would map to their respective endpoints but not have visibility of the others:
www.mydomainA.com ---> mycloudprovider.ip/sharedcontext/A
www.mydomainB.com ---> mycloudprovider.ip/sharedcontext/B
www.mydomainC.com ---> mycloudprovider.ip/sharedcontext/C
Is this possible? If so, what would be the steps to configure?
It is actually beneficial to configure 3 separate projects. They will all need to have their own application contexts, but can share a single parent POM. This will result in better load balancing performance. Also, since Amazon's pricing structure is such that it is cheaper to set up 3 micro instances than one powerful instance to run all 3 wars. Note: You can still have all 3 instances pointing to the same dataSource.
To solve the problem of duplicate webapp code, you can create a pom overlay using the maven-war-plugin. When Maven applies the overlay it will essentially apply a union of the files from your app with the files from the overlay. Any files that intersect will be used from the app rather than the overlay.
To solve the problem of duplicate java code, you can separate the common code into a new project and build a jar to use as a dependency.

Opensky Symfony2 Intetegration

Is there any Step by Step tutorial to configure ZF2 Client in Symfony2?
Since I want to integrate Opensky LDAP bundle in my case.
Have you read the README file from Github?
If you don't already have the ZF2 codebase available in the vendor path of your Symfony2 application, you may be interested in using git-subtree to pull in the LDAP client by itself. Instructions for this process are documented in this thread from the symfony-devs mailing list.

External classes/jar in OSGi

My application supports running on many dbms and it requires user to configure dbms connection setting and also provide the jdbc jar file.
Now the application is to be packaged as OSGi bundle. There will be another main jar which lanches OSGi server and starts the application as bundle.
Can you please suggest how can I package the application as bundle and let user provide the jdbc jar file.
Will it require something like the main launcher jar specifying JDBC driver classes as FRAMEWORK_SYSTEMPACKAGES property?
Thanks in advance,
Aman
There are two ways of doing this:
1) Adding the driver.jar to the classpath of the main launcher and, like you say, expose its packages via the framework by specifying that property (or actually you can use the FRAMEWORK_SYSTEMPACKAGES_EXTRA property to just specify additional packages, instead of specifying all of them).
2) Manually wrapping the driver.jar as a bundle, or doing it dynamically at runtime. For example, you could try to wrap bundles that are copied to a certain folder (similar to what Apache Felix File Install does) by using Pax URL or some other tool that can create a bundle out of an ordinary jar file for you (see http://team.ops4j.org/wiki/display/paxurl/Pax+URL).

Resources