CentOS 6.6 yum 搭建LAMP環境

來源:互聯網
上載者:User

標籤:

CentOS 查看作業系統版本

[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)

 參考linux centos yum安裝LAMP環境

Yum(全稱為 Yellow dog Updater, Modified)是一個在Fedora和RedHat以及CentOS中的Shell前端軟體包管理器。

基於RPM包管理,能夠從指定的伺服器自動下載RPM包並且安裝,可以自動處理依賴性關係,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。

 

1、更新一下yum 

[[email protected] ~]# yum -y update

2、用yum安裝Apache,Mysql,PHP

安裝Apache:

[[email protected] ~]# yum install httpd httpd-devel

安裝完成後, 啟動apache 

[[email protected] ~]# /etc/init.d/httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for oa.aioute.com
httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

設為開機啟動

[[email protected] ~]# chkconfig httpd on

 

安裝mysql:

[[email protected] ~]# yum install mysql mysql-server mysql-devel

啟動mysql

[[email protected] ~]# /etc/init.d/mysqld start

參考:[CentOS 0010] CentOS 配置mysql允許遠程登入

CentOS下開啟mysql遠端連線,遠端管理資料庫

設定mysql密碼,並開啟遠程許可權:

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘yourpassword‘ WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> EXIT

 

允許3306連接埠:

[[email protected] ~]# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
[[email protected] ~]# iptables -L -n

 

安裝php:

yum install php php-devel

重啟apache使php生效:

/etc/init.d/httpd restart

[[email protected] ~]# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

重新啟動php:

[[email protected] ~]# /etc/init.d/httpd restart
Starting httpd:

3、允許連接埠訪問

[[email protected] ~]# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
[[email protected] ~]# iptables -L -n

 參考 centos下vi的用法大全

參考 CentOS配置VSFTP伺服器

 

CentOS 6.6 yum 搭建LAMP環境

相關文章

聯繫我們

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