自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

CentOS LAMP配置手冊

系統(tǒng) Linux
用過LAMP的人們都知道,LAMP是由 Linux+Apache+Mysql+Perl/PHP/Python 一起組成的,如何在CentOS 下配置LAMP是初學者應該學習的,本文講下具體的實現(xiàn)過程!

 

LAMP 

圖-LAMP

  今天用yum方法搭建起了個CentOS LAMP環(huán)境,中間遇到了很多問題,經(jīng)過google和各位前輩的幫助,終于將環(huán)境搭建起來,現(xiàn)在把完整的步驟記錄下來:

  一、換源,sohu的相當好用。

  備份CentOS-Base.repo

  view sourceprint?cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

  替換源

  用vi打開CentOS-Base.repo,并將內(nèi)容清空,然后將下面的內(nèi)容復制進去,并保存。

  view sourceprint?# CentOS-Base.repo

  #

  # This file uses a new mirrorlist system developed by Lance Davis for CentOS.

  # The mirror system uses the connecting IP address of the client and the

  # update status of each mirror to pick mirrors that are updated to and

  # geographically close to the client. You should use this for CentOS updates

  # unless you are manually picking other mirrors.

  [base]

  name=CentOS-$releasever - Base

  baseurl=http://mirrors.sohu.com/centos/$releasever/os/$basearch/

  gpgcheck=1

  gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5

  #released updates

  [updates]

  name=CentOS-$releasever - Updates

  baseurl=http://mirrors.sohu.com/centos/$releasever/updates/$basearch/

  gpgcheck=1

  gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5

  #packages used/produced in the build but not released

  [addons]

  name=CentOS-$releasever - Addons

  baseurl=http://mirrors.sohu.com/centos/$releasever/addons/$basearch/

  gpgcheck=1

  gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5

  #additional packages that may be useful

  [extras]

  name=CentOS-$releasever - Extras

  baseurl=http://mirrors.sohu.com/centos/$releasever/extras/$basearch/

  gpgcheck=1

  gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5

  #additional packages that extend functionality of existing packages

  [centosplus]

  name=CentOS-$releasever - Plus

  baseurl=http://mirrors.sohu.com/centos/$releasever/centosplus/$basearch/

  gpgcheck=1

  enabled=0

  gpgkey=http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5

#p#

 

  二、更新一下系統(tǒng)

  view sourceprint?#yum -y update

  三、安裝Apache

  view sourceprint?#yum install httpd

  安裝完成后,用

  view sourceprint?/etc/init.d/httpd start

  啟動apache

  設為開機啟動

  view sourceprint?#chkconfig httpd on

  四、安裝MYSQL

  view sourceprint?#yum install mysql mysql-server

  同樣,完成后,用

  view sourceprint?/etc/init.d/mysqld start

  啟動mysql

  設置MYSQL密碼

  view sourceprint?#/usr/bin/mysqladmin -u root -h localhost password '新密碼'

  #mysql -u root –p #進入MYSQL,

  #Enter Password: # [輸入密碼即可]

  更新MYSQL密碼

  view sourceprint?mysql> USE mysql;

  mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';

  mysql> FLUSH PRIVILEGES;

  允許遠程登錄

  view sourceprint?mysql>GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

  完成后就能用mysql-front遠程管理mysql了。

  讓MYSQL數(shù)據(jù)庫更安全

  view sourceprint?mysql -u root -p [此時會要求你輸入剛剛設置的密碼,輸入后回車即可

  mysql> DROP DATABASE test;     [刪除test數(shù)據(jù)庫]

  mysql> DELETE FROM mysql.user WHERE user =’’;       [刪除匿名帳戶]

  mysql> FLUSH PRIVILEGES;     [重載權限]

  mysql> exit;                            [退出MYSQL]

  設為開機啟動

  view sourceprint?#chkconfig mysqld on

#p#

  五、安裝PHP

  view sourceprint?#yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml libmcrypt

  view sourceprint?#/etc/init.d/httpd start [運行HTTPD]

  六、測試一下

  在/var/www/html/新建個test.php文件,將以下內(nèi)容寫入,然后保存。

  view sourceprint?

  phpinfo();

  ?>

  然后在客戶端瀏覽器里打開http://IP/test.php,若能成功顯示,則表示安裝成功。

  至此,安裝完畢。感慨,YUM真是太好用了。

通過文章的介紹,我們應該都能掌握CentOS LAMP配置技巧,在以后的構建過程中就簡單多了!

【編輯推薦】

  1. 簡單的在 ubuntu 下安裝lamp
  2. 搭建LAMP測試平臺
  3. LAMP架構——我的工作心得
  4. LAMP攻略之MySQL常用語法語句
  5. LAMP攻略之PHP執(zhí)行sql語句的寫法
  6. LAMP攻略之MySQL數(shù)據(jù)庫結構和數(shù)據(jù)導出及導入
  7. LAMP攻略之MySQL索引

 

 

 

責任編輯:趙鵬 來源: 網(wǎng)絡轉載
相關推薦

2011-03-08 11:22:32

LAMP安裝

2011-03-11 10:39:09

CentOS 5.5安裝LAMP

2011-09-09 17:23:53

CentOSLAMPmysql

2011-03-11 12:57:30

CentosLAMP

2011-03-22 10:17:22

LAMP

2011-03-09 13:03:15

Centos搭建LAMP

2011-03-11 17:14:27

2011-03-14 13:51:14

LAMP配置

2011-03-10 15:44:18

CentOSLAMP安裝

2011-03-09 16:16:54

CentOSLAMP

2011-03-10 15:44:18

CentOSLAMP安裝

2011-03-23 15:55:41

LAMP

2011-01-18 18:28:49

Thunderbird配置

2011-03-11 09:54:48

CentOSLAMP安裝

2011-03-09 10:52:36

CentOS安裝LAMP

2010-05-21 15:12:58

Centos下SVN的

2011-03-23 11:14:47

LAMP配置

2011-03-11 16:42:38

Ubuntu安裝LAMP

2011-03-21 10:15:07

LAMPLAMP安裝LAMP配置

2011-03-22 13:06:18

LAMPMysql
點贊
收藏

51CTO技術棧公眾號