PHP APC installed but not enabled - apc

on an amazon linux ami I've succesfully (I think) installed apc (with yum or pecl. tried both) but I'm not able to enable it (sorry for the pun).
php -i says:
apc
APC Support => disabled
Version => 3.1.15-dev
APC Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>
Locking type => pthread mutex Locks
Serialization Support => broken
Revision => $Revision: 329725 $
Build Date => May 28 2013 18:03:40
Directive => Local Value => Master Value
apc.cache_by_default => On => On
(and so on...)
extension=apc.so and apc.enabled=1 are in /etc/php.d/apc.ini (and php -i confirm that /etc/php.d/apc.ini is parsed).
I tried also to put them in /etc/php.ini to no avail. (And of course I dutifully restarted httpd every time).
Now I really don't know what to do...

Apc is showing disabled , but did you check whether its working or not , as most of the time it shows disabled but works fine.
I installed the same in my centOS and checked that about the issue , me also getting the same output of php -i and but everything is working fine please see the below screen shot.

Related

Puppet download database and import using Tim Kay's aws tool

I've been trying to set up a development environment for my colleage's using vagrant and puppet for provisioning (Vagrant version 1.2.2, precise64 box). I'm currently stuck on downloading and importing a database.
For some context my company has daily database backups that get stored on Amazons S3 service, the dev environments should obtain the latest database backup and import it. We currently use Tim Kays aws tool to fetch the backups from S3.
I've successfully setup the aws tool using the following with puppet (and confirmed it works via 'vagrant ssh'):
file { '/usr/local/bin/aws':
owner => 'root',
group => 'root',
mode => 755,
source => '/puppet-files/aws',
}
file { '/home/vagrant/.awssecret':
owner => 'vagrant',
group => 'vagrant',
mode => 400,
source => '/puppet-files/.awssecret',
}
I've tried using a modified version of a suggestion for 'wget' from a post on google groups with no luck. The following is the configuration for fetching the database.
# Get and import latest db copy
exec { "download-reduced-db" :
cwd => "/tmp",
command => "/usr/local/bin/aws get sqldump.example.com/2013-01-02-db-backup.sql.gz /tmp/2013-01-02-db-backup.sql.gz",
creates => "/tmp/2013-01-02-db-backup.sql.gz",
timeout => 3600,
require => [File["/usr/local/bin/aws"], File["/home/vagrant/.awssecret"]],
}
The (shortened) output from 'vagrant up' is below, which indicates that it completed successfully.
notice: /Stage[main]//File[/home/vagrant/.awssecret]/ensure: defined content as '{md5}a4b7b1ac48eb207d93cb0b1541766718'
notice: /Stage[main]//File[/usr/local/bin/aws]/ensure: defined content as '{md5}92fa9a6d77c8185fdaf970e2c4eb254e'
notice: /Stage[main]//Exec[download-reduced-db]/returns: executed successfully
However when using 'vagrant ssh' and checking the /tmp/ directory the file is not listed. If I execute the command from above by hand it completes successfully and I can see the file listed in /tmp/
Thanks for your time and help.
Try to use
puppet.options = "--verbose --debug"
as explained here http://docs.puppetlabs.com/references/latest/configuration.html
Possibly, try to run exec with the user parameter to make sure it runs as vagrant, but first check the debug output.
Also redirect stdout and stderr of your command to a file, so you can check what's going wrong. In the Bourne shell, used by default by Puppet, this is done as:
command > file.log 2>&1
Let me know how it goes.

Provisioning server with Puppet, deploying with Capistrano

I'm having issues with provisioning a server via Puppet that is compatible with a Capistrano deployment. I'm using puppetlabs/apache to setup my virtualhosts, and it is (rightfully) checking that the docroot exists (and creating it if it doesn't, ignoring potential nested directory issues). However, the true docroot will be /var/www/vhosts/${::fqdn}/current/public, and Capistrano will be creating the appropriate symlink (from current to releases/{releasestamp}) when deploying, and is not happy when that directory path is setup by Puppet in advance (due to current being an actual directory, instead of a symlink, and not being empty).
I've thought about adding something like:
file { "/var/www/vhosts/${::fqdn}/current":
ensure => 'link',
target => '/tmp/initial'
}
and setting up a blank file at /tmp/initial/public/index.html, so that Capistrano will be able to point current to the appropriate release when deploying. However, this means that whenever someone re-runs the provision (to apply any configuration changes, for example), the symlink will be relocated to the junk directory (if it even exists at that point).
Any suggestions? I've considered splitting the provision into an application provision and server provision, and having Capistrano execute the application provision when deploying, but I'd really prefer to keep this concise.
You should just use Puppet to create the application directory, and let Capistano take care of creating the releases and shared directories using the cap deploy:setup task, and laying down the current symlink when deploying a new version with cap deploy.
In more concrete terms, I recommend having this in your Puppet config:
file { "/var/www/vhosts/${::fqdn}":
ensure => 'directory'
}
Then, as a one-time setup step, run this task to instruct Capistrano to create the releases and shared directories within the /var/www/vhosts/${::fqdn} directory Puppet should have created for you:
cap deploy:setup
And thereafter, simply run cap deploy to deploy your app, which will create or update the current symlink for you.
(Note that you can pass the -n option to cap to preview the exact commands Capistrano will run, For instance, cap -n deploy:setup will show the mkdir commands it runs.)
Updated
Puppet's standard Apache module seems to require that docroot exist, which it does using the following:
# This ensures that the docroot exists
# But enables it to be specified across multiple vhost resources
if ! defined(File[$docroot]) {
file { $docroot:
ensure => directory,
owner => $docroot_owner,
group => $docroot_group,
}
}
But you may be able to disable that using the following:
file { "/var/www/vhosts/${::fqdn}/current/public":
ensure => directory,
replace => false, # don't replace the directory once Capistrano makes it a symlink
}
Just defining the resource yourself may prevent the if ! defined(File[$docroot]) part of the apache::vhost module from running.
Stuart,
Thanks for the great answer. I found that I had to amend it slightly to put the replace => false on the 'current' directory, not the 'current/public' directory, like so (using a vagrant owner):
file {
'/home/vagrant/app/current':
ensure => directory,
replace => false,
owner => vagrant,
group => vagrant,
}

Symfony2 Sonata admin make apache goes down on Windows 7

I'm learning Symfony and installed Sonata Admin Bundle. After opening /admin/login/ first time it opens, but after reload apache goes down. So after every page reload I need to restart apache.
I think it's my code bug, so installed working site on my local, but got same problem.
Don't know what info is important to put with question, please let me know and I'll update question.
UPDATE:
I got perl error:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can find solution for Linux, need to run this commands:
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
apt-get install locales
dpkg-reconfigure locales
But nothing for Windows 7.
Also some solutions on StackOverflow:
How to fix a locale setting warning from Perl?
Solution
Problem was in APC extension, you can disable it on your dev server, because it just extension for cahce. Works for me without it.

Rails Reporting Wrong Environment in Multi-stage Setup

Using capistrano 2.12.0, capistrano-ext 1.2.1, Rails 3.2.7 and Phusion Passenger 3.0.15.
For no logical reason, my 'playground' server has started reporting that it's actually running in development mode.
I've reinstalled things, restarted apache etc but am still stuck.
Don't really want to hardcode as I've got a production environment to think about.
In my apache conf. I've set
RailsEnv playground
There's a gist of my deploy.rb file here
Capistrano is sending to the correct location etc. so I think it's rails or passenger rather than cap.
What else can I do to get this going properly??
---- EDIT ----
I've just tested with Unicorn and it's also reporting that it's running in development mode.
Starting unicorn with the following:
unicorn -E playground -l 8000
After much experimentation, I found the root cause to be a line in one of my models:
- if Rails.env = 'development'
Obviously, this should have been a '==' not a single one.

Rhomobile rake redis aborted

I am working my way through the RhoMobile tutorial http://docs.rhomobile.com/rhoconnect/command-line#generate-an-application and I at the point of entering
rake redis:install
I get the following error.
WARNING: using the built-in Timeout class which is known to have issues when use
d for opening connections. Install the SystemTimer gem if you want to make sure
the Redis client will not hang.
See http://redis.io/ for information about redis.
Installing redis to C:\RhoStudio\redis-2.4.0;C:\dropbox\code\InstantRhodes\redis
-1.2.6-windows.
rake aborted!
Zip end of central directory signature not found
Tasks: TOP => redis:install => redis:download
(See full trace by running task with --trace)
D:\Dropbox\code\rhodes-apps\storeserver>
I am working on a Whindows machine, primarily using RhoStudio.
It ended up being an environmental variables issue. Also, it seems the main support forum for Rhodes is the Google Group. Question answered here:
https://groups.google.com/d/topic/rhomobile/b-Adx2FDMT8/discussion
If you are using Rhostudio in windows then redis is automatically installed with Rhostudio.
So no need of installing it again.