January 14th, 2010 by admin
I really started to like nginx web server, and here is my procedure step by step how to install this server on CentOS 5.4
yum install gcc pcre-devel openssl-devel
wget http://nginx.org/download/nginx-0.7.65.tar.gz && tar xvfz nginx-0.7.65.tar.gz
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module
make
make install
ln -s /usr/local/nginx/conf /etc/nginx
ln -s /usr/local/nginx/logs /var/log/nginx
ln -s /usr/local/nginx/sbin/nginx /usr/sbin/nginx
Then grab this init script for red hat from http://wiki.nginx.org/RedHatNginxInitScript and put it in /etc/init.d/nginx file. Chmod 755 the file and you are ready.
Posted in General linux admin | No Comments »
November 10th, 2009 by vicky
I had strange problem on one of my CentOS 5.4 servers. I stoped auditd service and disables SElinux, the server, however, was still logging all those annoying things like
Nov 10 18:27:01 server kernel: type=1105 audit(1257874021.909:87975): user pid=27986 uid=0 auid=0 msg=’PAM: session open acct=”root” : exe=”/usr/sbin/crond” (hostname=?, addr=?, terminal=cron res=success)’
Nov 10 18:27:02 server kernel: type=1104 audit(1257874022.828:87976): user pid=27986 uid=0 auid=0 msg=’PAM: setcred acct=”root” : exe=”/usr/sbin/crond” (hostname=?, addr=?, terminal=cron res=success)’
into /var/log/messages log, filling it up with garbage.
After some time spent investigating I fixed it. I edited /etc/audit/audit.rules and replaced line
-D
with this line
-e 0
After that I started auditd service, stopped it and no more logs in /var/log/messages
Posted in General linux admin | 1 Comment »
November 5th, 2009 by vicky
Have you ever wondered how to show line numbers in vi or vim while editing file? I do that always when I patch some software or install MODs that come with “go to line xxx and rewrite this…”. And the solution is really simple.
In vi/vim type :set number to show line numbers and :set nonumber to hide line numbers.
Posted in General linux admin | No Comments »
March 8th, 2009 by vicky
Not seeing hidden linux files ( dot beginning files) in your ftp you can enable this option in your ftp client. (show linux hidden files). It it does not work you can force your linux ftp server to show them via this command in /etc/proftpd.conf
ListOptions -a
Put it into the conf file and restart proftpd service.
Posted in General linux admin | No Comments »
March 1st, 2009 by vicky
I recently got to administer a few linux boxes and wondered why vi does not show colors when I edit files. Some servers did it, some did not. It was differently set up by datacenter images and I really did not have time to investigate.
Now it just annoyed me because I could not find few syntax errors on one server and here is the solution.
Open up some file in vi or vim and hit ESC, then type “:syntax on” and the magic happens… let there be color
If you do like it without color, type “:syntax off”
Posted in General linux admin | No Comments »
November 5th, 2008 by vicky
Here is how I speed up apache by compressing pages with mod_deflate module and setting higher cache expiration times in mod_expires module. Here is how… Read the rest of this entry »
Posted in General linux admin | No Comments »
October 14th, 2008 by vicky
Ever wondered how to disable the email alert sent when cron is executed? Easy help, there are various ways to achieve this, so feel free to use the one you like the best.
They all work, though. Read the rest of this entry »
Posted in General linux admin | No Comments »
August 20th, 2007 by vicky
I always wanted to see mail stats on my server, who receives and sends the most mails, what are the busiest hours, etc.. to better track mail problems, catch spammers and to satisfy my admin’s ego
. I found this little script that goes through senmail’s log and produces output. In my case I will send the output to root via email.
Here are the features that I receive from this little script:
SendmailStats reports:
- Time/date of log beginning and end
- Total bytes transferred and total MB transferred
- Total bytes in and total MB in (locally delivered)
- Number of messages sent out
- Number of messages coming in
- Messages per hour graph
- Top 20 remote sending hosts
- Total number of sending hosts and number of their attempted messages
- Top 20 destination hosts
- Total number of destination hosts and number of messages sent to them
- Top 20 local deliveries
- Total number of local accounts that received mail
- Total number of messages delivered locally
- Top 20 senders
- Total number of senders and total number of messages sent Read the rest of this entry »
Posted in General linux admin | Comments Off
August 16th, 2007 by vicky
I have been noticing a very annoying delay when trying to log in via FTP on servers where I use proftpd. Everything works, but when I try to connect, 5 – 10 seconds pass by before I’m prompted for my login credentials. After long hour of searching on the internet I found a solution.
All you need to do is edit the config file which should be /etc/proftpd/proftpd.conf and place this line within <global> section:
IdentLookups Off
That should remove the delay and your ftp connection will be initialized very quickly.
Posted in General linux admin | No Comments »
March 25th, 2007 by vicky
I will show you here how to set correct date and time on your server. All steps need to be done as root (which I assume you know).
To set correct time issue this command
/usr/bin/rdate -s time.nist.gov
It will connect to time server and synchs your time and date. After that command execute
/sbin/hwclock --systohc
which sets ‘permanent’ clock from the system time so that the time will be correct next time you reboot.
You can do this via a NTP daemon but it is too complicated for such an easy task as setting the date and time.
Posted in General linux admin | No Comments »