I have a relatively simple refinerycms setup ( just getting started ), but have hit a problem loading images on my web page in production environment.
see http://saigos.net:3000 for where it works fine in dev ( webrick ) If I start the server in production with webrick, it also looks ok.
see http://saigos.net for where it doesnt work in production ( apache2/passenger )
Viewing the page source for each, I see ref to the image :
/system/images/W1siZiIsIjIwMTMvMTAvMTMvMTJfMTJfMjlfNTgwX3Rva3lvdG93ZXIuanBnIl0sWyJwIiwidGh1bWIiLCI0NTB4NDUwPiJdLFsicCIsInN0cmlwIl1d/tokyotower.jpg"
A file of this name obviously doesn't exist on the server, and I figure is being created dynamically in the page source by rails/refinery, I'm wondering if this can be used to help debug, but not sure where to take it.
I had a good dig around on the net, but only find examples of a similar problem where people are using Heroku and/or S3, neither which i'm using, and doesn't seem that the knowledge there can be applied to my case.
If anyone can give me mental nudge of what to check further, that will be appreciated, i've come to a bit of a dead end with this one.. :
Running :
Refinery CMS 2.1.0
sqlite DB on both dev and prod ( yes i know one is supposed to use something 'stronger' such as postgres in production, and i'll be exploring that once i fix this issue )
Rails 3.2.13
ruby 1.9.3p194
Ubuntu 12.10
Amazon EC2 micro VM ( not using S3 )
I found the issue.. after seeing this error in /var/log/apache2/error.log
[ 2013-11-23 11:49:53.3999 3060/7f5258d00700 Pool2/Implementation.cpp:1274 ]: [App 3083 stderr] cache error: Permission denied - /opt/refinerycms/saigo/tmp/cache/ABD
I changed the permissions on the file, and hey presto, the image now loads..
Related
I’ve inherited a Laravel 5.3 application that does not appear to be logging web processes or anything else on the server-side in my development environment. Here’s the things I’ve tried/confirmed.
Set APP_DEBUG = true
storage/logs exists and all users have read/write/execute permissions
I’ve created an empty laravel.log file, thinking it needs to exist before it can be written to. I’ve also run the app without that file.
FWIW, this app is running in a vagrant instance and has debugger bar installed.
Any thoughts on what is going on here or something I can try to get logging started?
Thanks.
I found it hiding in the vagrant instance here: /var/log/nginx
That solved, I'd still be grateful for any insight or resource as to how or why that's configured. Knowing this and searching within the project and combing through the Vagrantfile still doesn't shed light on why it's being saved there rather than storage/logs.
I have a CodeIgniter setup that has been running fine for the past 2 months and recently I keep getting:
CodeIgniter error- unable to connect to database using the provided settings
I've recently added a new domain that has a landing page for the database login (zPanel), but I don't see how that could have caused a problem--maybe the page keeps getting directory attacked or something, but I'm not sure.
Is there a way to check if this is the problem through logs? I'm at dead ends with this problem, as when I restart the server (DigitalOcean) it works fine again.
Really not sure. If anyone else has had a similar problem, I'd love to hear your solution.
Thanks.
I think your mysql is going down so Codeigniter can't connect to your database settings.
Please login to SSH and check processes by "TOP" comment. See what is using resources ram or cpu.
And check your mysql conf settings, be sure that everything written if its empty it will cause alot of problems.
Some example :
http://www.maxwhale.com/how-to-optimize-mysql-for-1gb-memory-vps/
I was wondering if someone could help me.
I have started using version control (git) for my website which is using CodeIgniter.
Everytime i transfer files from my localhost host to my live server, i always have to go through all my files and change the config details.
I came across a post saying i could do all this with the ENVIRONMENT settings in the index.php file automatically based on the SERVER_NAME.
Has anybody done this before? if so, would it be possible to let me know how its done properly?
Cheers,
Try this for a start (index.php):
if ($_SERVER["HTTP_HOST"] == 'devserver1' || $_SERVER["HTTP_HOST"] == 'devserver2')
define('ENVIRONMENT', 'development');
else
define('ENVIRONMENT', 'production');
Then, whenever you need it, you check for the ENVIRONMENT constant (for example, different database settings, etc.). For localhost, simply check if the server is 'localhost' ($_SERVER["HTTP_HOST"] == 'localhost'), or whichever virtual host name you might be using.
You could always use environment variables
http://httpd.apache.org/docs/2.2/env.html
This will allow you to get the environment instead of hard coding the information in your code
This may also help you out
http://docstore.mik.ua/orelly/linux/apache/ch04_06.htm
Not sure if you're still needing help with this, but I had this issue a while ago and released a CodeIgniter module which is designed to automatically handle multiple environments.
I'm shameful to be plugging myself, but it's saved me lots of editing and it might be of use to anyone else that'll read this post in the future.
Here's the link to the Git repo: https://github.com/jedkirby/ci-multi-environments and this is a brief explanation of why and how I made the module: http://jedkirby.com/blog/2012/11/codeigniter-multiple-development-environments
I started to mess around with the EC2 “Micro Instance” for a new site i’m working on. I put on an ubuntu lamp server and loaded up our favorite php framework and started along the coding path.
One frustrating thing i’m finding is whenever I make a mistake coding (which is rare! j/k), it gives my a “Server Error 500” and won’t display the php error line number or the helpful references to where the mistake might have happened.
Also when ever an error does appear and I try to fix the mistake it will remain the same for a couple of minutes. Its like its caching on my system or something. If I do something like this :
echo "test" //leaving off the semicolon
refresh the browser it comes up with the error. Then when I fix it:
echo "foo"; //corrected
I still get the Server Error 500. Not sure if anyone else has run in to these issues. Maybe its a php.ini configuration, .htaccess configuration (i’m using Paul Irish’s HTML5Boilerplate .htaccess code), or a LAMP configuration issue. Any pointers to where the problem might lie would be a huge help.
Thanks! Steve
this has nothing to do with ec2.
see php error directives in /etc/php5/apache2/php.ini
Unfortunately, GAE requires restart of the server on each code change.
Is it possible to prevent it and have immediate feedback after code save?
Or, can I import Google App Engine's API into my ruby code and run it on Sinatra server? Tried this but it fails on "import com.google.appengine.api" (it doesn't know what 'com' is).
For Sinatra, I use "Rerun" ( http://github.com/alexch/rerun ) which restarts server immediately after a change with minimum wait.
Thanks.
Try http://github.com/rkh/sinatra-reloader
OK, seems like JRuby on Rails doesn't need server restart, Sinatra reloaded/shotgun plugins didn't work well for me.
To run it I copied the files from http://rails-depot.appspot.com/src (the source # http://code.google.com/p/appengine-jruby/source/browse did not contain all the files).