EC2 安裝 Apache PHP MySQL

使用EC2 像使用任何Linux主機一樣使用虛擬機。安裝軟件,我們用Yum安裝器來安裝Apache服務器,輸入下面的命令來安裝Apache:

sudo yum install httpd

下一步,用以下命令安裝PHP:

sudo yum install php

通過下面的命令安裝php-mysql擴展:

sudo yum install php-mysql
sudo yum install mysql-server

好了,安裝完成開始準備測試Apache。用下面的命令啟動Apache(你可以用「stop」或「restart」來停止或重啟Apache):

sudo /etc/init.d/httpd start

http://www.hkitmag.com/amazon-elastic-cloud-wordpress

=====================================================================================
Programs can be easily installed with the yum command. So lets start by installing Apache with the command line:

yum install httpd

And then start apache with command:

service httpd start

Now we’ll install PHP and some needed libraries:

yum install php libmcrypt libmcrypt-devel php-mcrypt php-mbstring

yum install php-mcrypt
yum install php-mbstring

After which we’ll want to restart Apache:

service httpd restart

Install MySQL

yum install mysql
yum install –y mysql-server

Start MySQL Server

service mysqld start
/etc/init.d/mysqld start

Now we can assign a MySQL Server password

/usr/bin/mysqladmin -u root password ‘[PASSWORD]‘

你可能感兴趣的:(EC2 安裝 Apache PHP MySQL)