yum 安裝apache php mysql

來源:互聯網
上載者:User

標籤:apache php mysql

安裝:

yum install -y httpd php


查看版本:、

rpm -qa httpd php

 httpd-2.2.15-54.el6.centos.x86_64

 php-5.3.3-48.el6_8.x86_64


修改apache設定檔:

vim /etc/httpd/conf/httpd.conf

在#ServerName www.example.com:80行下添加一行

ServerName localhost:80

將裡面的 Listen 80  改為  Listen “你的IP”:80

可以用 /80  快速定位。


測試apache:


service httpd restart


curl -i 192.168.240.129  


沒有出錯資訊並提示一大堆的代碼說明apache安裝成功。

650) this.width=650;" src="http://s1.51cto.com/wyfs02/M00/86/B9/wKiom1fIVDvQpuW0AACFkoLn2UE889.png-wh_500x0-wm_3-wmp_4-s_633067833.png" title="1.png" width="200" height="80" border="0" hspace="0" vspace="0" style="width:200px;height:80px;" alt="wKiom1fIVDvQpuW0AACFkoLn2UE889.png-wh_50" />



測試PHP:

service httpd restart


cd /var/www/html

vim index.php 將以下代碼輸入儲存:

<?

phpinfo();

?>


curl -i 192.168.240.129/index.php

沒有出錯資訊並提示一大堆的代碼說明php安裝成功:

650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/86/B8/wKioL1fIVrDB-uX8AADdzwZmoG0566.png-wh_500x0-wm_3-wmp_4-s_518551626.png" title="3.png" width="200" height="80" border="0" hspace="0" vspace="0" style="width:200px;height:80px;" alt="wKioL1fIVrDB-uX8AADdzwZmoG0566.png-wh_50" />


mysql 待測



經過測試發現,yum安裝完後apache和PHP是自動完成配置的,很不錯,比代碼編譯要舒心,呵呵。

yum 安裝apache php mysql

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.