EC2 安裝 Apache PHP MySQL

强颜欢笑 提交于 2019-12-04 02:00:26

使用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]‘

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!