Install Redis server in CentOS6 , how? - magento

How to install redis server in CentOS 6 that installed DirectAdmin in it?
Did test several methods but no success!
I want use Redis for Magento Cache

Assuming you have already installed redis, it is running and you are able to run rediscli MONITOR (which should say OK), you are probably missing the phpredis extension.
Usually this is easy to install, but in combination with DirectAdmin it requires some additional attention:
First, install igbinary, which will greatly improve your object serialisation experience.
pecl install igbinary igbinary-devel should do the trick, -but- on many CentOS systems the /tmp dir is mounted with nosuid,noexec which will prevent phpize from completing during the installation, because pecl will use /tmp/pear/temp/ as the build-dir.
I fixed this by editing /etc/fstab:
--- /dev/mapper/vg_directadmin-lv_tmp /tmp ext4 defaults,noatime,noexec,nosuid,errors=continue 1 2
+++ /dev/mapper/vg_directadmin-lv_tmp /tmp ext4 defaults,noatime,errors=continue 1 2
and remounting /tmp with mount -o remount /tmp. After that pecl install igbinary igbinary-devel should work.
Next, download and install phpredis, using the --enable-redis-igbinary option. On my DirectAdmin installation the CLI php version as a different path than the one from DirectAdmin, so we'll explicitly use the DirectAdmin version which lives in /usr/local/php5/:
cd /tmp
wget https://github.com/nicolasff/phpredis/tarball/0ae592b
tar xzvf 0ae592b
cd nicolasff-phpredis-0ae592b/
/usr/local/php5/bin/phpize
./configure --enable-redis-igbinary --with-php-config=/usr/local/php5/bin/php-config
make
make install
After that, your extension should be installed under /usr/local/php5/lib/php/extensions/ .
Last thing that remains is to edit /usr/local/etc/php5/cgi/php.ini and add your new extensions to be loaded. Add:
extension=igbinary.so
extension=redis.so
Restart apache afterwards, and you should be done.

Related

postgresql uuid-ossp.control file missing in extention folder. I have installed postgres 9.6 on windows 10

I am getting the below error on running this query CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SQLSTATE[58P01]: Undefined file: 7 ERROR: could not open extension control file "C:/Program File
s/2ndQuadrant/PostgreSQL/9.6/share/extension/uuid-ossp.control": No such file or directory (SQL:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp")
Old question but I found it when I had a similar problem.
To install the uuid-ossp extension, you need to have some extra modules installed on the server you're on.
You can get those modules by installing postgresql-contrib, for example, on a Red Hat server, you'd do
sudo yum install postgresql-contrib
Also, note that if you need specific Postgres versions of the modules, you can do something like:
sudo yum install postgresql13-contrib
I had this problem and the first answer solved it for me.
Probably you are missing modules.
sudo yum install postgresql-contrib and try again.

How to install mcrypt extension on mac os x yosemite (10.10)

I've updated my Mac OS X to Yosemite, but doing that I over write all my dev environment. So now, to run Laravel 4 on my local apache I need to install the Mcrypt extension, but everything that i've tried i fail. Even the steps that have worked on OS X Mavericks (10.9)
Anybody has the same issue?
Thanks in advance.
Cheers
I just installed it right now on my Mavericks installation using homebrew and it worked surprisingly well. Can't say whether or not it will work so well on Yosemite but worth a shot..
Homebrew
brew install autoconf
brew install mcrypt
Macports
Check PHP version
php -v
Update Macports
sudo port -v selfupdate
Download & install the appropriate version..
sudo port install php55-mcrypt
now dummy proof it..
Find where Macports put the file mcrypt.so and copy it to all instances of /php/extensions/no-debug-... folder. If you have that directory structure in multiple places, copy it to all of them. So every php/extensions/no-debug.. folder on your computer has a copy of mcrypt.so
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
Determine where your php.ini file is and make sure it's the one your actually using because you may have this file in more than 1 place. Do this to all php.ini files you find..
Within that file find and uncomment the following line. If it's commented out, uncomment it. If it's not in the file at all, add it. In my default php.ini file I found this on line 536:
extension=mcrypt.so
Compile
Download mcrypt
curl -O http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
Uncompress it
tar -zxvf libmcrypt-2.5.8.tar.gz
Configure, build, and install
./configure && make && sudo make install
Download Autoconf
curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
Uncompress it
tar xvfz autoconf-latest.tar.gz
Configure, build, and install
./configure && make && sudo make install
Apache
Regardless which method you used to install it. You should always restart Apache when your done.
Restart Apache
sudo apachectl restart
I just did these and it installed. MAMP etc. is not installed.
brew tap josegonzalez/homebrew-php
brew install php55-mcrypt
And weirdly, I had to reinstall to make it install properly.
brew reinstall php55-mcrypt
However, this also re-installed PHP5.5 from source, but no matter, all is working fine on my end.
I had the same problem. But, I'm using MAMP for my local development. So, I just needed to symlink the php file over to MAMP's version and all is working.
If using homebrew, try reinstalling or relinking your php install.
I'm sure I can help you get back up and working, so just let me know if that doesn't help.
First Install libtool from homebrew, which is a dependency in 10.10 Yosemite
brew reinstall libtool --universal && brew unlink libtool && brew link libtool
Then CD to your php directory
cd /usr/local/php5
And into your php.d directory
cd php.d
Then finally do a quick ls to see which extensions you are using:
ls -l
If you see duplicate entries containing "mcrypt" you will need to open one of them up, and comment out the line:
extension=mcrypt.so
to
;;extension=mcrypt.so
But only in one of them. For me it was mcrypt.ini. So..
sudo nano mcrypt.ini
added the line and done!

Is there a command to update redis?

I'm working on the front end for a web app, but I'm trying to learn as much of the backend setup as I can as well. I am setting up redis on a new computer myself, but running into a few hiccups.
The wget command cannot be found, so I assume it Linux only? I am following these instructions to install redis on Mac OS 10.7. I have redis 2.0.0 installed, but while attempting to install 2.4.4 using the same commands, I am told redis-server, redis-cli, redis-benchmark cannot be found, and I can't copy them to /usr/local/bin.
I could not find an update command to bring redis up to the most recent version. I don't think it should be this difficult to install the most recent version on redis on Mac OS, but I can't see what I am doing wrong.
So far as I know, typing:
$ brew upgrade redis
should work, where $ indicates your command line. If it complains about HomeBrew not being installed, you can obtain that here. Brew is an excellent package manager, and a great way of taking care of your files.
If you're not using brew, then these steps will help you get up to date.
First, find the location of your installed redis-server instance before updating. In my case, it was in /usr/local/bin/, but it might also be in /usr/bin/. If it's not here, you can type which redis-server to find the location.
Next, download the redis tar file from https://redis.io/download, then install it from the directory it downloaded to:
cd Downloads
tar xzf redis-X.Y.Z.tar.gz
cd redis-X.Y.Z
make test
make
Next, we'll move the new installed redis to the location where the current instance is running:
sudo mv src/redis-server /usr/local/bin
sudo mv src/redis-cli /usr/local/bin
Now you should be ready to use redis-server and redis-cli in the new version.
PS - I also moved the redis-benchmark, redis-sentinel, redis-check-aof, and redis-check-dump files because they were also already in /usr/local/bin.
Ref: http://jasdeep.ca/2012/05/installing-redis-on-mac-os-x/
It would be better to follow this way.
$ brew update
$brew upgrade redis
Create a bash file...
cd ~
nano .update_redis
Go into the tmp directory and download the latest stable version
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
Decompress the files
tar xvzf redis-stable.tar.gz
Compile
cd redis-stable
make
Copy the bin programs
cp src/redis-cli /usr/bin/
cp src/redis-server /usr/bin/
cp src/redis-benchmark /usr/bin/
Set Permissions
chmod 755 /usr/bin/redis-cli
chmod 755 /usr/bin/redis-server
chmod 755 /usr/bin/redis-benchmark
Execute
bash .update_redis

Compiling kernel in Ubuntu on EC2 (no errors, but no image and unchanged after restart)

I need to update the kernel timer on my Ubuntu Lucid (10.04) server on EC2 (with EBS) from 250HZ to 1000HZ, to improve voip call quality.
From what I've read, the way to do that is to download the kernel source code, configure it, then install it.
I've found several decent tutorials that are fairly specific to my setup, the best of which are:
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
https://help.ubuntu.com/community/Kernel/Compile
http://blog.avirtualhome.com/2010/05/05/how-to-compile-a-ubuntu-lucid-kernel/
http://crashcourse.ca/introduction-linux-kernel-programming/intermission-building-new-ubuntu-1004-kernel-free-lesson
That's led to me to the following sets of commands, which all run nicely, making the .deb files with no obvious errors. But then when I restart the server the timer frequency hasn't been updated.
sudo apt-get build-dep linux-image-$(uname -r)
sudo apt-get build-dep linux
sudo apt-get install fakeroot build-essential
sudo apt-get install crash kexec-tools makedumpfile kernel-wedge
sudo apt-get install libncurses5 libncurses5-dev
sudo apt-get install libelf-dev asciidoc binutils-dev kernel-package
cd /usr/src
sudo apt-get source linux-image-$(uname -r)
cd linux-*
sudo make menuconfig
# Processor type and features -> Timer frequency -> change to 1000HZ -> Exit -> Exit -> Yes (Save)
fakeroot debian/rules clean
fakeroot debian/rules binary-headers
fakeroot debian/rules binary-indep #This does the headers, docs, and source
#check deb 2-3 files were created
cd ..
ls *.deb
sudo dpkg -i linux-*.deb
#reboot
EDIT
Spent some time with jjohansen on irc #ubuntu-kernel, and was able to find my mistake with his help - looks like I should have done the configuration step in between the clean and build. Also, he recommended to always use the source from git rather than the package, so these are the new commands to do in the middle of what I had above:
cd /usr/src
# This is 700mb so it takes a while to download and set up
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd ubuntu*
git checkout --track -b ec2 origin/ec2
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
fakeroot debian/rules binary
#Takes about 40min
John Johansen (kernel hacker at Canonical) believes that you should be able to build and run your own kernel on an EC2 instance with Ubuntu.
See jjohansen's notes in this 1000Hz EC2 kernel request I had submitted back in 2009:
https://bugs.launchpad.net/ubuntu-on-ec2/+bug/365233
You will want to make sure that you are starting with a recent Ubuntu AMI that uses pvgrub.
Thanks to Eric Hammond for the heads up,
Which kernel you are going to need will depend on which version of Ubuntu you are using. For Lucid - Maverick you will need to use the -ec2 kernel source. The support needed was moved into the regular kernel tree for natty and oneric.
So you will need to do
sudo apt-get source linux-ec2
or
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd into the source directory
fakeroot debian/rules clean
fakeroot debian/rules binary
For Lucid you will also have to make sure you have a done an update or are using a current image, as support for pv-grub was add after Lucid was release.
Referencing Redzarf's terminal commands including his edit plus a couple small necessary additions, heres what worked for me on a Amazon ec2 vanilla install of Ubuntu Server Cloud Guest 10.04 LTS (Lucid Lynx) 64x
# Make yourself root
sudo su
# Update source list:
aptitude update
# Upgrade everything:
aptitude upgrade
# Install dependencies:
apt-get build-dep linux-image-$(uname -r)
apt-get build-dep linux
apt-get install fakeroot build-essential
apt-get install crash kexec-tools makedumpfile kernel-wedge
apt-get install libncurses5 libncurses5-dev
apt-get install libelf-dev asciidoc binutils-dev kernel-package
apt-get install git-core
cd /usr/src
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd ubuntu*
git checkout --track -b ec2 origin/ec2
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
# Configuration window should now appear, do the following:
Select YES
# Navigate to:
Processor type and features -> Timer frequency
# Select the 1000HZ frequency
Exit
Exit
Yes (Save)
#After saving and returning to prompt it may ask you to do it again for i386, select yes and repeat!
# Recompile:
fakeroot debian/rules binary
#Check if your deb 2-3 files were created
cd ..
ls *.deb
sudo dpkg -i linux-*.deb
#reboot
reboot
#Check your new Kernel version
uname -r
#Check if Kernel HZ value change persisted:
cat /boot/config-`uname -r` | grep HZ
#If value 1000HZ=yes:
Done!;)
--===< Quick Tip >===--
If your running an "on-demand micro instance", compile time will take approximately 7hrs and cost around $0.14!
If on the other hand you want to save yourself some time and recompile in just under 12min for $0.21, you can do this:
Reserve a High-CPU Extra Large Spot Instance (20x ec2 compute units, 7GB ram)
Recompile your kernel with aforementioned commands (12min)
Once recompile completes take a snapshot of the spot instance's ebs volume
Wait for Snapshot to complete (few minutes)
Terminate the spot instance
Create new volume from the snapshot (nichname: Volume X) also take note of the volume ID!
Go to Instances > Create your New EBS Instance
This will be the New instance your Asterisk server will be running on
It must be from the same Base AMI, and same Zone as Volume X)
-The New Instance will now be created along with a corresponding EBS Volume
Stop the New instance
Go to Volumes > Detach the New instance's corresponding EBS volume
After it's detached, delete that volume
Select Volume X > Attach to New EBS Instance (Device ID Must be: /dev/sda1)
Go to Instances > Start your New Instance
Re-associate your Elastic IP if you had one.
Check if everything works
If everything checks out, create another snapshot for backup!
Done! ;)
Big shout out and thanks to Redzarf, Eric Hammond, and John Johansen!
Your second best guess is correct. Amazon's way of booting Linux kernels is special to their domain, and it is indeed as you mentioned - based on a special version of grub. They have published resources on the matter, please read Enabling Your Own Linux Kernels.

Installing CouchDB in AWS EC2 Free Tier

Does anyone know of a step by step installation guide for CouchDB in the free tier 32bit AWS EC2 instance?
Keep in mind that YUM is limited by default and I would need to add yum.repos to get extra stuff. I've tried all different articles and RPMs but none seem to work.
I also tried couchbase but it has extremely poor post-install instructions. The server start but then what? I couldn't find the files, configs, or install directories. And, how do I access it?
CouchDB sounds like such a great database but it really needs to break these barriers of entry. MongoDb has better docs, although I couldn't get that to work either (I spent a fraction of the time trying, though).
Thanks :)
The apache team put together this quick script that installs CouchDB (thanks #_jhs
for build-couchdb!) on an Amazon Linux AMI:
https://gist.github.com/1171217
If you are using cloudinit + the EC2 command line tools, simply use
ec2-run-instances with --user-data-file (you will need some mods to
the script to save the password or locally generate one) and voila'.
Relaxing FTW.
Worked like a charm for me!
Enable the EPEL repository first and then install it with yum install couchdb
You can enable EPEL using the instructions here.
EDIT:
More information at http://wiki.apache.org/couchdb/Installing_on_RHEL5. Keep in mind that the Linux EC2 AMI is a cut down version of CentOS and you can add custom repositories and install as you wish.
Here is a quick run down of the steps I use to install couchdb 1.5.1 on Amazon Linux 2014.03.1. See also this post on my blog http://www.everyhaironyourhead.com/installing-couchdb-1-5-1-on-amazon-linux-ami-2014-03-1/.
Core deps and dev tools.
Enable the EPEL Repo by editing the file /etc/yum.repos.d/epel.repo and setting it to enabled.
Next install the deps and tools.
sudo yum install gcc gcc-c++ libtool libicu-devel openssl-devel autoconf-archive erlang python27 python-sphinx help2man
Get the SpiderMonkey JS Engine and build it...
wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
tar xvfz js185-1.0.0.tar.gz
cd js-1.8.5/js/src
./configure
make
sudo make install
You should see it installed under /usr/local/lib
Build CouchDB.
Download the source package for CouchDB, unpack it and cd in.
Point it to the required libs and configure.
./configure --with-erlang=/usr/lib64/erlang/usr/include --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/
make
sudo make install
Prepare the CouchDB installation.
Make a couchdb user.
sudo useradd -r -d /usr/local/var/lib/couchdb -M -s /bin/bash couchdb
Set the file ownerships.
sudo chown -R couchdb:couchdb /usr/local/etc/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/run/couchdb
sudo chmod 0775 /usr/local/etc/couchdb
sudo chmod 0775 /usr/local/var/lib/couchdb
sudo chmod 0775 /usr/local/var/log/couchdb
sudo chmod 0775 /usr/local/var/run/couchdb
Prepare the init scripts.
Link the init script and copy the log rotate script to /etc.
sudo cp /usr/local/etc/logrotate.d/couchdb /etc/logrotate.d
sudo ln -s /usr/local/etc/rc.d/couchdb /etc/init.d/couchdb
This and most other linux distros don’t include /usr/local/lib in ld, so CouchDB will have problems finding the SpiderMonkey libs we installed there earlier. One way to solve this is to add the following line to the top of the /etc/init.d/couchdb startup script.
export LD_LIBRARY_PATH=/usr/local/lib
See man page for ldconfig for more info, and please comment with a better solution.
You may want to edit /usr/local/etc/default/couchdb to turn off the auto respawn.
To get it to autostart, just use the standard linux setup tools for running service scripts.
sudo chkconfig --add couchdb
It should pick up the default run levels needed from the script, but in case it doesn’t, you can do it manually like this...
sudo chkconfig --level 3 couchdb on
sudo chkconfig --level 4 couchdb on
sudo chkconfig --level 5 couchdb on
You can sudo chkconfig —list to confirm its there. See man chkconfig for more details.
Relax.
Finally reboot (or just start couchdb from the script) and confirm its running with curl http://127.0.0.1:5984/
Comments, corrections, improvements, and criticisms are appreciated.
Add the EPEL repository first and then install it with yum install couchdb
Yeah, not exactly. I'm running AWS Free Tier standard and installing couch has been hell on earth - lots and lots of dependency issues around erland various graphics libs, I'll report back here when I get a process that works
okay, the issue for me was wxGTK.x86_64 - It had a list of 15 or so dependencies that wouldn't install through yum (even with epel) and I had to manually install the rpms and dependencies before yum install couchdb would work.
Not sure the default AMI is a good idea if you want couch!
I googled: "build couchdb"
and followed the steps
I am installing it.
I can tell you it is very painful. After pressing "rake", you need to wait 2, maybe 3 hours until all the dependencies are compiled. I am still installing it right now in my free tier server. You have to make sure you have that time to keep your terminal busy out there!
However, it is the only working solution so far for me. It is installing automatically for real.
I also tried couchbase but it has extremely poor post-install instructions. The server start but then what? I couldn't find the files, configs, or install directories. And, how do I access it?
Sorry for hearing about the experience you are having! We have been focused on making Couchbase highly performant and scalable recently so understand the developer experience pain such as documentations. Hopefully these two step by step guides would help!
This is on how to install the Couchbase Server and Couchbase Sync Gateway Amazon AMI on AWS and then how to connect Couchbase Sync Gateway to a mobile application:
Part 1 : Database on Amazon: Installing Couchbase AMI on AWS
The first part goes over how to install and access the Couchbase Web Console.
Part 2 : Database on Amazon: Connecting Couchbase Sync Gateway to Couchbase AMI on AWS
The second part goes over how to access the Couchbase contents/directory
You mentioned CouchDB and Couchbase together in this thread and they have different APIs but the Couchbase Sync Gateway component would be able to sit in front of CouchDB through the REST APIs as another option.
For those specifically installing on AWS Linux 2
Installing Couchdb on AWS Linux 2
This page uses Apache Couchdb binary installation
Instructions
Using the Centos installation instructions.
Create the bintray-apache-couchdb-rpm.repo file in the /etc/yum.repos.d directory
Fill in the full path to the repository list rather than using the Relver and Architecture macros.
[bintray--apache-couchdb-rpm] name=bintray--apache-couchdb-rpm baseurl=http://apache.bintray.com/couchdb-rpm/el7/x86_64/
gpgcheck=0
repo_gpgcheck=0
enabled=1
Yum install after enabling epel
sudo yum update && sudo yum install -y couchdb
Continue with the Couchdb and configuration as normal

Resources