Whatever you do, don’t panic!
Posts tagged debian
MySecureShell – chrooted SFTP server
Sep 20th
Yesterday the wonderful Howtoforge had an article that finally freed me from my beloved/hated scponly. MySecureShell offers all the functionality of a proper SFTP server, easily configurable and very well integrated.
To get it up and running on Debian, just download the latest *.deb version from Sourceforge.
Then install it with the following command:
dpkg -i mysecureshell_0.95_i386.deb
Now for every SFTP user you want on your system just do the following (substitute ‘test’ with your desired username).
Add a normal user to your system:
adduser test
Open the file /etc/passwd and change the user’s shell from /bin/bash to /bin/MySecureShell. The line then should look something like this:
test:1111:1111::/home/test:/bin/MySecureShell
Alas, you have a chrooted SFTP only user, without the clutter of numerous additional directories for the chroot. Simple and elegant
The last step is to have a look through the config file in /etc/ssh/sftp_config, it’s pretty well documented!
Installing eAccelerator on Debian
Mar 2nd
This is a quick HowTo for installing the eAccelerator PHP cache/optimizer on a Debian system (should be applicable to other Linux distros as well).
- Download the latest release from SourceForge.net to your server and extract the sources.
- Change to the sources directory and type in the following.
export PHP_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
This should set up the environment and compile configuration correctly. - Now compile with make and install with make install (as root) afterwards.
- To configure eAccelerator you have to edit your PHP config which resides in /etc/php4/apache2/php.ini on my system.
Add the following lines at the end:extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
The file README in the sources directory gives a pretty good explanation of all those parameters. The only one you should probably alter is the shm.size because 16MB of shared memory might be a little bit too conservative. - Last step is to create the directory where eAccelerator stores the cached scripts which don’t fit into the shared memory.
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
Now you’re done. Further tweaking can be accomplished by altering all the parameters in the php.ini file.
Installing php5-cgi on Debian
Jan 26th
For a long time I wanted to be able to run both PHP 4 and PHP 5 on the same server. Now I finally managed to come up with a solution that is easy to install and easy to use.
- Add the Debian Backports repository to your /etc/apt/sources.list
deb http://www.backports.org/debian/ sarge-backports main contrib non-free(on one line) - Issue a package update: aptitude update
- Install PHP 5 as CGI module: aptitude install php5-cgi
- Configure Apache by adding the following lines to your main config file. In my case this was /etc/apache2/apache2.conf
ScriptAlias /php5-cgi /usr/lib/cgi-bin/php5
Action php5-cgi /php5-cgi - Now find the Virtual Host you want to run on PHP 5 and simply put the following line into the <Directory> directive.
AddHandler php5-cgi .php
This overrides the default handler for files ending in .php which would be the normal PHP 4 module. Whit this directive it is now parsed and executed by the PHP 5 CGI binary. - Reload your webserver config with
/etc/init.d/apache2 reload










