r00t.gr

Programming and more

Entries for the ‘Apache’ Category

How to see what programs use the most memory in linux

You have to run:   ps aux | sort -nk +4ps aux | sort -nk +4 That will print you a list of all the running applications and it wil sort them by the 4th column (memory) The same can be applied for CPU, Virual memory etc. Just change the -nk +4 value to +3 […]

How to add expires headers on css, javascript and image files

I tried many things I found googling but nothing work, until I saw this: Assuming you are using apache, what you must do is go to you public_html folder, create a file .htaccess and paste in it:     <FilesMatch "\.(ico|pdf|flv|jpe?g|png|gif|js|css|swf)$"> ExpiresActive On ExpiresDefault "access plus 1 year" </FilesMatch> <FilesMatch "\.(ico|pdf|flv|jpe?g|png|gif|js|css|swf)$"> ExpiresActive On ExpiresDefault "access […]

How to install apache mod_expires In directadmin DA centos linux

cd /usr/local/directadmin/custombuild mkdir -p custom/ap2 cp configure/ap2/configure.apache custom/ap2/configure.apache vi custom/ap2/configure.apachecd /usr/local/directadmin/custombuild mkdir -p custom/ap2 cp configure/ap2/configure.apache custom/ap2/configure.apache vi custom/ap2/configure.apache add: –enable-expires so it looks like this: #!/bin/sh "./configure" \ "–prefix=/etc/httpd" \ "–exec-prefix=/etc/httpd" \ "–bindir=/usr/bin" \ "–sbindir=/usr/sbin" \ "–sysconfdir=/etc/httpd/conf" \ "–enable-so" \ "–enable-dav" \ "–enable-dav-fs" \ "–enable-dav-lock" \ "–enable-suexec" \ "–enable-deflate" \ "–enable-unique-id" \ "–with-suexec-caller=apache" \ […]

Delete all subfolders with specific filename in linux, recursively

I used Subversion for a project I did, they I stopped developing that, then after a long time, I found that folder and i wanted to copy it locally. There was one problem, Subversion, created a folder named .svn in all the subfolders, and this had some more more folders in it (3-4 folder). I […]

How to redirect all non www traffic to www

I found that it is usually a good idea, to redirect all trafic that doesn’t have www infront of the domain to www.domain.com. I explain how to do it with apache mod_rewrite in the end of the post, scroll there if you just need the answer. Let’s say, a user types http://domain.com he should redirect […]