Showing posts with label All-OS. Show all posts
Showing posts with label All-OS. Show all posts

Monday, 19 May 2014

Find....

  • Find and compress files older then X days
find /path/to/files/ -type file -mtime 1 -exec gzip {} \;

1 means 24 hours old
-1 means less than 24 hours old
+0 means more than 24 hours old
+1 means more than 48 hours old

  • Find and compress files older then 5 days and exclude files already compressed (ext .gz)

find /path/to/files/ \( ! -name *.gz \) -type file -mtime +5 -exec gzip {} \;

Monday, 22 October 2012

Install LAMP on CentOS


CentOS 5.7


  • Install Mysql
  • Install Apache with Php

1.Install Mysql Server

# yum install mysql mysql-server

2.Start and Enable Mysql service

# systemctl start mysqld.service
# systemctl enable mysqld.service

Create Mysql password  with  :

# mysqladmin -u root password [your_password_here]

Check the connexion  to the databae server with:

# mysql -h localhost -u root -p

2.Install HTTPD and  PHP

a.Install Apache (httpd)

# yum install httpd php php-common

b.Start  and  enable  httpd  service

# /etc/init.d/httpd start

 ---OR---

# service httpd start

# chkconfig --levels 235 httpd on

3.Check if php works

create a .php test file

# vi /var/www/html/info.php

insert:

<?php
phpinfo();
?>

save and    open browser to check   : http://ip/info.php


DONE