Hosting a laravel project on openshift - ssh

I am pretty new to hosting on Openshift and also pretty new to Laravel.
I have a laravel project on my local system. What are the steps to successfully host the project on Openshift.
I tried the Quickstart guide, to load from a github repo. So i uploaded my project onto github
I had the env files kept secret by adding them in gitignore ( Should this be done ?)
I have the ssh key set up with rhv setup. Made a private key with Puttygen and can connect via Putty.
I checked if all the code has been uploaded to the openshift server with Putty
But my website gives a 500 Internal Server error.
What am i doing wrong ?
Edit: I connected to the server via ssh and found this error
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/lib/openshift/558bfb764382ec89c3000084/app-r oot/runtime/repo/public/index.php on line 50
Edit 2: On exploring the code on line 50 This is supported only on PHP5.5 or above. So i guess this is the problem ?
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
Is there any fix ?
How to fix this ?

You should try checking out the laravel 5 quickstart on the OpenShift Hub (https://hub.openshift.com/quickstarts/115-laravel-5-0), check out the source code and see what modifications were made to make it run correctly on OpenShift and then incorporate those changes into your application.

Related

How to overwrite the api proxy deployment using apigeetool

I am using the below command in jenkins to deploy the api proxies to apigee edge.
apigeetool deployproxy -u abc -o nonprod -e dev -n poc-jenkins1 -p xyz
But am getting the below error.
Error: Path /poc-deployment-automation conflicts with existing deployment path for revision 1 of the APIProxy poc-deploy-automation in organization nonprod, environment dev
Here is my requirement , please help me what command to use.
If API doesn’t exist in target environment, Create Api in new environment with version 1.
If API already exist in target environment, Create Api in new environment with new version (previous version + 1)
So what command should we use to fix the above error and what should we use to do the above 2 tasks.
Help Appreciated.
The apigeetool deployproxy command supports by default your requirements. It deploys the revision 1 if there is no proxy with the name, and increases the revision if it already exists.
However, based on the error you mentioned, it seems that you have a path conflict between two proxies. You are trying to deploy a proxy to a /poc-deployment-automation basepath, but there is another proxy called poc-deploy-automation which is listening on the same basepath. It is not possible, even if the proxy name is different, because the basepath is what apigee uses to redirect traffic to your proxy.
Check the xml file at the root of your proxy and change the basepath attribute.
Also, the basepath of an API Proxy can be anything, but could not be the same used at the same time by two proxies--only one can be deployed at time. The revision numbers are irrelevant in this situation.

FTP using wso2 EI611 vs Apache-CommonsVFS3.6

Created a carbon app using WSO2 ei611 using Inbound-endpoint-file.deployed
on WSO2.
Works good for local files.
When given FTP url
(ftp://username:password#servername/folder1/folder2/folder3), throws warn-
error WARN FilePollingConsumer Unable to access or read file or directory : username":#"servername/folder1/folder2/folder3. Reason: The file does not exists!
Used hexadecimal password in the url(as password had spl chars), still did
not work.
I changed all FTP folders/subfolders to 'chmod 777', still no luck.
I know, EI611 use apache-commons-ftp. The error string, is used in this library.
I then downloaded apache-commons-net-3.6 and used the same library and ran
a FTP client java from WSO2 server machine , and it works fine , in
connecting to FTP server, using java.
So, where's the problem? Hello, WSO2? care to answer?
adding vfs.passive=true did the magic. Thanks for the tip. I did saw this paramter earlier while developing, but ignored it, thinking, it is of no value.

GeoDesic Buffers sample code does not work in my local IIS Server

I am new to use ArcGis Api for javascript, I am using JS Api 3.20.
I have been trying for 3 days but it does not work.
I have taken code from the following link
Geometry Engine - Geodesic buffers | ArcGIS API for JavaScript 3.20
I paste this in My Html file create in VS website for .Net , and setup a local server for my page using IIS server
I also downloaded proxy from GitHub resource-proxy/DotNet at master · Esri/resource-proxy · GitHub
setup it in same application in IIS
Downloaded excel file added in my application from https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv
but still I am getting the following error in console using developer mode when set Proxy URL to this
config.defaults.io.proxyUrl = "/192.168.8.188/Proxy/proxy.ashx";
GET http://192.168.8.188:1555/192.168.8.188/Proxy/proxy.ashx?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv 404 (Not Found)
and when I set proxy url to this
config.defaults.io.proxyUrl = "/Proxy/";
then the following error occurs in console
GET http://192.168.8.188:1555/Proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv 403 (Forbidden)
Could you please help me out. I would be thankful in advance.
I Resolved My Issue thanks.
Basically I didn't enable IIS 4.5 web features so I read readme file of proxy which resolved my issue.
Here is what I read from ReadMe file located in DotNet folder of Proxy
Troubleshooting: If you get an error message 404.3, it's possible that ASP.NET have not been set up. On Windows 8, go to "Turn Windows features on or off" -> "Internet Information Services" -> "World Wide Web Services" -> "Application Development Features" -> "ASP.NET 4.5".
First off, try setting the proxyUrl value to this:
config.defaults.io.proxyUrl = "/proxy/proxy.ashx";
That may resolve the issue.
EDIT (based on clarification that IIS is in fact running on port 1555):
You might want to confirm that you can access the proxy at all, by entering the proxy url directly in your browser (with no arguments), eg:
http://192.168.8.188:1555/Proxy/proxy.ashx
If this resolves correctly, you should get an error response in JSON format like this:
{error: {code: 400,message:"This proxy does not support empty
parameters."}}
That at least would confirm that the proxy is accessible and functioning properly on your system.

Trying to run Apache Apex's Yahoo Finance example on YARN

I've downloaded Apache Apex 3.5.0 along with Malhar 3.5.0.
I've successfully started the apex client and submitted the Yahoo Finance demo example to our YARN cluster (running CDH 5.10). The cluster is running and configured properly (many Spark and MR jobs are running on it).
I see the application I submitted as RUNNING in YARN as well as in the Apex cli. However when I try to connect to the Application Master I get a 404.
org.apache.hadoop.yarn.webapp.WebAppException: /: controller for default not found
I also tried directly to connect to the appMasterTrackingUrl reported by get-app-info command, and I get the same error.
I tried a couple of apex examples, and I always get the same error.
Any idea why?
It is somewhat expected. Add "/ws/v2/stram/info" to the URL path
When you connect to the App Master you need to provide the complete URL for a REST API to invoke. There is nothing to show/return for "/" so what you are seeing is expected. What are you trying to do connecting to the App Master?

Unexpected error: CLIENT_ERROR on Openshift

Following the guide at https://www.openshift.com/developers/download-cartridges i wanted to try installing the CDK to see what it brings to the table. Unfortunately, I was unable to install the cartridge because of the following error:
Unexpected error: CLIENT_ERROR: Download of 'http://cdk-claytondev.rhcloud.com/archive/2ccd7a3a7762e4ebb873c0d64a247b180e0600b8/cdk.zip' exceeded Content-Length of 9728. Download aborted.
Execute rhc create-app cdk http://cdk-claytondev.rhcloud.com/manifest/2ccd7a3a7762e4ebb873c0d64a247b180e0600b8 against a local installation of OpenShift Origin. Or try to create an App throught the web console (again on a local installation, both are untested on rhcloud).
Looks like this was an issue on OpenShift Online also, which got fixed, but is still an issue on OpenShift Origin. Here is the bugzilla ticket for this issue (https://bugzilla.redhat.com/show_bug.cgi?id=1017776), I suggest you add your email address to it to be notified as they make progress against fixing it.