简体   繁体   English

Ubuntu Amazon Web Service LAMP堆栈设置

[英]Ubuntu Amazon Web Service LAMP stack setup

I am trying to set up a LAMP stack on my Amazon Web Service AMI, which is an Ubuntu System. 我试图在我的Amazon Web Service AMI(这是Ubuntu系统)上设置LAMP堆栈。

I went through this tutorial: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html 我完成了本教程: https : //docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

The only difference which I made is installing php 7. 我所做的唯一区别是安装了php 7。

I stuck at this Point: Start the MySQL server. 我停留在这一点上:启动MySQL服务器。

[ec2-user ~]$ sudo service mysqld start

Currently it Returns this error: 当前它返回此错误:

mysqld: unrecognized Service mysqld:无法识别的服务

Same for These commands: 这些命令相同:

[ec2-user ~]$ sudo service mysql start
[ec2-user ~]$ sudo service mysqlnd start

If I run php -i | grep mysqlnd 如果我运行php -i | grep mysqlnd php -i | grep mysqlnd I get following Output: php -i | grep mysqlnd我得到以下输出:

/etc/php-7.0.d/20-mysqlnd.ini, Client API library version => mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ mysqlnd mysqlnd => enabled Version => mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password mysqlnd statistics => Client API version => mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $ /etc/php-7.0.d/20-mysqlnd.ini,客户端API库版本=> mysqlnd 5.0.12-dev-20150407-$ Id:b5c5906d452ec590732a93b051f3827e02749b83 $ mysqlnd mysqlnd =>已启用版本=> mysqlnd 5.0.12-dev- 20150407 - $编号:b5c5906d452ec590732a93b051f3827e02749b83 $加载的插件=> mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password mysqlnd统计=>客户端API版本=> mysqlnd 5.0.12-dev的 - 20150407 - $编号:b5c5906d452ec590732a93b051f3827e02749b83 $

On Ubuntu 16.04, the command would be: 在Ubuntu 16.04上,命令为:

sudo service mysql start

It looks like the MySQL server might not be installed. 看来可能未安装MySQL服务器。 You can install the MySQL server and client tools with: 您可以使用以下方法安装MySQL服务器和客户端工具:

sudo apt-get install mysql-server

You will be asked to create a password for the MySQL root user during installation. 在安装过程中,系统将要求您为MySQL根用户创建密码。

The tutorial you link to is for Amazon Linux, which (amongst other differences) uses a different package manager than Ubuntu to install and manage software. 您链接到的教程是针对Amazon Linux的(除其他差异外)使用与Ubuntu不同的软件包管理器来安装和管理软件。 In the tutorial, the line sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd would have installed the mysql56-server package alongside apache and php. 在本教程中, sudo yum install -y httpd24 php70 mysql56-server php70-mysqlnd这一mysql56-server在apache和php旁边安装了mysql56-server软件包。

If you need a web server quickly without have to worry about setup you may as well launch an instance picked from the AWS Marketplace. 如果您快速需要一台Web服务器而不必担心设置,那么您也可以启动从AWS Marketplace挑选的实例。 There are perfect Amazon Machine Images (AMI) for any situation. 在任何情况下都有完美的Amazon Machine Images(AMI)。

For instance, Bitnami offers LAMP solutions on AWS Marketplace with no extra cost besides EC2 pricing. 例如,Bitnami在AWS Marketplace上提供LAMP解决方案,除了EC2定价外没有任何额外费用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM