欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

CentOS 5.5使用yum來安裝LAMP(php運(yùn)行環(huán)境)

 更新時間:2010年09月10日 21:05:37   作者:  
今天用yum方法搭建起了個LAMP環(huán)境,中間遇到了很多問題,經(jīng)過google和各位前輩的幫助,終于將環(huán)境搭建起來,現(xiàn)在把完整的步驟記錄下來,
1. 換源,sohu的相當(dāng)好用。
1.1備份CentOS-Base.repo
cd /etc/yum.repos.d/
cp CentOS-Base.repo CentOS-Base.repo.bak
1.2替換源
用vi打開CentOS-Base.repo,并將內(nèi)容清空,然后將下面的內(nèi)容復(fù)制進(jìn)去,并保存。
# 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.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[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
1.3更新一下。
yum -y update
2. 用yum安裝Apache,Mysql,PHP.
2.1安裝Apache
yum install httpd httpd-devel
安裝完成后,用/etc/init.d/httpd start 啟動apache
設(shè)為開機(jī)啟動:chkconfig httpd on
2.2 安裝mysql
2.2.1 yum install mysql mysql-server mysql-devel
同樣,完成后,用/etc/init.d/mysqld start 啟動mysql
2.2.2 設(shè)置mysql密碼
mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>; FLUSH PRIVILEGES;
2.2.3 允許遠(yuǎn)程登錄
mysql -u root -p
Enter Password: <your new password>
mysql&gt;GRANT ALL PRIVILEGES ON *.* TO '用戶名'@'%' IDENTIFIED BY '密碼' WITH GRANT OPTION;
完成后就能用mysql-front遠(yuǎn)程管理mysql了。
2.2.4 設(shè)為開機(jī)啟動
chkconfig mysqld on
3. 安裝php
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d/httpd start
4. 測試一下
4.1在/var/www/html/新建個test.php文件,將以下內(nèi)容寫入,然后保存。
<?
phpinfo();
?>
4.2 防火墻配置
a.添加.允許訪問端口{21: ftp, 80: http}.
iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
iptables -I RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
b.關(guān)閉防火墻{不推薦}.
service iptables stop
c.重置加載防火墻
service iptables restart
4.3然后在客戶端瀏覽器里打開http://serverip/test.php,若能成功顯示,則表示安裝成功。
至此,安裝完畢。感慨,yum真是太好用了。

相關(guān)文章

  • CentOS 7忘記密碼解決方案過程圖解

    CentOS 7忘記密碼解決方案過程圖解

    這篇文章主要介紹了CentOS 7忘記密碼解決方案過程圖解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-08-08
  • apache  urlrewrite防盜鏈功能配置

    apache urlrewrite防盜鏈功能配置

    配置虛擬主機(jī)時,在配置文件中加入如下內(nèi)容
    2009-06-06
  • linux Dig命令使用大全

    linux Dig命令使用大全

    這篇文章主要介紹了linux Dig命令使用大全,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-01-01
  • Centos8最小化部署安裝OpenStack Ussuri的詳細(xì)教程

    Centos8最小化部署安裝OpenStack Ussuri的詳細(xì)教程

    這篇文章主要介紹了Centos8最小化部署安裝OpenStack Ussuri的詳細(xì)教程,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-08-08
  • 清除CentOS 6或CentOS 7上的磁盤空間的方法

    清除CentOS 6或CentOS 7上的磁盤空間的方法

    這篇文章主要介紹了清除CentOS 6或CentOS 7上的磁盤空間的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • ssh連接超時解決方法

    ssh連接超時解決方法

    本文為大家介紹了ssh連接超時的解決方法, 另外提供一種不修改配置文件就可以解決連接超時的方法,大家參考使用吧
    2014-01-01
  • apache啟動報(bào)錯:the requested operation has failed解決辦法

    apache啟動報(bào)錯:the requested operation has failed解決辦法

    apache啟動報(bào)錯:the requested operation has failed解決辦法
    2009-11-11
  • Linux命令之關(guān)于用戶組操作

    Linux命令之關(guān)于用戶組操作

    這篇文章主要介紹了Linux命令之關(guān)于用戶組操作,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-07-07
  • Linux進(jìn)程基礎(chǔ)教程詳解

    Linux進(jìn)程基礎(chǔ)教程詳解

    這篇文章主要為大家詳細(xì)介紹了Linux進(jìn)程基礎(chǔ)教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-04-04
  • Ubuntu下開啟Apache對.htaccess 的支持

    Ubuntu下開啟Apache對.htaccess 的支持

    這篇文章主要介紹了Ubuntu下開啟Apache對.htaccess 的支持的方法,已經(jīng)在xampp開啟ModRewrite的方法,非常的實(shí)用,推薦給大家,希望大家能夠喜歡。
    2015-03-03

最新評論