Lane-CentOS7-安裝LAMP作為Web服務

來源:互聯網
上載者:User

標籤:blog   http   io   ar   os   sp   檔案   on   2014   

1.

# yum  install  php

(依賴包順便把httpd也下了)


# systemctl  start  httpd.service

# firewall-cmd  --add-service=http

(防火牆對http服務解除封鎖)

# firewall-cmd  --permanent  --add-service=http

(防火牆對http服務解除封鎖寫入設定檔)

(可查看/etc/firewalld/zones/public.xml和/usr/lib/firewalld/services/http.xml)

(此時php和httpd已經安裝完成)

2.

# yum  list  mysql

(沒有包...尷尬)

(去http://dev.mysql.com/downloads/repo/yum/找找)

# yum  install  wget

# wget  http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

# rpm  -ivh  mysql-community-release-el7-5.noarch.rpm

# yum  install  mysql  mysql-server

# systemctl  start  mysqld.service

# mysql_secure_installation

(根據提示設定密碼,其餘選項都輸y即可,特殊情況自行判斷)

# mysql  -u  root  -p

(密碼測試成功)

mysql> grant  all  privileges  on  *.*  to  ‘lane‘@‘%‘  identified  by  ‘123456‘  with  grant  option;

(使用者名稱lane密碼123456允許所有ip登入給予了*.*即所有的許可權,這樣是很危險的,我這裡是虛擬機器做測試無所謂,實際生產環境,別執行這樣的命令)

mysql> flush  privileges;

mysql> quit;

# firewall-cmd  --add-service=mysql

# firewall-cmd  --permanent  --add-service=mysql

# yum  install  php-mysql

(安裝完成)

# systemctl  restart  httpd.service

# systemctl  restart  mysqld.service

Lane-CentOS7-安裝LAMP作為Web服務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.