真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

CentOSLAMP配置是怎樣的

今天就跟大家聊聊有關(guān)CentOS LAMP配置是怎樣的,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

成都創(chuàng)新互聯(lián)公司主營海州網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,重慶APP軟件開發(fā),海州h5小程序開發(fā)搭建,海州網(wǎng)站營銷推廣歡迎海州等地區(qū)企業(yè)咨詢

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

一、換源,sohu的相當(dāng)好用。

備份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)容復(fù)制進(jìn)去,并保存。

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

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

view sourceprint?#yum -y update

三、安裝Apache

view sourceprint?#yum install httpd

安裝完成后,用

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

啟動(dòng)apache

設(shè)為開機(jī)啟動(dòng)

view sourceprint?#chkconfig httpd on

四、安裝MySQL

view sourceprint?#yum install mysql mysql-server

同樣,完成后,用

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

啟動(dòng)mysql

設(shè)置MYSQL密碼

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

#mysql -u root –p #進(jìn)入MYSQL,

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

更新MYSQL密碼

view sourceprint?mysql> USE mysql;

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

mysql> FLUSH PRIVILEGES;

允許遠(yuǎn)程登錄

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

完成后就能用mysql-front遠(yuǎn)程管理mysql了。

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

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

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

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

mysql> FLUSH PRIVILEGES; [重載權(quán)限]

mysql> exit;  [退出MYSQL]

設(shè)為開機(jī)啟動(dòng)

view sourceprint?#chkconfig mysqld on

五、安裝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 [運(yùn)行HTTPD]

六、測試一下

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

view sourceprint?

phpinfo();

?>

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

至此,安裝完畢。

看完上述內(nèi)容,你們對(duì)CentOS LAMP配置是怎樣的有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。


標(biāo)題名稱:CentOSLAMP配置是怎樣的
文章URL:http://weahome.cn/article/gspipo.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部