简体   繁体   English

如何在AWS EC2 Cloud9上运行Apache

[英]How to run Apache on AWS EC2 Cloud9

I migrated from Cloud9 to AWS Cloud9. 我从Cloud9迁移到AWS Cloud9。 I'm unable to see the preview of the Apache server. 我看不到Apache服务器的预览。 The server is running : 服务器正在运行:

ubuntu@ip-172-31-22-83:~/environment$ sudo service apache2 status
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Thu 2019-04-11 09:17:31 UTC; 17min ago
  Process: 791 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 997 (apache2)
    Tasks: 6 (limit: 1152)
   CGroup: /system.slice/apache2.service
           ├─ 997 /usr/sbin/apache2 -k start
           ├─1086 /usr/sbin/apache2 -k start
           ├─1087 /usr/sbin/apache2 -k start
           ├─1088 /usr/sbin/apache2 -k start
           ├─1089 /usr/sbin/apache2 -k start
           └─1090 /usr/sbin/apache2 -k start

Apr 11 09:17:29 ip-172-31-22-83 systemd[1]: Starting The Apache HTTP Server...
Apr 11 09:17:31 ip-172-31-22-83 systemd[1]: Started The Apache HTTP Server.

But when I try previewing the server, nothing works: 但是,当我尝试预览服务器时,没有任何效果:

  • localhost/ 本地主机/

Client Closed Request 499 - AWSCloud9VFSService VFS connection does not exist 客户端关闭请求499-AWSCloud9VFSService VFS连接不存在

  • localhost:8080 本地主机:8080

Cannot GET /vfs/80990xxxxxxxxxxxxxxxxxxxxxxxxxxx/previewlocalhost:8080 无法获取/ vfs / 80990xxxxxxxxxxxxxxxxxxxxxxxxxxx / previewlocalhost:8080

I already tryed this : 我已经尝试过了:

https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-app-reload https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-app-reload

But it's a fake server and don't load the root file index.php . 但这是一台伪造的服务器,不加载根文件index.php It displays list of files in folders and do not consider .htaccess files. 它显示文件夹中文件的列表,并且不考虑.htaccess文件。

I also try changing port for 8080 according to Configure apache to listen on port other than 80 我也尝试根据配置apache更改8080的端口以侦听80以外的端口

Apache is natively running on AWS Cloud9. Apache在AWS Cloud9上本地运行。 To make Apache working with the Cloud9 IDE preview system, you need to : 要使Apache使用Cloud9 IDE预览系统,您需要:

A step-by-step guide is detailed on this page 此页面上详细介绍了分步指南

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

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