How to install wkhtmltopdf on CentOS?

First, we need to know which version of wkhtmltopdf binary - 32bit or 64 bit- we need. To do so run this command in CLI:

getconf LONG_BIT

Now depending on the version of your CentOS dowload the first or the second link respectively for 32 and 64 bits:


cd /usr/src
wget https://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
wget https://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2

Install necessary packages:

yum install xz urw-fonts libXext openssl-devel libXrender

Tags:

Drupal Performance Best Practices

As Drupal is used more and more for large, high-traffic websites, it has become very important to focus on performance enhancements to Drupal and the underlying server infrastructure. In doing so, we are looking at improving both the number of requests that a Drupal site can handle, and to decrease the amount of time required to load a particular page, or an entire site in general.

Tags:

Sharing SSH session with screen

Sometimes, it is particularly illuminating to see how something is setup in SSH by another person in remote place. Particularly, we want the equivalent of a bunch of people huddled in front of a monitor while one person types. Surprisingly, this can be accomplished quite easily in Linux. Actually, this is one step better, anyone can type in the command line at any time, so no one actually monopolizes the keyboard. One person can create the screen by selecting a name for the session and then typing sudo screen -L -S

Tags:

Deleting _vti_cnf directories recursively

There are a number of issues concerning Drupal sites suddenly or slowly becoming broken along with error messages that have "_vti" as part of the issue. The certain themes (such as Multi-Flex) will definitely break the entire Drupal site if FrontPage Extensions are turned on, on a site. This is because the FrontPage extensions are somehow creating shortcuts in a directory that is parsed first before the main site files are parsed.

Tags:

Optimal my.cnf settings for large sites

[mysqld]
skip-networking
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
log-slow-queries = /var/log/mysql_slow.log
open_files_limit =24000
symbolic-links=0
thread_concurrency = 8
query_cache_size = 32M
thread_cache_size = 8
myisam_sort_buffer_size = 64M
read_rnd_buffer_size = 8M
read_buffer_size = 2M
sort_buffer_size = 2M
table_cache = 512
max_allowed_packet = 32M
key_buffer = 384M
max_heap_table_size = 64M
query_cache_limit = 2M

innodb_file_per_table = 1
innodb_additional_mem_pool_size = 16M
innodb_flush_log_at_trx_commit = 0

Tags:

InnoDB: Error: log file ./ib_logfile0 is of different size

InnoDB is insanely picky about it's config; if something's not right, it'll just give up and go home. To make a change to the log file size without data loss:

  1. Revert any config changes you've made to the log file size and start MySQL again.
  2. In your running MySQL: SET GLOBAL innodb_fast_shutdown=0;
  3. Stop MySQL
  4. Make the configuration change to the log file size.
  5. Delete both log files.
  6. Start MySQL. It will complain about the lack of log files, but it'll create them and all will be well.

Tags:

Modules that break Varnish caching, and how to fix them

Admin (v. 2.0)

Problem

Adds a DrupalAdminToolbar cookie that is needed server-side to prevent "slow load JS flicker"

Solution

Most users won't have access to the admin toolbar, so this is probably a moot point

More Info

See this exchange with module's maintainer, yhahn, on #open-atrium:

Tags:

How to setup custom nameservers with 1and1 control panel?

First create respective subdomains like ns1.mydomain.com and ns2.mydomain.com:

  • Go to 'Administration' > 'manage domains'
  • Click the little arrow on 'New' (left side of manage domains toolbar) and click on subdomains
  • Type ns1 for the subdomain and choose your domain from the drop down on the right
  • Go back to manage domains and click on 'DNS'
  • Enter ns1.mydomain.com for the primary nameserver and ns2.mydomain.com for the secondary nameserver

How to properly close MySQL port 3306 from outer networks

To close port #3306 from outside networks add this to /etc/my.cnf' under the [mysqld] section:


skip-networking

then run 'service mysqld restart' and then 'netstat -tln' to see if the port comes up in the list of open ports:

root@my:/var/named#
netstat -tln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN

Creating and mounting swap in SSH

Some server that I am working with has no swap space mounted in the server. Swap is necessary as backup of our physical memory in case system needs more memory than what it has at that time and also increase application loading speed especially when starting and closing application.

Swap space can be setup in 2 ways, as partition or as a file. Since this server is already online and I have many free partition left in “/” partition, so it may good for me just to create swap file rather than swap partition.

My variables as below:

OS: RHEL 5.7 64bit (Tikanga)

Tags:

Pages

Subscribe to Front page feed