Rails app not working, development mode, apache, viewing externally - ruby-on-rails-3

I have rails on a CENTOS 6.x VirtualBox guest with a Win7 host. I made a demo app and I can see the Welcome "You’re riding Ruby on Rails!" default page from the host browser. However, when I do
demo> rails generate controller Say hello goodbye
I get "something went wrong" when I navigate to .../Say/hello
I also notice that I get a "something went wrong" message inside the element of the "About your application's environment" page linked off the Welcome index.
I have:
turned off selinux
edited the text of the welcome screen and viewed the difference (from host browser) to verify I'm working in the right place
come here to look for help

The message "something went wrong" is given in production mode, in development you should see the actual error and backtrace. Make sure to specify the environment in your Apache config with
RailsEnv 'development'

Related

Installing Drupal on Fedora 29 Live USB

I followed this guide: https://fedoramagazine.org/howto-install-drupal-8-fedora/
Everything went well except that when I try to pull up the web page at localhost I get the apache welcome page.
I tried following the instructions (comment everything out) to not use the welcome page, renaming the welcome.conf to ~welcome.conf. Neither worked.
I'm sure it's something simple. I had the same issue trying to install Wordpress.

MAMP Pro 4.0.3: user running apache cannot access this directory

In the standard setup for MAMP PRO, version 4.0.3 in this case, using the htdocs folder for my sites I am getting the "red arrow" indicating a config issue. The highlight message is: user running apache cannot access this directory. Everything works fine but I'd like to get rid of this warning. I'd be happy to hear any suggestions.

Apache Crash Dialog

I'm running XAMPP on my windows machine and experiencing a problem with Apache crashing a couple times a day. When it does, a dialog pops up and I have to manually tell windows to end the program. After I do that, XAMPP automatically starts it back up in a couple of seconds with no issues. When it crashes while I'm not home though, the server is down until I get back. So I have two questions:
Are periodic crashes something that should be expected, or is this indicative of another issue I should be trying to pinpoint?
If this is something I should just learn to deal with, is there a way to automatically restart httpd.exe when these issues occur, so I don't experience down time when I'm away from home?
You'd look into log files, especially the Apache access and error logs, to see what happened, when you are not at home. I've met some similar situation: I have a problematic PHP script hosted on my server, when someone visits the page, it leads to an Apache crash.
I'd suggest you do the investigation as follows:
Search the timestamp of recent Apache restart.
Check the Apache access log to see whether there are some scripts have been accessed.
Manually access these scripts in your browser (to see if Apache will crash again)
You'd better check the PHP error log as well.
If there is really nothing suspicious, you can try WAMP bundle alternatively, which is also a very popular PHP development environment and it is stable.
Although there aren't many cases in which one should "expect" periodic crashes, in this case you are better of reconsidering your setup. From the frontpage of the XAMPP site:
XAMPP is the most popular PHP development environment
Sure, you can use it as "production" server, but XAMPP isn't build for hosting websites, it is intended as development server, so you don't have to manually setup Apache, PHP and MySQL on you dev machine. If you actually want to run your website for the public, setup Apache/IIS, MySQL and PHP manually, those products on there own are made for running in production. Or you can consider getting some cheap shared hosting somewhere, so you don't need to setup anything.

How to run Play Application on Apache 2 server?

I'm completely new to this, so please forgive me.
What I have right now is a Play application that, when I run play run on my personal Mac the site launches on localhost:9000 and everything works fine.
I also have a server running CentOS that tells me to "add content to the directory /var/www/html/" when I navigate to it's IP, but I don't understand how I can do that with a Play application? It's not like I have a bunch of HTML files I can just put there?
So my question is, what steps do I need to take to make it so if I go to the IP of my server, it takes me to the website I made and that is currently stored on my Mac?
You need to configure Apache as a "proxy" to your Play application (that's why you won't need to put anything into /var/www/html/).
Your application code can be uploaded anywhere you want on the server. It will need to be started on the server (with play start for example) and Apache will "forward" requests to the running Play application.
You can look at the Play documentation in the "Deploy your application" section :
"Deploying your application" (general recommandations) : https://www.playframework.com/documentation/2.6.x/Production
"Set-up a front-end HTTP server" (explain how to deploy Play behind Apache or Nginx) : https://www.playframework.com/documentation/2.6.x/HTTPServer

Sahi + PhantomJS fails when testing local PHP web app with behat

I'm having an issue testing a locally hosted web application with a behat+sahi+phantomjs set up.
I have run the full suite with just behat+sahi+chrome which works fine
I have also tested a small sample behat test against a live stie that works well
The issue appears to happen both when I point my base_url to either my locally hosted app or a server where that app has been deployed
Something as simple as this:
#javascript
Scenario: Get to the login page
Given I am on "/login"
And I should see "Email Address"
And I should see "Password"
Results in this output:
Given I am on "/login" # FeatureContext::visit()
And I should see "Email Address" # FeatureContext::assertPageContainsText()
Command execution time limit reached: `_sahi.setServerVarPlain('___lastValue___50ff0bcf186da', _sahi._getText(_sahi._byXPath("//html")))`
I'm using the setup detailed here: http://shaneauckland.co.uk/2012/11/headless-behatmink-testing-with-sahi-and-phantomjs/
Is this a configuration issue? Or because the app is also hosted on localhost?
What might I try to troubleshoot this further?
Thanks
The issue appears to happen both when I point my base_url to either my
locally hosted app or a server where that app has been deployed
Phantomjs does not seem to use the proxy for localhost. You can try using your machine name instead. Are you sure it does not work for your server too? Is it possible to post more details to reproduce this?