Blank page after enabling Magento Compiler

You Receive a blank page after enabling Magento Compiler in the admin section.

Causes

1) A module that you installed may not work with magento compiler
2) You enabled the compiler but didn’t run the compiler before enabling.

How to resolve?

Easy, Open the index.php in your magento root directory

Comment out the following line:

/**
* Compilation includes configuration file
*/
/**#$compilerConfig = ‘includes/config.php’;
#if (file_exists($compilerConfig)) {
include $compilerConfig;
#}  */

Now go back to the backend of your magento store, and run compilation
Clean the cache dir and verify that its now working.

If problem persists comment out the compilation line again in the index.php
And trouble shoot which modules is causing problems.

Posted in Magento | Tagged , , | 2 Comments

Magento connect does not have sufficient write permissions

Magento connect does not have sufficient write permissions you might receive this error after you installed a fresh magento install or migrated your site to a new host.

It can easily be solved.

Perform an ssh connection to your server.
Go to Magento home directory

cd /home/magentodir
Perform the following

chmod 777  -R downloader/ downloader/*

if you using Cpanel on your server set the following permissions:

chmod 755 -R downloader/ downloader/*

Now reopen your magento connect and verify that the error msg has dissapeared.
Now all should be well and you can now set your magento connect prefrences.

 

Posted in Magento | Tagged , , | Leave a comment

Magento connect invalid header response from server

Ever wondered why Magento connect Gives you this error when you try to install an extension?
First of all make sure /downloader folder has enough permissions..
Connect to you VPS via SSH
cd /home/magentodir
Perform CHMOD -R 777 downloader/ downloader/*

Now Retry the Magento extension if it still returns invalid header response open your PHP.ini
And verify that php CURL Extension hasn’t been disbled. (might be on multiple lines).

Once you have enabled PHP-Curl restart apache /etc/init.d/httpd restart (or if your using php-fpm) /etc/init.d/php-fpm restart

Now open Magento connect once again and verify that you can install the magento extension.

 

Posted in Magento | Leave a comment

phpmyadmin with nginx

How to install phpmyadmin for use with nginx
Prequisites nginx and php-fpm, mysql server. php-library’s

 

Lets first download our phpmyadmin resources:

cd /tmp
mkdir phpmy
cd phpmy

wget http://downloads.sourceforge.net/pro...ror=netcologne

tar xzf phpMyAdmin-3.4.4-rc1-english.tar.gz

mkdir /usr/share/phpMyAdmin/

mv phpMyAdmin-3.4.4-rc1-engish.tar.gz/* /usr/share/phpMyAdmin/

cd /usr/share/phpMyAdmin/

cp config.sample.inc.php config.inc.php

nano or vi config.inc.php

set your preferred options 

Chown -R nginx:nginx /usr/share/phpMyAdmin/* 

---
####################################################################

 

 

#
# This is the main Nginx configuration file.
#
# More information about the configuration options is available on
#   * the English wiki - http://wiki.nginx.org/Main
#   * the Russian documentation - http://sysoev.ru/nginx/
#
#######################################################################

#----------------------------------------------------------------------
# Main Module - directives that cover basic functionality
#
#   http://wiki.nginx.org/NginxHttpMainModule
#
#----------------------------------------------------------------------

user              nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;

#----------------------------------------------------------------------
# Events Module
#
#   http://wiki.nginx.org/NginxHttpEventsModule
#
#----------------------------------------------------------------------

events {
    worker_connections  1024;
}

#----------------------------------------------------------------------
# HTTP Core Module
#
#   http://wiki.nginx.org/NginxHttpCoreModule
#
#----------------------------------------------------------------------

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    #
    # The default server
    #
    server {
        listen       80;
        server_name  _;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/share/phpMyAdmin/;
            index  index.php;
        }

        error_page  404              /404.html;
        location = /404.html {
            root   /usr/share/nginx/html;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #

        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
	#alias /usr/share/phpMyadmin/;

        location ~ \.php$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /usr/share/phpMyAdmin/$fastcgi_script_name;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    # Load config files from the /etc/nginx/conf.d directory
    include /etc/nginx/conf.d/*.conf;

}

Restart nginx

Now If all goes wel you should be able to access phpmyadmin on the server ip (if you didn’t mod the conf file)

Posted in CentOS, Nginx Optimizations | Tagged , , | Leave a comment

install NTP and configure to synchronize clock on centos

install NTP and configure to synchronize clock

Login as root user

Perform the following

yum install ntp

Turn on the service by performing the following:

chkconfig ntpd on

Synchronize click with  pool.ntp.org

ntpdate pool.ntp.org

Now start the service

/etc/init.d/ntpd start

Now verify that the clocks is correct by

date

and view the output.

 

 

 

Posted in CentOS | Tagged , , | Leave a comment

nginx ssl redirect causes endless loop

In nginx when using the rewrite rule for domain.com to www.domain.com

Ssl might cause your ssl with nginx to go into a endless loop.
By adding the following rule this should resolve your problem.

This can easily be resolved by editing your backend conf and adding the following to your fastcgi parameters

fastcgi_param HTTPS on;

Just restart nginx and now SSL shouldn’t cause anymore loops.

Now verify that your none www. redirects correctly over ssl ..

 

Posted in Nginx Optimizations | Tagged , , , , , | Leave a comment

Installing php-fpm for Cpanel

First we need to allow php changes in Yum. as Cpanel doesn’t want  you to play too much :D

Edit the file /etc/yum.conf

remove php* from the excludes

exclude=apache* bind-chroot courier* dovecot* exim* filesystem httpd*
mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin*
squirrelmail*

Now lets install the repo

 

rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm
Then install via Yum

yum –enablerepo=CentALT –enablerepo=epel install php-fpm

now edit /etc/php-fpm.conf

modify the user to match that of cpanel(nobody) group (nobody)

then start php-fpm
/etc/init.d/php-fpm start

This is usefull if your planning on installing nginx on your cpanel installation.

Then you no longer need to backproxy to apache.
But just let php-fpm process it for you.

 

 

 

Posted in CentOS, Cpanel | Tagged , , , , , , | 3 Comments

Trouble shooting mail relay issue’s

Troubleshooting mail issue's if costumers complain that certain mails aren't
reaching their destination. 

Open ssh and enter the following cmd replace with the correct address
/usr/lib/sendmail -f sender@whatever.com -v Receiver@receiver.com       

Control+D 

Then view the output.
Posted in Cpanel | Tagged , , , , | Leave a comment

Nginx for Magento

contents of /etc/nginx.conf

user admin apache;
worker_processes 4;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

# main server config

http {

include mime.types;
default_type application/octet-stream;

log_format main ‘$remote_addr – $remote_user [$time_local] $request ‘
‘”$status” $body_bytes_sent “$http_referer” ‘
‘”$http_user_agent” “$http_x_forwarded_for”‘;

#sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_static on;
gzip_vary on;
gzip_min_length 512;
gzip_buffers 256 8k;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml;
server_tokens off;

client_header_timeout 10m;
client_body_timeout 10m;
send_timeout 3m;

client_header_buffer_size 1k;
large_client_header_buffers 4 4k;

output_buffers 1 32k;
postpone_output 1460;

keepalive_timeout 60 15;

# virtual hosting
include conf.d/*.conf;
}

 

 

 

and this would be our Vhost file (under conf.d/)

 

server {

listen 80;
server_name yourDomain.com;

root /home/wwwdir;

location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
break;
}

location / {
index index.html index.php; ## Allow a static html file to be shown first
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento’s front handler
expires 30d; ## Assume all files are cachable
}
location /minify/ { ## Needed for Fooman Speedster
rewrite ^/minify/([0-9]+)(/.*\.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
}

## These locations would be hidden by .htaccess normally
location /app/                { deny all; }
location /includes/           { deny all; }
location /lib/                { deny all; }
location /lib/minify/         { allow all; }  ##
location /media/downloadable/ { deny all; }
location /pkginfo/            { deny all; }
location /report/config.xml   { deny all; }
location /var/                { deny all; }

location /var/export/ { ## Allow admins only to view export folder
auth_basic           “Restricted”; ## Message shown in login window
auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
autoindex            on;
}

location  /. { ## Disable .htaccess and other hidden files
return 404;
}

location @handler { ## Magento uses a common front handler
rewrite / /index.php;
}

location ~ \.php/ { ## Forward paths like /js/index.php/x.js to relevant handler
rewrite ^(.*\.php)/ $1 last;
}

location ~ .php$ { ## Execute PHP scripts

if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss

#expires        off; ## Do not cache dynamic content
fastcgi_pass   127.0.0.1:9000;
fastcgi_param  HTTPS $fastcgi_https;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
fastcgi_param  MAGE_RUN_CODE default;
fastcgi_param  MAGE_RUN_TYPE store;
include        fastcgi_params; ## See /etc/nginx/fastcgi_params

}
}

Posted in Magento, Nginx Optimizations | Tagged , , , | Leave a comment

Installing php-fpm on kloxo

Login to kloxo vps servers via ssh

 

first get the repo

rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm
Then install via Yum

yum –enablerepo=CentALT –enablerepo=epel install php-fpm

now edit /etc/php-fpm.conf

modify the user to match that of kloxo (apache) group (apache)

then start php-fpm
/etc/init.d/php-fpm start

Posted in CentOS, Kloxo | Tagged , | Leave a comment