Showing posts with label admin. Show all posts
Showing posts with label admin. Show all posts

Tuesday, February 20, 2007

X-Sendfile for large file transfers

I read Lighttpd’s weblog (Lighty’s Life) regularly and I remember Jan talking about X-Sendfile. I thought it was interesting, but never really thought about using it…. Until today!

Basically, if you have a Ruby on Rails (or other environment) page that transfers a really massive file to the client, you should use X-Sendfile.

Here is what you’ll need:

*Lighttpd Configuration*

To the FastCGI section of your lighty config, along with host, port, etc., add “allow-x-send-file” => “enable”


fastcgi.server = ( ".fcgi" =>
( "server_1" => ( "host" => "10.0.1.1", "port" => 8000, "allow-x-send-file" => "enable" )
)

Saturday, February 03, 2007

Ssh keys

you need to edit /etc/ssh/sshd_config and disable password auth

but before that, you need to make sure you have the ssh keys set up, and the authorized_keys entry, and the directory permissions.

i usually just
ssh-keygen -t dsa -b 1024
that creates
$HOME/.ssh/id_dsa
$HOME/.ssh/id_dsa.pub
then cat $HOME/.ssh/id_dsa.pub >> $HOME/.ssh/authorized_keys
then chmod -R 700 $HOME/.ssh
then edit /etc/ssh/sshd_config to set password auth = no,
or something.

but the quickest defencse is to edit the sshd startup script and add
-p 1234
or some other not commonly thought of port

so then it can work as it is, but you just
ssh -p 1234 yourbox.
when ssh keys are working properly, you should be able to ssh without entering a password.

so your system would have the private, public keys, and the remote web server only needs to have the entry of the id_dsa.pub appended to authorized_keys

Monday, January 22, 2007

VMWARE in linux 2.6.19-1.2895 Fedora Core 6

had compile errors for vmware compilation with kernel 2.6.19

make[1]: Entering directory `/usr/src/kernels/linux-2.6.19'
CC [M] /tmp/vmware-config0/vmnet-only/driver.o
CC [M] /tmp/vmware-config0/vmnet-only/hub.o
CC [M] /tmp/vmware-config0/vmnet-only/userif.o
/tmp/vmware-config0/vmnet-only/userif.c: In function `VNetCopyDatagramToUser':
/tmp/vmware-config0/vmnet-only/userif.c:629: error: `CHECKSUM_HW' undeclared (first use in this function)
/tmp/vmware-config0/vmnet-only/userif.c:629: error: (Each undeclared identifieris reported only once
/tmp/vmware-config0/vmnet-only/userif.c:629: error: for each function it appears in.)
make[2]: *** [/tmp/vmware-config0/vmnet-only/userif.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmnet-only] Error 2
make[1]: Leaving directory `/usr/src/kernels/linux-2.6.19'
make: *** [vmnet.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmnet-only'
Unable to build the vmnet module.



so after finding some hints ( http://www.vmware.com/community/thread.jspa?messageID=512232)

I dit the foloing !! use on own RISK I dont now if this change is OK!! but it works

cd /usr/lib/vmware/modules/source/
cp vmnet.tar vmnet.tar_orig
tar xf vmnet.tar
vi vmnet-only/bridge.c (comment out First line and add second line)
----------------------------
/*if (skb->ip_summed == CHECKSUM_HW) { */
if (skb->ip_summed == CHECKSUM_COMPLETE) {
---------------------------
vi vmnet-only/userif.c
---------------------------
/* skb->ip_summed == CHECKSUM_HW && */ /* Without checksum */
skb->ip_summed == CHECKSUM_PARTIAL &&
---------------------------

tar cf vmnet.tar vmnet-only



I also did this for an other error touch /usr/src/kernels/linux-2.6.19/include/linux/config.h [dont do this do the ln instead ]

sudo ln -s autoconf.h config.h
in
/usr/src/kernels/2.6.19-1.2895.fc6-i686/include/linux
Afther this everything else went fine