{"id":103,"title":"linux\u542f\u52a8\u8fc7\u7a0b","good":0,"bad":0,"hit":2412,"created_at":"2014-10-26 22:39:47","content":"

linux\u7684\u542f\u52a8\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>

\u7b2c\u4e00\u6b65\u68c0\u67e5\u786c\u4ef6\u662f\u5426\u6b63\u786e\uff0c\u7b2c\u4e8c\u6b65\u8bfb\u53d6\u786c\u76d8\u5f15\u5bfc\u533a\uff0c\u7b2c\u4e09\u6b65\u8f7d\u5165\u5185\u6838\uff0c\u7b2c\u56db\u6b65\u542f\u52a8init\u6587\u4ef6\u4e2d\u7684\u76f8\u5173\u8fdb\u7a0b\uff0c\u7b2c\u4e94\u6b65\u8bfb\u53d6\u7cfb\u7edf\u914d\u7f6e<\/p>

<\/p>

\u8fd9\u4e2a\u8fc7\u7a0b\u53ef\u80fd\u6bd4\u8f83\u62bd\u8c61\uff0c\u6211\u4eec\u53ef\u4ee5\u6253\u4e2a\u6bd4\u65b9\u6765\u7406\u89e3\uff0c\u4ee5\u57fa\u4e8emvc\u7684thinkphp\u6846\u67b6\u4e3a\u4f8b\uff0c\u4e0a\u9762<\/p>

\u7b2c\u4e00\u6b65\u76f8\u5f53\u4e8e\uff1a\u68c0\u67e5\u7cfb\u7edf\u786c\u4ef6\u662f\u5426\u6b63\u786e<\/p>

\u7b2c\u4e8c\u6b65\u76f8\u5f53\u4e8e\uff1a\u542f\u52a8webserver\u670d\u52a1\u5668\uff0c\u5e76\u81ea\u52a8\u627e\u5230\u9996\u9875(index.php\u6216\u5176\u5b83)<\/p>

\u7b2c\u4e09\u6b65\u76f8\u5f53\u4e8e\uff1a\u8f7d\u5165thinkphp\u6846\u67b6\u7c7b\u6587\u4ef6<\/p>

\u7b2c\u56db\u6b65\u76f8\u5f53\u4e8e\uff1a\u8fd0\u884cthinkphp\u6846\u67b6\u5e76new()\u4e00\u4e2athinkphp\u7c7b<\/p>

\u7b2c\u4e94\u6b65\u76f8\u5f53\u4e8e\uff1a\u8bfb\u53d6config.php\u914d\u7f6e\uff0c\u5e76\u6700\u7ec8display()\uff0c\u663e\u793a\u9875\u9762\u6548\u679c\uff1b<\/p>

\u8fd9\u4e2a\u6bd4\u5982\u53ef\u80fd\u4e0d\u592a\u6070\u5f53\uff0c\u4f46\u662f\u53ef\u4ee5\u65b9\u4fbf\u7406\u89e3<\/p>

\u4e0b\u9762\u8fd9\u56fe\u8fc7\u7a0b\u66f4\u8be6\u7ec6\u4e00\u4e9b\uff1a<\/p>

<\/p>

\/etc\/profile \u91cc\u9762\u662f\u5168\u5c40\u73af\u5883\u914d\u7f6e<\/p>

\/home\/\u7528\u6237\u540d\/.bashe_profice\u662f\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u73af\u5883\u914d\u7f6e<\/p>

[root@localhost hurong]# ls -altotal 18080drwx------. 29 hurong hurong     4096 Feb 27 03:49 .drwxr-xr-x.  3 root   root       4096 Feb 25 13:02 ..-rw-------.  1 hurong hurong      593 Feb 27 05:22 .bash_history-rw-r--r--.  1 hurong hurong       18 Feb 21  2013 .bash_logout-rw-r--r--.  1 hurong hurong      176 Feb 21  2013 .bash_profile<\/span><\/p>

<\/p>

\u6709\u5174\u8da3\u7684\u53ef\u4ee5\u6253\u5f00\u8fd9\u4e9b\u914d\u7f6e\u6587\u4ef6\u770b\u770b\uff0c\u91cc\u9762\u90fd\u662f\u7528shell\u7f16\u5199\u7684\u7a0b\u5e8f\uff0c\u5728\u4e0d\u4e86\u89e3\u7684\u60c5\u51b5\u4e0b\u4e0d\u8981\u8f7b\u6613\u4fee\u6539\uff0c\u5426\u5219\u53ef\u80fd\u51fa\u5927\u95ee\u9898\uff1b<\/p>

\u6253\u5f00.bash_profile\u770b\u770b\uff1a<\/p>

[root@localhost hurong]# cat \/home\/hurong\/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~\/.bashrc ]; then        . ~\/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME\/binexport PATH[root@localhost hurong]# <\/p>

<\/p>

<\/p>

\u7b2c\u4e8c\u6b65grub\u7684\u914d\u7f6e\u53ef\u4ee5\u7528 vi \/etc\/grub.conf\u67e5\u770b\uff1a<\/p>

# grub.conf generated by anaconda## Note that you do not have to rerun grub after making changes to this file# NOTICE:  You have a \/boot partition.  This means that#          all kernel and initrd paths are relative to \/boot\/, eg.#          root (hd0,0)#          kernel \/vmlinuz-version ro root=\/dev\/sda2#          initrd \/initrd-[generic-]version.img#boot=\/dev\/sdadefault=0timeout=5splashimage=(hd0,0)\/grub\/splash.xpm.gzhiddenmenutitle centos (2.6.32-71.el6.i686)        root (hd0,0)        kernel \/vmlinuz-2.6.32-71.el6.i686<\/span> ro root=UUID=c5cb6d94-66c6-47d6-8670-ec529df6a14a rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet        initrd \/initramfs-2.6.32-71.el6.i686.img<\/p>

<\/p>

\u5176\u4e2d\u7ea2\u8272\u90e8\u5206\u4e3a\u5185\u6838\u7684\u7248\u672c\u53f7,linuz\u6700\u540e\u4e00\u4e2az\u8868\u793a\u538b\u7f29\u5305\u7684\u610f\u601d\uff0c2.6.32\u8868\u793a\u7248\u672c\u53f7\uff0c2\u8868\u793a\u4e3b\u7248\u672c\u53f7\uff0c6\u8868\u793a\u6b21\u7248\u672c\u53f7\uff0c32\u8868\u793a\u672b\u7248\u672c\u53f7\uff1b\u5176\u4e2d\u6b21\u7248\u672c\u53f7\u4e3a\u5076\u6570\u8868\u793a\u6b63\u5f0f\u7248\uff0c\u4e3a\u5947\u6570\u8868\u793a\u6d4b\u8bd5\u7248\uff0c\u5982\u679c\u8981\u66f4\u6362\u5185\u6838\u7684\u8bdd\uff0c\u4e0b\u8f7d\u7684\u65f6\u5019\u8981\u6ce8\u610f\u3002<\/p>

<\/p>

\u7b2c\u4e09\u6b65\uff1a\u542f\u52a8init\u8fdb\u7a0b<\/p>

<\/p>

<\/p>

\u7b2c4\u6b65\uff0c\u53ef\u4ee5\u7528vi \/etc\/inittab\u67e5\u770binit\u914d\u7f6e\uff0c\u4e3b\u7ecf\u7528\u6765\u6307\u5b9a\u8fd0\u884c\u7ea7\u522b\uff1b\u76f8\u5f53\u4e8ewindows\u4e2d\u6309\u542f\u52a8\u540e\u6309f8\u9009\u542f\u52a8\u6a21\u5f0f\uff1b<\/p>

# inittab is only used by upstart for the default runlevel.## ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.## System initialization is started by \/etc\/init\/rcS.conf## Individual runlevels are started by \/etc\/init\/rc.conf## Ctrl-Alt-Delete is handled by \/etc\/init\/control-alt-delete.conf## Terminal gettys are handled by \/etc\/init\/tty.conf and \/etc\/init\/serial.conf,# with configuration in \/etc\/sysconfig\/init.## For information on how to write upstart event handlers, or how# upstart works, see init(5), init(8), and initctl(8).## Default runlevel. The runlevels used are:#   0 - halt (Do NOT set initdefault to this)#   1 - Single user mode#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)#   3 - Full multiuser mode#   4 - unused#   5 - X11#   6 - reboot (Do NOT set initdefault to this)#id:5:initdefault:0\u8868\u793a\u5173\u673a\uff0c\u8bbe\u7f6e\u62100\u8868\u793a\u542f\u52a8\u5b8c\u540e\u5c31\u5173\u673a\u4e86<\/span><\/p>

1\u5355\u7528\u6237\u6a21\u5f0f\uff0c\u7c7b\u4f3c\u4e8ewindows\u7684\u5b89\u5168\u6a21\u5f0f\uff0c\u53ea\u6709root\u53ef\u4ee5\u767b\u5f55\uff0c\u65e0\u56fe\u5f62\u754c\u9762\uff0c\u53ea\u6709\u6700\u5c0f\u5316\u529f\u80fd<\/span><\/p>

2\u591a\u7528\u6237\u6a21\u5f0f\uff0c\u65e0nfs\uff08\u7528\u4e8elinux\u4e0eunix\u4e4b\u95f4\u7684\u6587\u4ef6\u5171\u4eab\uff0c\u5f88\u5c11\u7528,\u5b89\u5168\u6027\u5dee\uff09\uff0c\u65e0\u56fe\u5f62\u754c\u9762<\/span><\/p>

3\u591a\u7528\u6237\u6a21\u5f0f\uff0c\u65e0\u56fe\u5f62\u754c\u9762<\/span><\/p>

4\u6ca1\u7528\u4e86\uff0c\u53ef\u4ee5\u7531\u7528\u6237\u81ea\u5b9a\u4e49<\/span><\/p>

5\u7cfb\u7edf\u9ed8\u8ba4\u7ea7\u522b\uff0c\u56fe\u5f62\u5316\u7684\u591a\u7528\u6237\u6a21\u5f0f<\/span><\/p>

6\u91cd\u542f\uff0c\u8bbe\u7f6e\u6210\u6b64\u9879\u5c06\u8fdb\u5165\u65e0\u9650\u91cd\u542f\u72b6\u6001\u3002<\/span><\/p>

<\/p>

\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u6a21\u5f0f\uff1arunlevel<\/p>

[root@localhost hurong]# runlevelN 5[root@localhost hurong]# \u4fee\u6539\u8fd0\u884c\u7ea7\u522b\uff1ainit \u4e0a\u9762\u67d0\u6570\u5b57<\/p>

<\/p>"}