Archive for the 'cPanel Support' Category

SBDavid

Install Memcache

Install Memcache

You can use the following steps to install Memcache in the server.

Before installing Memcache module, first you need to check the ‘libevent’ which is an essential :dependency for memcache module. You can follow the following steps:

cd /usr/local/src
wget http://monkey.org/~provos/libevent-1.3e.tar.gz
tar -zxf libevent-1.3e.tar.gz
cd libevent-1.3e
./configure
make
make install

The output of “make install” is very important as it lets you know where the compiled module was installed. The default library location is
/usr/local/lib. Open the configuration file;

vi /etc/ld.so.conf.d/libevent.conf (add the entry ‘/usr/local/lib’ )
Check whether the libevent is completely installed.
ldconfig -v |grep libevent

Now you can install the “Memcache” module.

wget http://danga.com/memcached/dist/memcached-1.2.4.tar.gz
tar zxvf memcached-1.2.4.tar.gz
cd memcached-1.2.4
./configure
make
make install

Now you can check whether the Memcache module has properly installed.

which memcached
/usr/local/bin/memcached -d
memcached -d -m 256 -u nobody -p 11211 -l 192.x.x.x (Server IP)
ps -ax |grep memcached
netstat -plan |grep memcached

Setting up the firewall for Passive FTP: (APF Firewall)

1.Open your APF configuration file with your favorite editor. This configuration file is usually located at: /etc/apf/conf.apf

vi /etc/apf/conf.apf

2. Select a port range to use for the passive FTP connection, and find the line that looks like this:

IG_TCP_CPORTS=”20, 21, 22, 25, 53, 80, 110, 143, 443, 465, 993, 995, 2082, 2083, 2086, 2087, 2095, 2096, 3306″

If this list of ports already includes a port range above 20000, then you can skip onto configuring your FTP Server, but remeber the range listed. (20000 to 30000 would be written as 20000_30000)

3. Add the port range to the end of the line and within the quotation marks(”). Remeber each port/port range is seperated by a comman(,), and a port range between 35000 to 36000 is written as 35000_36000 .

IG_TCP_CPORTS=”20, 21, 22, 25, 53, 80, 110, 143, 443, 465, 993, 995, 2082, 2083, 2086, 2087, 2095, 2096, 3306, 35000_36000″

3. Save and restart your firewall.

To restart your firewall:

/etc/init.d/apf restart

Restrict users to their home directory in VSFTP

Sometimes you may want to restrict users to their home directory while doing FTP. You can achieve this in VSFTP with the following steps.

1. Open the VSFTPD configuration file “/etc/vsftpd.conf” . Uncomment the following lines.

chroot_local_user=YES
chroot_list_file=/etc/vsftpd.chroot_list

2. Create the file “/etc/vsftpd.chroot_list” and place the user names (one per line) that you want to restrict in that file.

3. Restart VSFTPD to take effect.

/etc/init.d/vsftpd restart

After this users listed in the file “/etc/vsftpd.chroot_list” will be locked up in their home directory.

Ftp error “553 Disk full - please upload later”

Problem: You get the ftp error “553 Disk full - please upload later”, even when the quota of the user has not been exceeded and the disk partition in which all the user accounts reside (say /dev/sda5) is not full.

Cause: The value of the variable ‘MaxDiskUsage’ in the pure-ftpd configuration file (/etc/pure-ftpd.conf ) will be equal to or less than the percent use of the partition.

——————————————–
root@ [~]# grep MaxDiskUsage /etc/pure-ftpd.conf
MaxDiskUsage 90
——————————————–
#df
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 144G 59G 78G 90% /
——————————————–

Solution: Change the MaxDiskUsage value to 99 (Some high value) and restart pure-ftpd.

Configuring FTP server for passive mode.

The common issue faced while running FTP in passive mode is the firewall.

Usually, in FTP servers like pure-ftp, the Passive Port Range can be specified in its configuration file itself.

But, if the Passive Port Range isn’t specified, the server uses the locally available ports for FTP.

These port ranges are specified in /proc/sys/net/ipv4/ip_local_port_range file.

Please follow the below method so that the ports remain constant and FTP runs smoothly.

1. Configure sysctl and set the port range in /etc/sysctl.conf as, net.ipv4.ip_local_port_range

2. sysctl -p would load the new kernel values.

3 Open the port range specified above in your firewall.

« Prev - Next »