Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Jun 072008
 

Copy file to remote server using scp

Answer:

To copy file from local machine to remote server, it is easy with scp

e.g.

# scp test.txt john@remoteserver:/home/john/

The above command copy the file test.txt to the remote folder /home/john, of the machine remoteserver.

May 172008
 

Set the default index page for Apache

Answer:

To set a custom default index page for Apache, you would need to use the DirectoryIndex directive

E.g. set the default page to index.php

Add the following lines to the Apache configuration (httpd.conf)

DirectoryIndex index.php index.html

The meaning of above config: If index.php is found, use it as the default page, else, fall back to look for index.html.

Restart Apache to take effect

# apachectl -k graceful

May 132008
 

Install mlocate for quick file search in Linux

Answer:

mlocate is a useful tool for quickly find files on the filesystem based on their name.

To install

# sudo apt-get install mlocate

After install, you would need to build the database for the first time

# sudo updatedb&

Now the database building/indexing is running in the background, when it is finished, you can use the locate command to lookup file in your filesystem.

# locate SHA1.pm
/usr/lib/perl5/Digest/SHA1.pm