This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install remi repos | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add mongo repos | |
$ nano /etc/yum.repos.d/10gen.repo | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 | |
enabled=1 | |
// Install Mongo | |
$ yum install mongo-10gen mongo-10gen-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://docs.mongodb.org/manual/tutorial/back-up-and-restore-with-mongodb-tools/ | |
// Backup | |
$ mongodump -u {username} -p {password} --db {db} --out {output} | |
// Restore | |
$ env LC_ALL=en_US.UTF-8 mongorestore --port {port number} --dbpath {db path} {path to the backup} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- Compiling --- | |
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
$ tar xzvf redis-2.8.3.tar.gz | |
$ cd redis-2.8.3 | |
$ make | |
$ make install | |
// --- or using yum --- | |
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install ImageMagick | |
$ yum install ImageMagick ImageMagick-devel | |
// Install php imagick extension | |
$ yum --enablerepo=remi,remi-test install php-pecl-imagick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add repos | |
$ rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm | |
$ yum install varnish | |
$ chkconfig --level 345 varnish on | |
// Start Vanish | |
$ /etc/init.d/varnish start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -r file.zip /path/to/src/dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Backup | |
$ mysqldump -u [username] -p [databasename] > [filename.sql] | |
Enter password: | |
// Restore | |
$ mysql -u [username] -p [databasename] < [filename.sql] | |
Enter password: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yum install memcached | |
// Configure Memcached | |
$ nano -w /etc/sysconfig/memcached | |
PORT="11211" | |
USER="memcached" | |
MAXCONN="1024" | |
CACHESIZE="512" | |
OPTIONS="" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nginx redirect non-www to www | |
server { | |
listen 80; | |
server_name domain.com; | |
rewrite ^/(.*)$ http://www.domain.com/$1 permanent; | |
} | |
server { | |
listen 80; | |
server_name www.domain.com; |