How to install nodejs on centos server
http://admin.webhostingdevelopment.com/viewtopic.php?f=75&t=156&p=172&hilit=node#p172
How to install nodejs on centos server
http://admin.webhostingdevelopment.com/viewtopic.php?f=75&t=156&p=172&hilit=node#p172
VISIT http://admin.webhostingdevelopment.com/viewtopic.php?f=72&t=88&p=101#p101 for details
/scripts/installimagemagick
pecl install imagick
[root@server csf]# ./install.sh
Configuring for OS
Running csf generic installer
Installing generic csf and lfd
Check we’re running as root
Checking Perl modules…
Can’t locate Time/HiRes.pm in @INC (@INC contains: /etc/csf /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 30) line 2.
BEGIN failed–compilation aborted at (eval 30) line 2.
Using configuration defaults
You need to install the missing perl modules and then install cxs
Solution :
yum install perl-Time-HiRes
Moodle admin login page gives blank page after logged in.
Solution :
open moodle config file
vi config.php
and insert the below at the end of file
=============================================================
ini_set ('error_reporting', E_ALL);
ini_set ('display_errors', 1); ini_set ('display_startup_errors', 1); ini_set ('log_errors', 1); ini_set ('error_log', 'syslog');
=============================================================
Access site and you can see the error. Comment out the lines giving errors and see
To commnet out you can use
/** PHP CODE */
pecl install uploadprogress
yum install perl-libwww-perl
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-re
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm —-> 64 bit
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm —–> 32 bit
yum install ffmpeg ffmpeg-devel
Depending on your arch use
==================================================
yum install libogg.i386 libogg-devel.i386
or
yum install libogg.x86_64 libogg-devel.x86_64
==================================================
yum install libvorbis.i386 libvorbis-devel.i386
OR
yum install libvorbis.x86_64 libvorbis-devel.x86_64
===================================================
Install ffmpeg-php
cd /usr/src wget http://superb-sea2.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2
tar xjf ffmpeg-php-0.6.0.tbz2 cd ffmpeg-php-0.6.0 phpize ./configure --prefix=/usr --enable-shared make make install
Add extension=ffmpeg.so to php.ini if REQUIRED
wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzvf maldetect-current.tar.gz
cd maldetect-*
sh install.sh
================================
[ maldet --scan-all /home/*/public_html/ ---> To scan ]
[ maldet --report 122111-1532.827 -----> To see the report ]
[ maldet -q 122111-1532.8272 ----> To remove the Infected files ]
maldet(7488): {scan} quarantine is disabled! set quar_hits=1 in conf.maldet or to quarantine results run: maldet -q 125211-1258.7488
INFECTED FILES LIST in
cd /usr/local/maldetect/sess/
There is a file that start with session.
Getting the below error while trying to install csf
Checking for perl modulesfailed You need to install the LWP perl module (libwww-perl) and then install csf
Solution :
yum install perl-libwww-perl
Check if any dns service is running
Install bind as
yum install bind
yum install caching-nameserver
Check if the below packages are available :
rpm -qa | grep bind*
==========================
bind-utils-9.3.6-16.P1.el5 bind-chroot-9.3.6-16.P1.el5 bind-libs-9.3.6-16.P1.el5 ypbind-1.19-12.el5_6.1 binutils-2.17.50.0.6-14.el5 bind-9.3.6-16.P1.el5
==================================
cp -ar /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/nameserver.conf
Remove the following packages manually :
m2crypt , python, python-urlgrabber, yum
Then reinstall everything, you can download the rpms from : http://mirror.centos.org/centos-5/
Download and install uisng
rpm -Uvh * –force
cd /usr/src
wget http://sysoev.ru/nginx/nginx-1.0.2.tar.gz
wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz
tar xvzf mod_rpaf-0.6.tar.gz
cd mod_rpaf-0.6/usr/local/apache/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
cd /usr/srctar xvzf pcre-8.12.tar.gz
cd pcre-8.12
./configure
make
make install
cd /usr/src
tar xvzf nginx-1.0.2cd nginx-1.0.2
./configure –with-http_ssl_module –with-http_realip_module –with-http_dav_module –with-http_flv_module –with-http_gzip_static_module
make
make install
Login to WHM and look for the following route:
Main >> Service Configuration >> Apache Setup > Include Editor > Pre Main Include
- Add the following configuration and save, LIST_OF_YOUR_IPS changing the IP you occupy in your site:
Code:LoadModule rpaf_module modules/mod_rpaf-2.0.soRPAFenable On# Enable reverse proxy add forwardRPAFproxy_ips 127.0.0.1 LIST_OF_YOUR_IPS# which ips are forwarding requests to usRPAFsethostname On# let rpaf update vhost settings# allows to have the same hostnames as in the “real”# configuration for the forwarding ApacheRPAFheader X-Real-IP# Allows you to change which header mod_rpaf looks# for when trying to find the ip the that is forwarding# our requests
go to whm > tweak settings and change the apache port from 80 to 81 (find 0.0.0.0:80 and change it to 0.0.0.0.:81)
- Run SSH console
Code:/usr/local/cpanel/whostmgr/bin/whostmgr2 –updatetweaksettings/scripts/rebuildhttpdconf/scripts/restartsrv httpd
vi nginx.sh
and add this code to it:
Code:—————————————————————————–
#!/bin/sh cat > “/usr/local/nginx/conf/nginx.conf” <<EOFuser nobody;# no need for more workers in the proxy modeworker_processes 2; error_log logs/error.log info; worker_rlimit_nofile 8192; events { worker_connections 1024; # you might need to increase this setting for busy servers use epoll; # Linux kernels 2.6.x change to epoll} http { server_names_hash_max_size 2048; include mime.types; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 10; gzip on; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/plain application/x-javascript text/xml text/css; ignore_invalid_headers on; client_header_timeout 3m; client_body_timeout 3m; send_timeout 3m; connection_pool_size 256; client_header_buffer_size 4k; large_client_header_buffers 4 32k; request_pool_size 4k; output_buffers 4 32k; postpone_output 1460; include “/usr/local/nginx/conf/vhost.conf”;} EOF /bin/cp /dev/null /usr/local/nginx/conf/vhost.conf cd /var/cpanel/usersfor USER in *; do for DOMAIN in `cat $USER | grep ^DNS | cut -d= -f2`; do IP=`cat $USER|grep ^IP|cut -d= -f2`; ROOT=`grep ^$USER: /etc/passwd|cut -d: -f6`; echo “Converting $DOMAIN for $USER”; cat >> “/usr/local/nginx/conf/vhost.conf” <<EOF server { access_log off; error_log logs/vhost-error_log warn; listen 80; server_name $DOMAIN www.$DOMAIN;
location ~* \.(gif|jpg|jpeg|png|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|html|htm|wml)$ { root $ROOT/public_html; } location / { client_max_body_size 10m; client_body_buffer_size 128k; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; # you can increase proxy_buffers here to suppress “an upstream response # is buffered to a temporary file” warning proxy_buffers 16 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; proxy_connect_timeout 30s; proxy_redirect http://www.$DOMAIN:81 http://www.$DOMAIN; proxy_redirect http://$DOMAIN:81 http://$DOMAIN; proxy_pass http://$IP:81/; proxy_set_header Host \$host; proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; } }EOF donedone—————————————————————————–
chmod 755 nginx.sh./nginx.sh
Check the configuration
Code:/usr/local/nginx/sbin/nginx -t
Start nginx
Code:/usr/local/nginx/sbin/nginx
- create init script
Code:
vi /etc/init.d/nginx
put this code into the file
Code:———————————————————————————-
#!/bin/sh## nginx – this script starts and stops the nginx daemin# Taken from http://www.hikaro.com# chkconfig: – 85 15# description: Nginx is an HTTP(S) server, HTTP(S) reverse \# proxy and IMAP/POP3 proxy server# processname: nginx# config: /usr/local/nginx/conf/nginx.conf# pidfile: /usr/local/nginx/logs/nginx.pid # Source function library.. /etc/rc.d/init.d/functions # Source networking configuration.. /etc/sysconfig/network # Check that networking is up.[ "$NETWORKING" = "no" ] && exit 0 nginx=”/usr/local/nginx/sbin/nginx”prog=$(basename $nginx) NGINX_CONF_FILE=”/usr/local/nginx/conf/nginx.conf” lockfile=/var/lock/subsys/nginx start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $”Starting $prog: ” daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval} stop() { echo -n $”Stopping $prog: ” killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval} restart() { configtest || return $? stop start} reload() { configtest || return $? echo -n $”Reloading $prog: ” killproc $nginx -HUP RETVAL=$? echo} force_reload() { restart} configtest() { $nginx -t -c $NGINX_CONF_FILE} rh_status() { status $prog} rh_status_q() { rh_status >/dev/null 2>&1} case “$1″ in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $”Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}” exit 2esac
——————————————————————————————-
save the code and execute
Code:chmod +x /etc/init.d/nginx
make it start when the server runCode:/sbin/chkconfig nginx on
to check itCode:/sbin/chkconfig –list nginx
check the function if it works
Code:service nginx startservice nginx stopservice nginx restartservice nginx reloadservice nginx configtestservice nginx statusDone!
Getting the below error while trying to run “make” during ffmpeg install
========================
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_toGDImage’:
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_ffmpeg_frame’:
/usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32′ undeclared (first use in this function)
make: *** [ffmpeg_frame.lo] Error 1
=====================================
SOLUTION :
vi ffmpeg_frame.c
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
save and exit
./configure
wget http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-1.2.1.tar.gz
tar -xzvf xcache-1.2.1.tar.gz
cd xcache-1.2.1/
phpize
[ ./configure --enable-xcache ]
make
make install
php -i| grep php.ini
cp -ar /usr/local/lib/php.ini /usr/local/lib/php.ini.bak
vi /usr/local/lib/php.ini
and search for zend_extension and add the below line
zend_extension=”/usr/local/lib/php/extensions/no-debug-non-zts-20060613/xcache.so”
Restart httpd
php -v