Buy the wrong movie tickets, tears also have to see-lamp construction & Linux basics, movie ticket-lamp_php tutorial

Source: Internet
Author: User
Tags syslog

Buy the wrong movie tickets, tears also have to see-lamp build &linux Foundation, movie tickets-lamp


Hi

Did not say, last Friday, the roommate had a treat, in the Longhu eat hey drink cool, go back on the road. Well this Monday to see the final blockbuster of the Year, Mars Rescue, who know Lao Tze eyes, bought the wrong movie time ... The Saturday agreed to advance to this afternoon, Madan, send all can not send out, only knock class to see

1. LAMP

-----Building Lamp Environment (II)-----

----Add common extensions to PHP

GD and curl, order to find it online, this is too long.

liang@liang-andy:~$ sudo apt-get install php5-gd Curl Libcurl3-dev Php5-curl
It's a little long time.

To verify, first restart the Apache2 service, and then go to the last mentioned probe file, that is, to see phpinfo there are rice

----FileZilla

SSH tools, managing server files

-----Lamp Environment Configuration Optimization (i)-----

----Lamp Environment File Overview

Common sense

/etc--ubuntu System profile Directory, the configuration file of software installed by Apt-get command is here

Lamp's here, too.

/etc/apache2

/etc/mysql

/etc/php5

----Environmental Documentation

---

Open the list of apache2 files first

liang@liang-andy:~$ Cd/etc/apache2
liang@liang-andy:/etc/apache2$ LL
Total Dosage 96
Drwxr-xr-x 8 root root 4096 November 23 19:08.
Drwxr-xr-x 134 root root 12288 November 25 12:37. /
-rw-r--r--1 root root 7115 January 7 apache2.conf
Drwxr-xr-x 2 root root 4096 November 19:08 conf-available/
Drwxr-xr-x 2 root root 4096 November 19:08 conf-enabled/
-rw-r--r--1 root root 1782 January 3 Envvars
-rw-r--r--1 root root 31063 January 3 Magic
Drwxr-xr-x 2 root root 12288 November 19:21 mods-available/
Drwxr-xr-x 2 root root 4096 November 19:21 mods-enabled/
-rw-r--r--1 root root 320 January 7 ports.conf
Drwxr-xr-x 2 root root 4096 November 19:08 sites-available/
Drwxr-xr-x 2 root root 4096 November 19:08 sites-enabled/

Apache2 has apache.conf, which is the total entry of the configuration file, can include many other configuration files--configuration is more flexible, and the total file is not very large

Core configuration:mods-*** Apache module; sites-*** Virtual host

can be used avaliable (available) and enabled (enabled) (see the last column of the above command)

The soft connection is made with the ln-s command between enabled and avaliable. equals to say that the module itself is like a lamp, then the command is a switch

---

MySQL and PHP

The core is my.cnf and php.ini, respectively.

Detailed later

2. Linux Basics

The environment is the centOS6 and SSH tool in VM VMS XSHELL5

Shortcut keys, ctrl+l

-----Common commands for Linux (i)-----

We need to know about 6 or 70, and we'll probably have 200 of them in the future.

[Root@andy ~]#

User @ Host Name ~ Current location (folder) #超级用户提示符 $ normal User prompt

Note that the user in Linux is not admin; The default hostname is localhost;~ represents/root, referred to as home

[Root@andy ~]# cd/root address is constant

Normal user's home directory is level two address

----command format

command [options] [parameters]

Note that individual commands do not follow such a format; multiple options can be written together, such as-au; there are simplified options and complete options, such as-A and-all

---ls: Querying files in a directory

ls [] [Files and directories]

-A all displays all files, including hidden files

-L Long displays detailed information, also known as long format

-D Direct Directory properties

-H human shows the size that people can read

-I. Innode

[Root@andy ~]# Ls-al
Total Dosage 80
Dr-xr-x---. 2 root root 4096 November 25 05:06.
Dr-xr-xr-x. Root root 4096 November 26 03:41..
-RW-------. 1 root root 1272 November 03:55 anaconda-ks.cfg
-RW-------. 1 root root 183 November 05:06. bash_history
-rw-r--r--. 1 root root 18 May bash_logout
-rw-r--r--. 1 root root 176 May Bash_profile
-rw-r--r--. 1 root root 176 September 2004. BASHRC
-rw-r--r--. 1 root root 100 September 2004. CSHRC
-rw-r--r--. 1 root root 26420 November 03:55 Install.log
-rw-r--r--. 1 root root 7572 November 03:52 install.log.syslog
-rw-r--r--. 1 root root 129 December 4 2004. TCSHRC
-RW-------. 1 root root 768 November 04:20. Viminfo

--ll command, that's ls-l.

--About long format

--first column, permissions

-rw-r--r--refers to permissions; The default is 10 bits.

-Indicates the file type (-file d Directory | Soft link file)--There are 7 kinds, the other uses less, first of all, is the system special files, the general user does not care, want to see the words

[Root@andy ~]# ls-l/dev/

The back 9 bits, each 3 is a group, respectively represents the file's U owner, G belongs to the group, O other people three identities (the file and the three of the Authority provisions)

(A Linux user group is a set of users with the same permissions)

R Read, W write, x execute (Basic permissions on so three)

Like Rw-u has read and write access to it.

--A little "."

Delegate ACL permissions

--Number 1

Reference count

--root Root

Owner and owning group

--Digital

File size, in bytes, with-h option

[Root@andy ~]# LS-LH
Total dosage 44K
-RW-------. 1 root root 1.3K November 03:55 anaconda-ks.cfg
-rw-r--r--. 1 root root 26K November 03:55 Install.log
-rw-r--r--. 1 root root 7.4K November 03:52 install.log.syslog

--Date

Last modification time

-Last,

Filename

File name with "." It starts with a hidden file.

---D

To see the permissions of the directory itself

---I

Show I node, ID number

----File processing commands

Create a directory, create a file.

---directory processing commands & File processing commands

The directory is also a file, first clear down again.

--Build directory: mkdir

Make Directory

mkdir-p [directory Name]

-P recursive creation, meaning that if you want to create a multilevel directory, you want to create it recursively

[Root@andy ~]# mkdir-p Japan/cangls

directory WHERE---switch: CD

CD [catalogue]

Very simple, that can be cut many levels, can also cut a level, do not enter the directory, directly home directory

-Simplified operation

CD or CD ~ Go Home (~ originally represented home directory)

Cd.. Return to the top level directory

CD-Go to last Catalog

Cd. Go to current directory

[Root@andy ~]#
[Root@andy ~]# Cd/etc
[Root@andy etc]# CD Sysconfig
[Root@andy sysconfig]# CD.
-BASH:CD.: Command not Found
[Root@andy sysconfig]# CD.
[Root@andy etc]# CD-
/etc/sysconfig
[Root@andy sysconfig]# CD ~
[Root@andy ~]#

--

Relative path and absolute path

[Root@andy ~]# CD. /usr/local/src
[Root@andy src]# CD. /usr/local/src
-BASH:CD:.. /USR/LOCAL/SRC: No file or directory
[Root@andy src]# CD/USR/LOCAL/SRC
[Root@andy src]# CD/USR/LOCAL/SRC
[Root@andy src]#

Relative path, which is the relative current position to CD

Absolute path, is to start from the root directory, trouble but reliable, suitable for beginners

--About the TAB key

Complete commands and directories, press two times, and judge correctly

--The directory where the query is located: pwd

Directly with

--Delete Empty directory: RmDir

Remove Empty Directory

rmdir [Catalogue]

[Root@andy ~]# rmdir Bols
[Root@andy ~]# rmdir Japan
RmDir: Delete "Japan" failure: Directory not empty

So it's not good.

--Delete files or directories: RM

Remove

[Root@andy ~]# RM Japan
RM: Cannot delete "Japan": is a directory
[Root@andy ~]# rm-r Japan
RM: Do you have access to the catalogue "Japan"? Y
RM: Do you want to delete the directory "Japan/cangls"? Y^hn^h^h^h
RM: Do you want to delete the directory "Japan"? N
[Root@andy ~]# RM-RF Japan
[Root@andy ~]# Ls-l
Total Dosage 44
-RW-------. 1 root root 1272 November 03:55 anaconda-ks.cfg
-rw-r--r--. 1 root root 26420 November 03:55 Install.log
-rw-r--r--. 1 root root 7572 November 03:52 install.log.syslog
[Root@andy ~]#

RM-RF [Catalogue]

If you delete directly with-RF, there is no question, delete it directly, so be careful to use it, or even remove the whole system.

-R Delete Directory

-F Mandatory

--Copy: CP

Copy

-R Copy Directory

-p-d

-A equals-RPD

so with CP, Cp-a, make sure the copy is the same, time ah what

--Cut or rename: MV

Move

Note that clipping does not add an option

--Common directory role

[Root@andy ~]# CD/
[Root@andy/]# ls
Bin boot Cgroup Dev etc home lib Lost+found media misc mnt net opt proc root sbin selinux SRV sys tmp usr var

First switch to root directory/

These are the first-level catalogs.

Bin and Sbin, and the bin and sbin under USR are all saved system commands

/boot directory to save user's startup data

/dev Special files save directory, do not tamper

/etc System of the default configuration file, will be frequently moved in the future

Home directory for normal users,/root home directory for super users

/lib Function Library Warehouse

Misc Media mnt Empty directory, used for mounting, external other devices, self-setting

Proc SYS cannot be manipulated directly, it is a memory letter

/tmp Temp directory

/USR System Resource Directory

/var save system Variable Document directory

In short, the home directory and/tmp under the random put things

---Link command:ln

Link

ln-s [source file] [target file]

-S Soft Soft links

Note: The basic purpose of creating a link is the equivalent of a normal shortcut

--Hard links

Can basically be understood as a different access point/name for the same file (imagine the front and back doors of the same classroom)

Having the same I node and storing block blocks; Delete one, or you can use

The disadvantage is that you cannot cross partitions and cannot target directories

[Root@andy ~]# Ln/root/anaconda-ks.cfg/tmp/ana.hard
[Root@andy ~]# LL
Total Dosage 48
-RW-------. 2 root root 1272 November 03:55 anaconda-ks.cfg
-rw-r--r--. 1 root root 26420 November 03:55 Install.log
-rw-r--r--. 1 root root 7572 November 03:52 install.log.syslog
Drwxr-xr-x. 3 root root 4096 November 04:55 Japan
[Root@andy ~]# Ll/tmp
Total dosage 92
-RW-------. 1 root root 1272 November 04:55 Ana
-RW-------. 2 root root 1272 November 03:55 Ana.hard
Drwxr-xr-x. 3 root root 4096 November 04:56 Japan
-RW-------. 1 root root 81920 November 04:40 whatis.2kxnr9
-RW-------. 1 root root 0 November 03:32 yum.log

is basically not visible, except the reference count + 1; But I can see the I node number

[Root@andy ~]# Ls-li
Total Dosage 48
135177-RW-------. 2 root root 1273 November 05:32 anaconda-ks.cfg
130564-rw-r--r--. 1 root root 26420 November 03:55 Install.log
130565-rw-r--r--. 1 root root 7572 November 03:52 install.log.syslog
135180 Drwxr-xr-x. 3 root root 4096 November 04:55 Japan
[Root@andy ~]# Ls-li/tmp
Total dosage 92
550003-RW-------. 1 root root 1272 November 04:55 Ana
135177-RW-------. 2 root root 1273 November 05:32 Ana.hard
550005 Drwxr-xr-x. 3 root root 4096 November 04:56 Japan
550004-RW-------. 1 root root 81920 November 04:40 whatis.2kxnr9
522243-RW-------. 1 root root 0 November 03:32 yum.log
If you delete a file, the reference count will change back to 1

However, it is not recommended to create a hard link: more restrictive, more covert, only I-node-recommended soft ~

--Soft links

Shortcut equivalent to Windows

Own the I node and block blocks, but the data block only save the source file name and I node number, there is no actual file data (like storage is a treasure map)

Soft-Link permissions are lrwxrwxrwx

Delete the source file, the soft link fails (all said to be a shortcut)

Modify one, and the other will change.

[Root@andy ~]# cp-a Anaconda-ks.cfg/root/japan
[Root@andy ~]# ln-s/root/japan/anaconda-ks.cfg/tmp/an.soft
[Root@andy ~]# LL
Total Dosage 48
-RW-------. 2 root root 1273 November 05:32 anaconda-ks.cfg
-rw-r--r--. 1 root root 26420 November 03:55 Install.log
-rw-r--r--. 1 root root 7572 November 03:52 install.log.syslog
Drwxr-xr-x. 3 root root 4096 November 05:43 Japan
[Root@andy ~]# Ll/tmp
Total dosage 92
-RW-------. 1 root root 1272 November 04:55 Ana
-RW-------. 2 root root 1273 November 05:32 Ana.hard
lrwxrwxrwx. 1 root root 27 November 05:44 An.soft-/root/japan/anaconda-ks.cfg
Drwxr-xr-x. 3 root root 4096 November 04:56 Japan
-RW-------. 1 root root 81920 November 04:40 whatis.2kxnr9
-RW-------. 1 root root 0 November 03:32 yum.log
[Root@andy ~]# ll-i/tmp
Total dosage 92
550003-RW-------. 1 root root 1272 November 04:55 Ana
135177-RW-------. 2 root root 1273 November 05:32 Ana.hard
533111 lrwxrwxrwx. 1 root root 27 November 05:44 An.soft-/root/japan/anaconda-ks.cfg
550005 Drwxr-xr-x. 3 root root 4096 November 04:56 Japan
550004-RW-------. 1 root root 81920 November 04:40 whatis.2kxnr9
522243-RW-------. 1 root root 0 November 03:32 yum.log
[Root@andy ~]# Ll-i
Total Dosage 48
135177-RW-------. 2 root root 1273 November 05:32 anaconda-ks.cfg
130564-rw-r--r--. 1 root root 26420 November 03:55 Install.log
130565-rw-r--r--. 1 root root 7572 November 03:52 install.log.syslog
135180 Drwxr-xr-x. 3 root root 4096 November 05:43 Japan

Note the time, I node, permissions, file name

In addition, the source file must write the absolute path in the soft link, otherwise the error may be

I wrote fewer examples, and we practiced more.

See you tomorrow

http://www.bkjia.com/PHPjc/1074840.html www.bkjia.com true http://www.bkjia.com/PHPjc/1074840.html techarticle buy the wrong movie ticket, with tears also have to see-lamp build Linux Foundation, movie ticket-lamp Hi didn't say, on Friday roommate had a treat, in Longhu eat hey drink cool, go back to the road talk ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.