I was created a PHP 5.4 application with Web load balancer and mysql 5.5 support on openshift free plan. My problem is when I login into my app via SSH delete the index.php file in app-root/runtime/repo folder (Openshift web folder) and create new test.txt file, my application doesnt show test.txt file. It still shows Openshift welcome page when I access my application.Then I delete test.txt file. The app-root/runtime/repo folder is empty. I tried create new file name 'blahblah' in runtime folder and access but still nothing, only 404 page. However, restart the application doesn't resolve the problem! The problem only happend when I add 'Web Load Balancer'. Without load balancer, my PHP app working normaly event I delete index.php file
When you use the "Web Load Balancer", it runs in front of your application and monitors which of your web servers are up and running. You can visit http://app-domain.rhcloud.com/haproxy-status to view the status of your backend servers. If nothing responds at the root context (/) of your application on the web servers, the haproxy thinks it is down and takes it out of rotation. You have to have something (even a blank index.php or index.html) page so that the haproxy will get a status 200, or change the url that is monitored in the haproxy.cfg file on your main gear.
Related
I've installed Transcrypt, compiled the Hello Solar System demo, and run it as instructed using the python web server.
However, I was also able to run the hello.html file directly from Chrome on Windows 10 ... once. Subsequently it refuses to run - the buttons appear but clicking them does not update the text.
------- EDIT ---------
Thanks - CORS is the problem - the browser must connect to a web server, not a file on the local filesystem.
You've probably run into a security policy of Chrome called CORS. Start a webserver from the directory where your html file is, using python -m http.server, and browse to localhost:8000. In your browser window, click on the html file and things should work.
I want to debug in a remote server, which is, by the way, a Vagrant machine. Not really a remote server, but this has a peculiar setup: the shared host/vagrant machine folder isn't related to the web server files.
The server is configured with Zend Framework.
I have, locally, to deploy to the machine the following folders (as Zend Framework structure):
/home/user/webStuff/web
Inside web: config, data, module, vendor and public folders
Inside public folder I have the index.php, which handles all server requests.
Following is the server deployment configuration:
When I press "Test SFTP Connection" everything is fine. When I press "Open", the website opens.
And here, is the "Mappings" tab on the deployment configuration
Everything seems OK, here. At least from my point of view.
But when I test the settings, in Run -> WebServer Debug Validation, it gives me "Failed to collect files: Invalid relative file name". I've tried more settings, like placing /web/public in Web path, but with no success.
In Settings -> Languages & Frameworks -> PHP I have a good configuration for the server vagrantmachine.com, with XDebug version correctly displayed.
Also, I've placed the following in xdebug.ini:
xdebug.remote_connect_back = 1
xdebug.remote_enable=1
I've searched and tried a lot, but with no success.
I'm no specialist in these server configuration things, but if you need any information, just ask.
"Deployment path on server" and "Root Path" were wrong.
Like #Eugene Morozov said, I changed the root path to "/opt/webStuff" and deployment path to "/" and it worked out.
I have little problems with deploying an application.
I have an PHP environment. I have uploaded an .zip file in it containing 3 files - one.php, two.html and three.html. The problem is when I click on the environment URL also on my pure domain example.com I get the following error:
Forbidden
You don't have permission to access / on this server.
However when I type the address with its extension, for example environmentURL/one.php or example.com/one.php it works great.
Can someone help me with this please. Why I'm unable to access my app via its first primary page?
You can't access your app via primary page because your app is missing an index. Add an index file (index.php or index.html) to your zip bundle and it should work.
When I select a html file to open "in browser" in Webstorm it works and it opens under the localhost. The issue I'm having is that this webstorm internal server is not detecting any of the other paths in my project root like images and javascript files.
I should note that this feature has worked before on other projects I started from scratch using "new project." The difference with this project is that I opened a directory as a project.
The built-in webserver serves files from http://localhost:<built-in server port>/<project root>. Forward slashes in URLs tell the browser to resolve them relative to the web server root (localhost:63342 in your case), causing 404 errors.
If you like to change the default web path on built-in web server, you have to re-configure the server by editing your system hosts file accordingly - see http://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559.
I built a site using a php openshift project and accessing the root directory via http works fine. However, all the root directories give me a 404 not found, like this one: http://test.toppagedesign.com/sites/
I checked with ssh, and /app-root/repo/sites and app-deployments/current/repo/sites/ both exist.
EDIT
Added a directory called php and now I have 503 errors for everything...
EDIT 2
I deleted the php directory, now the 503 errors are gone. However, I do still get 404 errors for the subdirectory.
Here is my directory tree: http://pastebin.com/hzPCsCua
And I do use git to deploy my project.
php is one of the alternate document roots that you can use, please see the March Release blog post here about this (https://www.openshift.com/blogs/openshift-online-march-2014-release-blog)
As for the sub-directories not working, can you ssh into your server and use the "tree" command to post the directory/file structure of your project? Also are you using Git to deploy your project or editing files directly on the server?
You need to have an index.php or index.html file in any directory that you want to work like app-domain.rhcloud.com/sites , if you just have sub-directories, how would it know what to show? Also, indexing (showing a folders contents) is not enabled for security reasons, and I believe there is no way to enable it.
This sounds like it could be a problem with how you are serving your static content.
I recently created a new sample app for OpenShift that includes:
a basic static folder
an .htaccess file (for serving assets in production)
support for using php's local server to handle the static content (in your dev environments)
Composer and Silex - a great starting point for most new PHP apps
You can serve the project locally if you have PHP-5.4 (or better), available in your dev environment:
php -S localhost:8080 -t static app.php
For a more advanced project that is built on the same foundation, take a look at this PHP+MongoDB mapping example. I wrote up a blog post with some notes on my process for composing that app as well.
Hope these examples help!