php 如何在 EC2 上启动 Apache

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4043668/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 11:48:11  来源:igfitidea点击:

How to start Apache on EC2

phpapachewebserveramazon-ec2

提问by murze

I'm an absolute newbie to EC2. My goal is to run a php-mysql-website on EC2.

我绝对是 EC2 的新手。我的目标是在 EC2 上运行一个 php-mysql-website。

I've just setup a new instance based on this ami

我刚刚基于这个 ami设置了一个新实例

It seems that apache isn't running? How do I start apache? Is there a general tutorial on how to start EC2 as a web server?

似乎 apache 没有运行?我如何启动阿帕奇?是否有关于如何将 EC2 作为 Web 服务器启动的一般教程?

Thanks!

谢谢!

采纳答案by Orbit

For Suse 11, try

对于 Suse 11,请尝试

 rcapache2 status
 rcapache2 start

If it is not installed, you can install with

如果没有安装,你可以安装

yast2 --install apache2

for a tutorial on LAMP with this server, check

有关此服务器的 LAMP 教程,请检查

http://www.susegeek.com/internet-browser/install-configure-lamp-apachemysqlphp-in-opensuse-110/

http://www.susegeek.com/internet-browser/install-configure-lamp-apachemysqlphp-in-opensuse-110/

回答by scientastic

It really depends on the distribution you have chosen. Typically, though, you can start Apache using the init scripts. For example, on Ubuntu server it will be:

这实际上取决于您选择的发行版。不过,通常情况下,您可以使用 init 脚本启动 Apache。例如,在 Ubuntu 服务器上,它将是:

sudo /etc/init.d/apache2 start

On CentOS or Redhat it might be:

在 CentOS 或 Redhat 上,它可能是:

sudo /etc/init.d/httpd start

回答by Hasanavi

Well, you need to set up a LAMP server. To install LAMP server with one command, try the following:

那么,您需要设置一个 LAMP 服务器。要使用一个命令安装 LAMP 服务器,请尝试以下操作:

sudo apt-get install lamp-server^ 

Note that the last ^is not a typo, it's included in the command. See thispage for more information.

请注意,最后一个^不是拼写错误,它包含在命令中。有关更多信息,请参阅页面。

回答by Brij Raj Singh - MSFT

sudo apt-get update sudo tasksel

须藤 apt-get 更新须藤任务

and enjoy.

享受。

回答by Paul Preibisch

If you are running bitnami's Drupal Stack, you can

如果你正在运行 bitnami 的 Drupal Stack,你可以

1) cd /opt/bitnami 2) sudo bash (enter password) 3) sh ctlscript.sh restart

1) cd /opt/bitnami 2) sudo bash (输入密码) 3) sh ctlscript.sh restart

this will restart the LAMP stack

这将重新启动 LAMP 堆栈