Add full previews to your twitter feed on WordPress using Ozh’ Tweet Archiver

Ozh’ Tweet Archiver is a WordPress plugin that can archive your tweets on your own blog; it simply creates a new post for each tweet. Additionally, it offers converting hashtags to WordPress tags, and several other features. Nevertheless, one feature, I thought might be interesting, is to process the links on tweets and show them as a Facebook feed. Recently, I modified the code and it worked very well on my blog: Gadelkareem Tweets.

- All we need is to modify the “wp-content/plugins/ozh-tweet-archiver/inc/import.php” file as following: more.. »

Limit requests per IP on Nginx using HttpLimitZoneModule and HttpLimitReqModule except whitelist

- Make sure to check Nginx, PHP posts for information on Nginx and PHP setup and configuration.

Nginx offers two modules, HttpLimitReqModule and HttpLimitZoneModule, to limit simultaneous connections for the assigned session and the number of requests for a given session from one IP address. Basically these modules are built to protect the web server from possible DDos attacks; For example, this configuration limits remote clients to no more than 20 concurrently “open” connections per remote ip address:

http{
    limit_zone limit_per_ip $binary_remote_addr 5m;
    limit_conn  limit_per_ip  20;

more.. »

Disqus problem with wordpress “unable to connect to the disqus api servers”

I recently installed Disqus plugin for WordPress; however, I have been receiving this message “unable to connect to the disqus api servers.” By looking into the source code, it looks like curl is the problem! more specifically the _dsq_curl_urlopen() function, but I did not investigate this error further. As fortunately, we can easily switch to the alternative function _dsq_fsockopen_urlopen().
more.. »

Install Sphinx 2.0.4 on CentOS 6.2

- Make sure to check CentOS, PHP-FPM, Nginx, memcached and MYSQL posts.

- Get fresh RPM from sphinxsearch.com

- Install Sphinx

rpm -Uhv http://sphinxsearch.com/files/sphinx-2.0.4-1.rhel6.x86_64.rpm

- Create sample MySQL database
more.. »

Watch log files on Linux server with Swatch 3.2.3

- Make sure to check CentOS, PHP-FPM, memcached and MYSQL posts.

- get a fresh package from Swatch project

wget "http://downloads.sourceforge.net/project/swatch/swatch/3.2.3/swatch-3.2.3.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fswatch%2F&ts=1330806322&use_mirror=garr"
tar xfz swatch-3.2.3.tar.gz 
cd swatch-3.2.3
cpan -i Date::Format File::Tail
cpan -i Date::Manip Date::Calc
cpan -i Test::Inter Test::Pod Test::Pod::Coverage Module::Build
cp /root/.cpan/sources/authors/id/S/SB/SBECK/Date-Manip-* .
tar xfz Date-Manip-*.tar.gz
cd Date-Manip-*
perl Build.PL 
./Build install
cd ..
perl Makefile.PL
make install

- configure swatch
more.. »

Install Nginx 1.0.12 for PHP-FPM on CentOS 6.2

- Make sure to check PHP-FPM, memcached and MYSQL posts.
- get the latest package from wiki.nginx.org

mkdir nginx
cd nginx
wget http://nginx.org/download/nginx-1.0.12.tar.gz
tar xfz nginx-1.0.12.tar.gz 
cd nginx-1.0.12
 
#Change server string
vi src/http/ngx_http_header_filter_module.c
#change
static char ngx_http_server_string[] = "Server: example.com" CRLF;
static char ngx_http_server_full_string[] = "Server: example.com" CRLF;
 
#change
vi src/http/ngx_http_special_response.c
# replace '"<hr /><center>nginx</center>" CRLF' and '"<hr /><center>" NGINX_VER "</center>" CRLF'
"<hr /><center>example.com</center>" CRLF
 
#create tmp dirs
mkdir /server/tmp /server/tmp/nginx /server/tmp/nginx/client /server/tmp/nginx/fcgi /server/tmp/nginx/proxy
chmod -R 777 /server/tmp

-install Nginx
more.. »

install memcached 1.4.13 on CentOS 6.2

- Make sure to check PHP-FPM and MYSQL posts.

- One of the dependencies of memcache is libevent, get latest version from libevent.org

mkdir libevent
cd libevent
wget https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
tar xfz libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable

- get latest version from memcached.org
more.. »

Install PHP 5.3.10 with PHP-FPM on CentOS 6.2 64-bit

- Make sure to check Nginx, memcached and MYSQL posts.

- remove old version

#find installed packages
rpm -qa | grep php
#remove php packages
yum remove php php-devel php-cli php-pear php-common php-pdophp-xml php-gd

- download package from PHP.net

mkdir php
cd php
wget http://www.php.net/get/php-5.3.10.tar.bz2/from/us.php.net/mirror
tar jxf php-5.3.10.tar.bz2
cd php-5.3.10
 
#install PHP
./configure  \
	--with-zlib --with-curl --with-curlwrappers --enable-ftp --with-mysql --with-jpeg-dir --with-png-dir --with-gd --enable-gd-native-ttf --with-freetype-dir \
	--enable-zip --with-openssl --with-bz2 --enable-mbstring  \
	--enable-inline-optimization --disable-debug \
	--with-config-file-path=/etc \
	--enable-fpm --with-fpm-user=www --with-fpm-group=www --with-libdir=lib64;
make all install;
 
#add php-fpm service
cp  sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
chmod 666 /usr/local/var/run

- Configure php-fpm
more.. »

install curl 7.24 on CentOS 6.2

- Make sure to check PHP-FPM post.

- install from source

wget http://curl.haxx.se/download/curl-7.24.0.tar.bz2
tar xfj curl-7.24.0.tar.bz2
cd curl-7.24.0
./configure --prefix=/usr
make
make install
#check version
curl -V

Install MySQL 5.5.21 64-bit RPM on CentOS 6.2 x86_64

Check Installing CentOS 6.2 on VMware, Install PHP 5.3.10 with PHP-FPM on CentOS 6.2 64-bit, Install Nginx 1.0.12 for PHP-FPM on CentOS 6.2 and install memcached 1.4.13 on CentOS 6.2 posts.

- Remove old version

yum remove mysql mysql-devel mysql-server mysql-libs

- Download the needed packages from http://dev.mysql.com/downloads/mysql/#downloads
Download URL varies depending on download mirror

mkdir mysql
cd mysql
#MySQL-client-5.5.21-1.linux2.6.x86_64.rpm 
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.21-1.linux2.6.x86_64.rpm/from/http://na.mirror.garr.it/mirrors/MySQL/
#MySQL-shared-5.5.21-1.linux2.6.x86_64.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-5.5.21-1.linux2.6.x86_64.rpm/from/http://it.mysql.contactlab.it/
#MySQL-devel-5.5.21-1.linux2.6.x86_64.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.21-1.linux2.6.x86_64.rpm/from/http://na.mirror.garr.it/mirrors/MySQL/
#MySQL-server-5.5.21-1.linux2.6.x86_64.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.21-1.linux2.6.x86_64.rpm/from/http://it.mysql.contactlab.it/
#MySQL-shared-compat-5.5.21-1.linux2.6.x86_64.rpm
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-compat-5.5.21-1.linux2.6.x86_64.rpm/from/http://mysql.mirrors.hoobly.com/
 
#install
rpm -Uvh *
#create log dir
mkdir /var/log/mysql
chmod 777 /var/log/mysql
 
#start MySQL
/etc/init.d/mysql start
#add root password
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h centos6.vmware.local password 'new-password'

- configure mysql more info

vi /etc/my.cnf

more.. »


 Top