Configuring / Implementing Apache on cPanel - angularjs

I'll start by saying I am completely new to Apache.
I'm trying to make my way through this particular tutorial about enabling rich social sharing in an Angular.js app: http://www.michaelbromley.co.uk/blog/171/enable-rich-social-sharing-in-your-angularjs-app#_section-set-up-the-server-side-script
The author mentions three specific Apache modules that need to be enabled: mod_rewrite, mod_proxy and mod_proxy_
My question is - are these modules enabled by default on cPanel? Is there somewhere that I can see them in the user interface? How do I know they can be accessed for the particular domain I'm working on?

Related

iOS Universal link support in salesforce

We are looking to deep link our mobile application from Web page.
As per apple's documentation it require to have apple-app-site-association json file at root of https://xxx-salesforce.com/
Can anybody tell me how to place apple-app-site-association json file at root of salesforce domain?
We are using a visual force page where we want to put our app links.
Regards,
Manish Kumar
You write that you are interested in deep linking into your mobile application from a web page. As you mention the AASA file, you must be talking about an iOS app and not an Android app. Check this link for a good overview of what is required to set up deep linking to iOS apps: https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9/. Note that you would have to configure your own AASA file and host that on your own domain, not the Salesforce domain. You would then be able to use the deep links you create on Salesforce pages - or any other web pages, for that matter.
If I have misunderstood and you are actually hoping to deep link into an app that has been written by Salesforce, well this is a situation where Salesforce themselves would need to host the AASA file and configure the iOS project to support the deep linking scheme. This is something that only Salesforce is in a position to do.

Hosting Angular fullstack project

I started a new Yeoman angular-fullstack project (client-angular.js, server-node.js)
(generator: https://github.com/DaftMonk/generator-angular-fullstack)
I have 2 seperated directories for client and server,
I want to launch the app but the deployment don't show any index.html file,
The question is, Should I make 2 different hosts for the server and the client?
if no, how can I host and use the united projects?
No, it is not needed to create 2 different hosts for the server.
The server needs to point to app.js, usually located at server/app.js, as this is the entry point (instead of index.html) of your app. How this is done depends solely on the server you intend on using.
If you consider using IIS you can take a look at: Installing and Running node.js applications within IIS on Windows
As for the other deployment options, as laggingreflex said, "Heroku is the popular choice to host node.js projects". The angular-fullstack git site has more information on deploying to Heroku or Openshift.
As a side note:
Deploying to IIS requires a bit more attention than the information in the link specified. You need to set file access, create a web.config file as well as a few other stuff. At least, I had to...
You'll need a host that supports MongoDB assuming you kept the Database the same after generating your application. Heroku is a great option as it allows you to setup up plugins like mongolab or mongohq fairly easily. I would also recommend looking into Digital Ocean as they allow you to set up a droplet/server that has what you need for the application to run.
If you go with Digital Ocean and are a student check out https://education.github.com/pack. You'll actually receive $100 credit towards a new Digital Ocean account which will let you test things out.
Good luck!

Setting up custom domains (with subdomains) on Google App Engine with SSL with different versions of app

Problem I want to solve
I want to be able to send different users to different versions of my Google App Engine application, on a custom domain, with SSL enabled. This needs to be done in a controlled way, i.e., even landing page should be different, and it has to work on multiple units for the user.
Solution I can't get to work
I am trying to setup a custom domain with sub-domains, and want to be able to access different versions of the application. For example, I have myapp.mydomain.com, and I want to run one version (alpha) on alpha.myapp.mydomain.com, and one version (beta) on beta.myapp.mydomain.com (where alpha is default).
I use the Google Developers Console to set up custom domains, using myapp.mydomain.com, and *.myapp.mydomain.com as custom domains.
This works perfectly as long as I don't try to add on SSL as well, i.e., beta.myapp.mydomain.com serves the version named beta. When I set up SSL I start by adding my application to Google Apps, (per https://developers.google.com/appengine/docs/ssl) and then set up my domain to point to my app. First I add myapp.mydomain.com, then alpha.myapp.mydomain.com, and last beta.myapp.mydomain.com.
When that is done beta.myapp.mydomain.com start to serve the default version instead. Except that it sometimes also serves the beta version (this happens one in every 20 tries or so, I assume it's a glitch for now).
My questions:
a) Should I set up my domains in both Google Apps and Google Developer Console? Or should I remove the setup from Google Developer Console? I tried both, seems to give the same results.
b) It seems like it is possible to get it done by using modules as indicated in
Google App Engine custom domains, subdomains and SSL and in Appengine modules dispatch.xml routing with custom domain. Is this the only way, or am I doing something wrong in my setup?
Suggestions I have received so far
One suggestion is to use traffic splitting and set a unique cookie depending on what version I want the user to end up with. I did not know about this, and it will solve some other issues I have been looking at. It does not solve my current problem though, as I need to have this set before log in. The answer is useful though.
I'll answer with what I did to make this work for me.
Instead of sending users to different versions of the app, I created a new module called alpha, and directed users using alpha.myapp.mydomain.com to that module using dispatch.xml.
<dispatch>
<url>*alpha.myapp.mydomain.com/*</url>
<module>alpha</module>
</dispatch>
I set up custom domains in the App Engine Console (https://console.developers.google.com) under Compute->App Engine->Custom Domains, for *.myapp.mydomain.com and alpha.myapp.mydomain.com. I also added the URL alpha.myapp.mydomain.com to the accepted URLs for my App Engine app on Google Apps (https://admin.google.com). This allowed me to run over SSL as well.
I intend to run the app under another domain (domain alias to my primary domain), so I tried that as well. To make this work I ONLY added the domain alias in Google Apps as www.mydomainalias.com and alpha.mydomainalias.com, because if I added it to Google App Engine custom domains I got an error message ("We are unable to process your request at this time. Please try again later. (Error #1000)"). I have no idea why it that did not work out.
The easier approach is to do traffic splitting on a cookie level compared to setting up extra subdomains AND extra SSL certificates.
The domain name to access your alpha version does not have to change using this approach.
from the docs :
The response from your app does not already contain a Set-Cookie:
GOOGAPPUID=... header. This allows your app to control which version a
user gets.

Custom domain mapping to Google App Engine module or version

Suppose I have a Google App Engine application which has several modules which have several versions. Can I map a custom domain name to a specific version of a specific module of the application?
For example:
http://www.example.com should be mapped to http://module1-dot-app1.appspot.com
1.Mapping a module to custom domain
Let's suppose you are admin for domain example.com and you want to map subdomain www.example.com to module webmodule in your application myapp.appspot.com
www.example.com -> webmodule.myapp.appspot.com
What you can do is going to admin.google.com and in App Engine Apps section configure your application so that it is mapped on web address www.example.com. Of course follow the instruction for configuring your domain (you should add a CNAME entry in your DNS configuration with ALIAS www and HOST ghs.googlehosted.com).
Once you did this, web address www.example.com is linked to your application default module. For redirecting to webmodule you need to configure application internal routing with dispatch file, as reported here:
https://developers.google.com/appengine/docs/python/modules/routing
In your case what you need is something like this (this is from dispatch.yaml file for Python application):
dispatch:
- url: "www.example.com/*"
module: webmodule
2.Mapping a version to custom domain
Regarding versions, it seems you cannot map an url to a specific module version. What you can probably do is mapping an url including version to a specific module, but this is maybe little bit confusing.
As thetonrifles already pointed out, you must use the dispatch.yaml file, which goes in your default module.
However, I also came across some issues when using secure domains/subdomains. If you've already uploaded your SSL cert for your custom domain, and you add custom subdomains after the fact, you need to go back to the SSL cert section and enable those subdomains you added, otherwise they'll just keep showing blank.

How can I turn an Eclipse GWT/GAE app into an Eclipse Tomcat/mySQL app?

Sorry in advance for the long post but the problem I am facing here is quite crucial for me, so here we go...
I have a Eclipse GWT (2.0) Web Application using the the GAE and making transactions with its datastore.
On the other hand I would like to make sure that I can also deploy this web application on another infrastructure than the Google App Engine. Therefore I wanted to debug my web app using another servlet container (Tomcat 6) and another datastore (mySQL or MSSQL or any other, it doesn't really matter for now.)
In order to be able to debug an Eclipse web app with Tomcat it has to carry the Dynamic Web Project facet. If it doesn't then the new server that I add to Eclipse within Servers refuses to pick my GWT module in its list of supported apps. And not only GWT Web Apps don't carry it, but they don't even allow to alter the project's facets at all!
However, I found that adding the few relevant tags to the .project file can make it eligible within Eclipse to allow new project facets additions. Here are the tags I used:
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
So I did that, I could "turn" the project into an Eclipse's Dynamic Web Project and by doing so made it compliant to be added to the list of modules handled by - let's say - Tomcat 6 within Servers.
So that is exactly what I wanted, I can now switch between two debug configurations at will in Eclipse in order to debug my GWT web app either on the App Engine or on Tomcat.
The problem is that adding the Dynamic Web Project facet disturbs the DataNucleus enhancer. For some reason, once the project has become a Dynamic Web Project, it seems that the enhancer is never called anymore and I get this error message saying that some classes haven't been enhanced. Playing with the Google... App Engine... ORM classes or checking/unchecking the Enhancer in Builders wouldn't change anything. Please note that the enhancer issue affects both debug configurations: Tomcat as well as the App Engine.
So I was thinking of two solutions.
(1) Disable the Google plugin's DataNucleus enhancer and perform the enhancements myself. So I installed the DataNucleus plugin to configure project specific enhancements by following their guide about the Eclipse plugin.
They say that by right-clicking on the project one can activate DataNucleus support for the given project's files. Unfortunately, after installing the latest version of their plugin for Eclipse, no such right-click menu appears! I have therefore no way to tell their plugin that I want to activate the enhancements on a given project! How frustrating is that?? (I uninstalled/reinstalled the plugin, let perform plenty of pending Eclipse updates... but still no right-click menu.)
Does anyone know of another way to activate DataNucleus enhancement? For now I would be happy even with a pretty manual trick as it is very critical for me to be able to perform this cross-servlet container debugging within Eclipse.
(2) Use this tip from the official GWT website http://code.google.com/webtoolkit/doc/latest/FAQ_DebuggingAndCompiling.html#How_do_I_use_my_own_server_in_hosted_mode_instead_of_GWT%27s
Ok that works, and for now let's say that it saves my life BUT... it requires hosted mode and therefore doesn't allow the use of GWT 2.0.
So regarding this workaround I would like to know if there is a way to do something similar under GWT 2.0?
Turning the GWT Web App into a Eclipse Dynamic Web Project would be the ideal solution for pursuing the development of my application. As I said above, that way, it is very convenient to switch from the App Engine to Tomcat and vice versa. So I favour workaround (1) over workaround (2). But anyway, some help or piece of advice regarding any of the two points will be very very welcome.
Thank you for reading this very long post!
I always use Google Plugin (GPE) for GWT development even when I deploy to Tomcat, where I simply disable GAE option.
Perhaps, I don't understand the question - but I have had no problems debugging my app running on jetty and then transferring the app to Tomcat. Are there any issues that I need to learn?
In fact, even when my app is plain jsp or servlets, without any GWT, I still used GPE. But GPE would refuse to run jetty without either GWT or GAE enabled. So I simply create a dummy GWT app. In all my years, I had never had to worry about differences between jetty and tomcat. And if I had to write an app where I had to exploit the differences in tomcat over jetty, I would consider myself a lousy programmer.
The only reason I see to push JEE server into an external server, is for profiling the app as it runs on tomcat.
JEE is JEE, whether Tomcat or Jetty. I have heard that some people have a bias against using Jetty, like preferring starbucks over neighbourhood cafe. Coffee is coffee.
I don't understand. May be you could write another thesis to explain why you cannot debug on jetty and then deploy on tomcat.
I ran into the exact same problem, I could edit the properties of my project and see the datanucleus menu in the context so the plugin was definitely working. My issue was I was using the "Java EE" perspective in eclipse. (Juno btw). I switched to the "Java" context and my datanucleus menu was back and I was able to enable support and enable automatic enhancement.
Window -> Show perspective -> Other -> Java

Resources