You are hereDrupal 6

Drupal 6


Simplenews Content Selection - sorting of nodes

In this module default sort is just terrible, terrible idea. If you are creating newsletter, chances are you will want to put newest content in it. Currently you have oldest nodes first and newest on 10th page. So you will have to change sort each time you create NL. This is just bad design. I recommend to people to put a new link in menu, before that select sort by date and get variables will change in URL and then add that to menu to have sort that you want.

admin/content/scs_node_selection/nodes?sort=desc&order=Created

Drupal 6 to drupal 7 migration tips

However you choose to do a migration from drupal 6 to drupal 7 if you have any complexity in your site it is going to be ugly. Lots of errors and leaps of faith :-).

I choose to do it with drush. So after the drush made what it could do. I tested the site. Not working at all, not even logging in possible. What I did is:

Files: 

Where is drush installed (using drush sup and search for alisases.drushrc.php)

Maybe you are wondering the same thing as I, where the heck is my drush installed. Easiest way is to write "find / -name 'drush' -type d" and you will get info. So finally you know where that alisases.drushrc.php is and you can go and add configuration for drupal 6 to drupal 7 migration.

If this doesn't help you, try commands

which drush or drush status

Usually you would find drush in /usr/share/php/drush or /usr/share/drush and aliases file is in that directory as well.

Also as it is said in drush example.aliases.drushrc.php

Migrating from drupal 6 to drupal 7 with drush sup (site upgrade)

Drush is fast for updateing modules, now there is also add on for upgrading modules from drupal 6 to drupal 7. You need to install http://drupal.org/project/drush_sup
Everything you need is in readme file, but the one important thing. You need to set alias for your new destination, your drupal 7 site version destination so you don't overrun drupal 6 and lose your original. But the problem is that you will get

Site alias not found: @test. See example.drushrc.php.

Installing and configuring APC on debian and ubuntu

Another caching engine for drupal is APC, http://drupal.org/project/apc before you install module you need to install it on you linux. And before you install APC you need to install some other dependencies, otherwise you will get errors.

So you need to run

install make

install libpcre3-dev for debian and install pcre-devel for ubuntu

and maybe also install build-essential and php-pear if you dont have it already

then finally you run

sudo pecl install apc

Fcgid and phpmyadmin 403 permission denied error

If you installed fcgi and got 403 error when trying to run phpmyadmin, you just need to add one thing and it is to edit /etc/phpmyadmin/apache.conf to add +ExecCGI in the section

<Directory /usr/share/phpmyadmin>
Options FollowSymLinks +ExecCGI
DirectoryIndex index.php
....

Remove root user access

Having root user access available is good foundation to have your website(s) or server hijacked. Why well they know username they need to just go through different passwords to try and guess and belive me people do have software and servers doing this so they can gain something out of that theft. Today I just checked my log files and saw some chineese IP's trying to break in. Really what could I do if they do, just cry about it. So first step is remove root user.

So we create new username when logged in as root.

adduser new_user

Memcache and admin

If you are planing to do some optimization for your server, I would recommend to use memcache at least for your drupal admin pages. When installed it will cache some vital tables that will make faster your admin, even if you use boost and static pages for all your content and your visitors, install this module, it is rather easy this days to do it.

More here

http://drupaldump.com/memcache-setting-drupal-7
http://drupaldump.com/installing-and-configuring-memcache

Adding menu level value to CSS class

I need to theme a menu so that each level has different class in CSS. This needs to be done over template.php and additional code that adds menu level value to your links.

Here is the code you paste in template.php for drupal 7

function template_menu_link(array $variables) {

$element = $variables['element'];
$sub_menu = '';

if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
$output = l($element['#title'], $element['#href'], $element['#localized_options']);

Apache, higher performance - MPM worker and Fcgid

After reading on many places that drupal should work better with MPM-worker and fcgid I decided to swith my debain to that configuration. For that I had to do the usuall, collect the info around the web and hope for the best. So here goes information about this on Debian Linux.

First we need to install worker and FastCGI

apt-get install apache2-mpm-worker libapache2-mod-fcgid

then enable

a2enmod fcgid

then some more install

aptitude install php5-cgi php5-cli