Nginx + PHP5-FPM break some web app which works on Apache + PHP5 - zend-framework

I have a vps with Debian 6.0.5, installed with Nginx + PHP5-FPM using package from dotdeb using a setup script introduced by a blog. Everything works like charm for my wordpress and phpmyadmin.
Now, I wanted to install beanstalkd into the vps, and decided to use some PHP web app to manage beanstalkd. I've installed phpBeanstalkdAdmin and Beanstalkd console. Both failed to run properly.
phpBeanstalkdAdmin returns a page like
phpBeanstalkdAdmin
Home
About
layout()->content?>
Beanstalkd console displayed an empty tube once server is configured. Before that, the error message is also missing.
When I install both in my local machine running XAMPP, which is Apache + PHP5, and point the configuration to my vps' beanstalkd, it works. Further more, before configuration Beanstalkd console would display proper error message unlike when running on Nginx + PHP5-FPM.
I've tried to use XDebug and didn't find any error or anything wrong when stepping through both web app. Both web app utilizing Zend Framework. I didn't find any specific setup which is required to run Zend Framework on Nginx + PHP5-FPM, and have tried various addition of the basic configuration such as fixing Path_Info & PHP_SELF
I would really love to use Nginx instead of Apache for my vps as I have a small box.
Any insight or guide on this issue is much appreciated.

Check the value of PHP's short_open_tag on both (should be listed in phpinfo). My guess is you need to turn it on for your VPS.

Related

angular cli app with socket.io on IIS

I made a small simple chat-app, using angular and also socket.io. Now i want to deploy it on IIS 7. The angular-app works fine, but socket.io can't be found...
"zone.js:2935 GET http://localhost:4200/socket.io/?EIO=3&transport=polling&t=M5x4rhh 404 (Not Found)"
When running the server-dir (socket.io) via npm start, theres no problem.
But as far it runs on IIS it cant be found.
I'm really desperate 'cause I've no plan what I'm doing wrong.
IIS
Sites
--chatapp <--angular-app (dist-dir)
----server (socket-io)
Hope you may have some adivices :)

How to create openshift application for OPENSHIFT ONLINE 3 STARTER (NEW!) server in Eclipse IDE?

I am trying to create an openshift3 application in Eclipse IDE after installing JBoss Developer tool plugin in IDE, But getting below error at the time Sign into OpenShift.
Error: The server type, credentials, or auth scheme might be incorrect:
I have also tried other server hostname like https://console.starter-us-east-1.openshift.com/console/ and much more, but still not working.
While, when I tried to log in using OC tool (OpenShift CLI) with the same credential (as seen in picture), I haven't got any error.
I also tried to run RHC (OpenShift Client Tool) but at the time of RHC setup it is saying "You are not authorized to perform this operation."
Please help me to solve it out.
First of all, it looks like you're using an outdated version of the JBoss Tools Openshift plugin, because the "New Openshift Application" wizard looks a little bit different at the moment. So try to update it:
Help -> About Eclipse -> Installation Details -> Update... - and choose at least all the JBoss Tools plugins that it'll report to you (the best will be to choose everything reported) and update them.
Secondly, what is the URL which you use to access the Openshift web console in your browser? It seems to me that it is https://console.starter-us-east-1.openshift.com. Are you able to login there with your credentials? If yes, the same must work in JBoss Tools Openshift plugin. Check this and this articles for more info about using it.

How to deploy angular2 on tomcat?

First I'd like to describe my set up:
I have a web service, let's call it "Cars", written in Java, that I've tested in eclipse with tomcat v6, working local (it was a requirement, so that once it works locally I can switch to do it with a "real" tomcat server so others can access). It works, it access the database, it offers an answer for certain URIs and so on.
I have coded in Plunker an angular 2 application, "WebCar", and I now want to run that on my computer, with a Tomcat server (unless there is a better way of doing it, I've been told to do it with Tomcat. Since I do not know any better option, that's why I talk about tomcat all of the time). With eclipse, I have already managed to get the app running, using palantir plugin for typescript https://marketplace.eclipse.org/content/typescript , and then running the project with a server-launch.js which contains require('lite-server'); , this allows me to see the same I saw on plunker, so, it works, but before I upload anything to the business servers I wanted to check everything works (hence the set up, which may not be necessary but it's what I come up with).
I now want to go one step further and use, if possible, tomcat v6 to run my angular 2 app, instead of simply using that lite server, so that I can test that it works, and then uploading it to a "real", remote server.
I would like to know what options are there, what would be a better option, and anything that is required to make an angular 2 deployment properly. So far I've found this
https://stackoverflow.com/a/34408495/6028947 " You only have to deploy
.js files, since anyway browser won;t" which I don't fully get,
http://jspm.io/ which is for SystemJS (I have an older version of
Angular 2 and use config.js)
https://stackoverflow.com/a/37568235/6028947 which talks about
angular-cli or webpack, which makes a bundle but if I got that
running, I still don't know what to do with it to upload to Tomcat
and then connect it to my web service.
So maybe the question should be (I don't know for sure): Once you get your angular 2 code bundled, what's next?
Btw there are a few other questions on stackOverflow, similar to this, but as far as I've seen, without any answer at all or with answers only obliquely related to this (and of course, nothing resembling a guide or step by step required)
Thanks to #nuzz for this ..
I'm running a little script to build the project and then copy it to tomcat. I'm telling angular what the base directory is that it will run under in tomcat.
#!/bin/sh
ng build --base-href /angular/ --prod
mkdir -p /home/xxx/apache-tomcat-8.0.37/webapps/angular
cp -R /home/xxx/angular-clitest/dist/* /home/xxx/apache-tomcat-8.0.37/webapps/angular/
Once thats run, start tomcat and you can access it at: http://localhost:8080/angular

How do I make the web server run "constantly"?

I have a Play application at ec2 which I just have deployed. Everything seems fine, it's visible in the Internet. However, it seems fine only as the server is working. What I mean is that when I connect to ec2 via ssh and then launch the server by play run, only since then it's visible in the Internet and works fine. I know it's obvious. But I tried to run it in background by play run& and it never worked:
$ play run &
[1] 2470
$ jobs
[1]+ Stopped play run
$ play run&
[2] 2494
$ jobs
[1]- Stopped play run
[2]+ Stopped play run
Have I been doing something wrong? But what and what should I do?
You should prepare your application for production as discussed in the docs. You might also consider running it behind Nginx or Apache or another web server.
Besides also recommending running production using a reverse proxy with Apache or Nginx. (Pretty much the de facto standard these days on Linux), you can also deploy it using the play dist command. Basically, it will compile your code into a package and put it into a zip file.
You can unzip your zip file wherever you want to run your application then you can just run it with:
$ ./<yourapplication>/bin/<yourapplication> -Dhttp.port=<whichever port you want to run it at> &
Make sure you have the java executable in your PATH and this method will avoid having any dependency with the Play application itself. Eventually, you'll probably want to create a Linux init script if you need to deploy your app into multiple servers say behind a load balancer -- So you can your just run service <your-app> start or service <your-app> stop
More info here: http://www.playframework.com/documentation/2.2.x/ProductionDist.
Also, make sure you look at the latest play documentation as it gets updated pretty often.

404 error when trying to run PHP application on Glassfish 3.1.1 through Netbeans

While there are some similar posts about this issue, none seem to fit my problem exactly, so I would like to ask if anyone knows what I am doing wrong.
I am trying to run a PHP web application that I created in Netbeans. I am using Glassfish 3.1.1 as the web server. Whenever I run the application through Netbeans (by selecting the project, right clicking to get the context menu, then selecting "Run"), my browser opens to what I believe to be the correct url, but all I get is a 404 error page stating the following:
type: Status report
message:
description:The requested resource () is not available.
Am I missing some crucial configuration step?
I have checked my hosts file and it contains the entry:
127.0.0.1 localhost
Is there something else I need to do?
I have PHP 5.3.8 installed and all php commands run from the command line.
Would it be something in the php.ini file that needs to be configured?
I am stumped. Any help would be greatly appreciated.
ANSWERED
Please accept the comment below from Jonathan Spooner as the correct answer.
Just install Quercus within GlassFish 3.x and you can run PHP and Java.
As I stated in the comments, GlassFish and Apache Tomcat are Java application servers. In order to serve PHP pages you'll need to install a web server such as Apache HTTP web server. You'll also need to configure Apache to serve PHP files.
Something that you might look into is WAMP (Windows/Apache/MySql/PHP). This offers a simple way to get up and running quickly with little to no configuration.