日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

CentOS中安裝LAMP完整流程

 corefashion 2014-08-24

 安裝Cent OS


 從http://www./modules/tinycontent/index.php?id=15下載最新版本的CentOS


更新成163源


打開(kāi)Terminate

輸入sudo root并輸入密碼

輸入su讓當(dāng)前用戶以root權(quán)限進(jìn)入

輸入cd /etc/yum.repos.d

輸入mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

來(lái)備份/etc/yum.repos.d/CentOS-Base.repo

輸入wget http://mirrors.163.com/.help/CentOS6-Base-163.repo下載163源

輸入mv /etc/yum.repos.d/CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo

輸入yum makecache完成更新



  安裝并配置MySQL

1.1 執(zhí)行yum命令安裝MySQL

yum -y install mysql mysql-server

1.2 把添加MySQL進(jìn)開(kāi)機(jī)啟動(dòng)項(xiàng),并立即啟動(dòng)MySQL

chkconfig --levels 235 mysqld on/etc/init.d/mysqld start

1.3 設(shè)置MySQL root賬號(hào)密碼

mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQLSERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current

password for the root user.  If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none): <-- 輸入系統(tǒng)root密碼

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

Set root password? [Y/n] <-- ENTER

New password: <-- 你的MySQL root密碼

Re-enter new password: <-- 你的MySQL root密碼

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

  1. This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] <-- ENTER

... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <-- ENTER

... Success!

By default, MySQL comes with a database named 'test' that anyone can

  1. This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] <-- ENTER

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] <-- ENTER

... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL

installation should now be secure.

Thanks for using MySQL!

二、      安裝Apache

2.1 使用yum命令安裝Apache

yum –y install httpd

2.2 設(shè)置開(kāi)機(jī)啟動(dòng)Apache

chkconfig --levels 235 httpd on

2.3 啟動(dòng)Apache

/etc/init.d/httpd start

2.4 現(xiàn)在直接在瀏覽器鍵入http://localhost或http://本機(jī)IP,應(yīng)該會(huì)看到Apache的測(cè)試頁(yè)面


安裝配置PHP

3.1 使用yum命令安裝PHP

yum –y install php

3.2 重啟Apache服務(wù)器

/etc/init.d/httpd restart

3.3 安裝相關(guān)模塊使用PHP支持MySQL:為了讓PHP支持MySQL,我們可以安裝php-mysql軟件包;也可使用以下命令搜索可用的php模塊

yum search php

選擇需要的模塊進(jìn)行安裝

yum –y install php-mysql php-common php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

3.4 重啟Apache服務(wù)器

/etc/init.d/httpd restart


安裝配置phpMyAdmin

Using YUM :

Step 1 ? Install/enable EPEL repository . You can find latest repository here ( http://download./pub/epel/6/i386/repoview/epel-release.html )

[root@localhost ~]# rpm -ivh http://ftp./pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm

Step 2 ? Now update repositories

[root@localhost ~]# yum update

Step 3 ? After updating yum repositories , now you can install phpmyadmin package

[root@localhost ~]# yum install phpMyAdmin

This command will install phpmyadmin package along with dependencies . please type the package name exactly as phpMyAdmin ( ” M” and “A” –> Uppercase )

Step 4 ? Now restart httpd service

[root@localhost ~]# service httpd restart

Now open the path in your browser ( Eg->  http://192.168.1.1/phpMyAdmin ) . You can see the below screen after entering Mysql root username and password .

install Phpmyadmin centos


4.9 至此,打開(kāi)頁(yè)面http://localhost/phpmyadmin即可輕松管理你的mySQL數(shù)據(jù)庫(kù)

 

打開(kāi)CentOS網(wǎng)絡(luò)端口保證其它機(jī)器可以訪問(wèn)


#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT
#/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
然后保存:
#/etc/rc.d/init.d/iptables save

 

查看打開(kāi)的端口:


# /etc/init.d/iptables status






    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多