阿里雲主機搭建lamp環境(linux+apache+mysql+php)

來源:互聯網
上載者:User

1.購買阿里雲主機……(哈哈!)
2.更新yum源。
阿里雲的yum源需要更新後才能正常使用。具體方法:http://help.aliyun.com/view/13438670.html
3.安裝Apahce, PHP, MySQL以及php串連mysql庫組件。
#yum -y install httpd php53 mysql mysql-server php53-mysql
4.安裝apache擴充:
#yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
5.安裝php擴充:
yum install php53-cli php53-common php53-devel php53-gd php53-mbstring php53-soap php53-xml php53-xmlrpc php53-bcmath php53-snmp
6.安裝mysql擴充:
#yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
7.配置開機啟動服務
#chkconfig httpd on [設定apache服務開機啟動]
#chkconfig mysqld on [設定mysql服務開機啟動]
#service httpd restart [啟動httpd服務]
#service mysqld restart [啟動mysqld服務]
8.安裝zipunzip命令。
為了上傳源碼的方便和快速,一般會上傳壓縮包,所以安裝zipunzip之後可以線上解壓;
yum install zip unzip
9.修改資料庫密碼:www.111cn.net
初始密碼為空白時:mysqladmin -uroot password 新密碼
初始密碼不為空白:mysqladmin -uroot -p舊密碼 password 新密碼
10.設定了允許root使用者在任何地方進行遠程登入,並具有所有庫任何操作許可權。
預設root醫護是只能在本地訪問資料庫的,為了管理資料庫的方便我做此設定。
具體操作如下:
在本機先使用root使用者登入mysql:
mysql -u root -p”youpassword”
進行授權操作:
mysql>GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED BY ‘youpassword’ WITH GRANT OPTION;
重載授權表:
FLUSH PRIVILEGES;
退出mysql資料庫:
exit

聯繫我們

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