LAMP LAMP is an acronym for a solution stack of free, open source software, originally coined from the first letters of
Linux (operating system)
Apache HTTP Server
MySQL (database software) and
Linux - Unix-like computer operating system, open-source software.
Apache - Open source web server.
MySQL - Multithreaded, Multi-user, SQL DBMS.
PHP - Reflective programming language originally designed for producing dynamic web pages.
Easy to code with PHP and MySQL.
Easy to deploy a PHP app. Once we’ve got MySQL running, we can simply upload our .php files.
Cheap and ubiquitous hosting
LINUX Linux is a Unix-like operating system that was designed to provide personal computer users a free or very low-cost operating system comparable to traditional and usually more expensive Unix systems.
Linux has a reputation as a very efficient and fast-performing system.
Linux was developed by Linux Torvalds at the University of Helsinki in Finland.He started his work in 1991.
The effort expanded with volunteers contributing code and documentation over the internet.
It is currently developed under the GNU public license and is freely available in source and binary form.
LINUX COMMANDS 1) cd -“Change Directory”.
2) trap -Used to trap one or more signals and then decide action. 3) pwd -“Print Working Directory”. Shows the current location in the directory tree.
4) ls - List all files in the current directory, in column format. 5) clear -Clear the terminal screen. 6) touch -Create empty file of zero byte. 7) rm -Delete a file. 8) which -Shows the full path of shell commands found in our path.
9) locate - A quick way to search for files anywhere on the filesystem. 10) ps -Lists currently running process (programs). 11) w -Show who is logged on and what they are doing.
12) File - Knowing the File Type. 13) chown -Changing owner of a file. 14) unmask -Default file permission. 15) split -Split files Horizontally. 16) df - Report filesystem disk space usage. 17) id - Print your user-id and group id's
18) spell -displays a list of misspelled words. 19) ispell -Interactive spell-check program. 20) move -used to view the contents of the file page by page. 21) echo -Display text on the screen.
22) date -date to set your server's date and time 23) finger -Use finger to see who's on the system 24) cal -displays a calendar 25) mv -Move or rename files 26) shutdown -Shuts the system down.
27) whereis -Show where the binary, source and manual page files are for a command 28) who - show who is logged on 29) which -Find Command path 30) chmod -change file permissions
LINUX DIRECTORY STRUCTURE
LINUX DIRECTORIES < / >
The root directory.
The starting point of your directory structure.
This is where the Linux system begins.
Every other file and directory on your system is under the root directory.
Usually the root directory contains only subdirectories.
< /boot > The place where Linux keeps information that it needs when booting up. < /bin > The /bin directory contains the most important programs that the system needs to operate, such as the shells, ls, grep, and other essential things.
< /lib > The shared libraries for programs that are dynamically linked. < /sbin, /usr/sbin > Most system administration programs are stored in these directories.
< /mnt >
This directory is used for mount points.
The different physical storage devices must be attached to some directory in the file system tree before they can be accessed.
This attaching is called mounting, and the directory where the device is attached is called the mount point .
< /usr > Contains user applications. /usr is the largest directory on a Linux system. </usr/share> Config files and graphics for many user apps. < /usr/local > This is where you install apps and other files for use on the local machine.
< /var >
It variable data that changes constantly when the system is running.
Some interesting subdirectories:
</var/log > - contains system log files.
</var/mail> - Incoming and outgoing mail.
</var/spool> - This directory holds files that are queued for some process, like printing.
ed - Original UNIX line-based editor, useful in scripts emacs - GNU editor and fully integrated user environment ex - Powerful line-based editor (integrated with vi) Editors
gawk - GNU awk, powerful text editor for records containing fields sed - Stream-oriented (non-interactive) line-based editor vi - Classic screen-based editor for UNIX vim - Vi IMproved, enhanced support for programmers
vi stands for Visual Editor
Full- screen editor
This editor is started by using the command vi at the shell prompt.
It works in three modes:
vi EDITOR *command mode *input mode *ex mode
SHELL $vi malnad :x,:wq,:q! <enter> command mode insert mode edit Text input THE SHELL PROMPT MODES OF THE VI EDITOR o,O,r,R,i,I,s,S,a,A into vi zz <esc> ex mode
Modes *Command mode:
User enters this mode as he/she enters the vi environment using vi cmd.
Keys pressed by the user are interpreted to be the editor commands.
The user can get into the input mode by giving any one of the following:
o,O - Opening a line,
r,R - Replacement,
i,I - Insertion
s,S - Substitution
a,A – Apendition
(read as Orissa) The control can be brought back to the command mode by using <Esc> key. o,O,r,R,i,I,s,S,a,A
Also known as last-line mode and allows the user to use the commands in the bottom of the vi screen.
In fact last line is called as command line .
User can get into ex mode from command mode by typing (:) character.
User can get back to the command mode from ex mode by using Enter key.
The control can be brought back to the command mode from input mode by using <Esc> key.
The actual editing is done in vi editor in the buffer called editor buffer. Following cmds are used to quit from vi editor: 1. zz -last command.Saves the file in change mode and then quits. 2. :w -Just saves or writes the buffer contents on to disk file and remains in cmd mode. Quitting the vi Editor
3. :x -Saves the file in change mode and then quits. 4. :wq - write and quuit.Behaves exactly like :x. 5. :q -Quits the vi env --if change made in editor is already written. --if changes made is not written or saved.It will give suitable message. 6. :q! -Quits the vi env without saving the buffer contents even changes are made.
MOVING THE CURSOR 1.Moving by One Position: I j Backspace Moves cursor by one character position left. Moves cursor up one line from its present position in same column. Moves cursor down one line from its present position in same column. Spacebar Moves cursor by one character position right. k h
Moving the cursor: $(dollar) - Moves to the end of the Current line 0(zero) - Moves to the beginning of the Current line. ^(caret) -Moves to the first non-blank character at the beginning of the Current line
H(High) -Moves to beginning of Top line of current screen. L(Low) -Moves to beginning of last line of current screen. M(Middle) -Moves to beginning of Middle line of current screen.
*Audacity: Audacity is a free, easy-to-use audio editor and recorder for Windows,Mac OS X, GNU/Linux and other operating systems. *Grip: A cd-player and cd-ripper for Gnome desktop. APPLICATIONS
*Inkscape: An Open Source vector graphics editor similar to Illustrator, CorelDraw using the W3C standard Scalable Vector Graphics (SVG) file format. *Ardour: U sed to to record, edit and mix multi-track audio.
Cron Tab and Cron Job
The Cron, at, batch Command is used for Scheduling Execution of Command according to requirements.
The term cron is derived from the word chronograph.
Cron is a system deamon that keeps sleeping most of the time.
It typically wakes up every one minute and checks it crontab file for any jobs to be executed during this minute.
All users have a crontab file of his or her own.
The name of this crontab file will be the user's login name.
Scheduled jobs will be present in crontab file.
Cron tab files will be present in the
/var/ spool/ cron/ crontabs directory .
A crontab may contain one or more files,each corresponding to a command that is to be executed periodically at a specific day, date and time.
Minute (0-59) Command to be executed day of week (0-6) 0 being sunday month(1-12) day of month (1-31) Hour (24-h format) Syntax of a crontab line Every line is made up of six fields seperated by a Blank .
In crontab line, an asterisk (*) represents all possible values.
For example, if a * character appears in the fifth field, then the command mentioned in the line will be executed on all days of the week at the specified time.
No spaces will be allowed within a field.
If neccessary group of numbers can be specified within a single field seperated by commas.
Below are two typical crontab lines. 1. 0 0 * * * backup.sh When executed, the above line runs the backup.sh script at midnight everyday .
2. 00,30 09-17 * * 1-5 mail.sh When execute, the above lines runs the mail.sh script on all weekdays-Monday to Friday every half hour between 9 and 17 hours
When more than one command is executed,
every cmd has to be written in a seperate line having the above format in a seperate file.
Then it is submitted to crontab command, as shown below, where cmdfile is the name of the file executed periodically.
Who can use cron facilities:
Only System administrators are permitted to use.
However, in certain cases,certain users are permitted to use.
The username of those users will be in a file named cron.allow.
And cron.deny -contains name of user to whom respective facilities are denied.
Obviously system administrator maintains all these files.