Address already in use: make_sock: could not bind to port 80

I often found the apache's error. 

Address already in use: make_sock: could not bind to port 80?

My solution is reboot server. But it's not practical because you may lose SLA. Here's correct solution.

#netstat -tulpn| grep :80
#killall -9 httpd
#/etc/init.d/httpd start

Replace ^m With newline

Open file with vi or vim

:%s/^m/\r/g

Please hold ctrl + m + v. That is ^M

Replication Content By Using Rsync

We have some project that use rsync for replication content between machines. Here's shell script. The features are when content on Machine A is deleted, content on machine B also is deleted too.

#!/bin/bash

#dv backup script

src=/source/data/*
[email protected]:/destination
log=/path/to/log/file


echo "---" $(date) "-------------------" >> $log

rsync -t -r --verbose -p --delete --ignore-errors --exclude 'tmp' --exclude 'logs'  $src $dest >> $log

echo "--------------- END ---------------" >> $log

The setup crontab for syncing content. You can use exclude for ignore folder.

Check Data Usage on MSSQL2005

Here's SQL Command for checking available space on SQL 2005

select DB_NAME() as dbname,name as filename,size/128.0 as currentsizeMB,
size/128.0 - CAST(FILEPROPERTY(name,'SpaceUsed') as INT)/128.0 as FreeSpaceMB
From sys.database_files

Remove public or index.php from URL

I use much time for solving the problem about remove index.php from url on laravel 4. The step is easy. You have to create .htaccess file on root directory, then copy Rewrite Rule as below.

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Note : Make sure mod_rewrite works!

Pages