简体   繁体   English

AWS Windows Server 2016 WAMP无法正常工作

[英]AWS Windows Server 2016 WAMP not working

I want to host my php website on AWS EC2 Windows Server 2016. I have party success on the process as i can use the ip or hostname to access the HTML web page but when i try to create a test.php and view it in my PC and got an error said 404 files not found. 我想将我的php网站托管在AWS EC2 Windows Server 2016上。我在此过程中取得了成功,因为我可以使用ip或主机名来访问HTML网页,但是当我尝试创建test.php并在我的网站上查看它时PC并显示一条错误,提示未找到404文件。 However i can view test.php in the Server side PC by remote. 但是,我可以通过远程在服务器端PC中查看test.php。

I am not sure is that any config or setting missing there, i try to mark all my steps below and see if any mistakes: 我不确定那里是否缺少任何配置或设置,我尝试在下面标记我的所有步骤,看是否有任何错误:

  1. Install IIS Manager 安装IIS管理器
  2. Set Port 80 in AWS Security Groups 在AWS安全组中设置端口80
  3. Install WAMP 安装WAMP
  4. Set the IIS default site to WAMP working area 将IIS默认站点设置为WAMP工作区

Those are my steps for the setup. 这些是我的设置步骤。 Does any one have some ideas on it?? 有人对此有想法吗? Thanks. 谢谢。

As RiggsFolly suggests you need pick between IIS or Apache (the 'A' in WAMP). 正如RiggsFolly建议的那样,您需要在IIS或Apache(WAMP中的“ A”)之间进行选择。 If you have 2 services like IIS and Apache competing for port 80 one will fail to start properly and not necessarily the same one each time. 如果您有IIS和Apache之类的两项服务争夺端口80,则一项服务将无法正常启动,并且不一定每次都启动相同的服务。

If both services are running i suspect one will be listening on the public IP of the machine, and the other listening to the loopback address (local only). 如果两种服务都在运行,我怀疑其中一种会监听计算机的公共IP,而另一种监听回送地址(仅限本地)。

WAMP WAMP


If you want to stick with WAMP, will you need to either uninstall or stop and disable the IIS service, then restart WAMP to ensure its Apache receiving the requests. 如果要坚持使用WAMP,是否需要卸载或停止并禁用IIS服务,然后重新启动WAMP以确保其Apache接收请求。

IIS (WIMP?) IIS(WIMP?)


If you want to use IIS to host a Php application its a bit more complicated and you will probably need to uninstall WAMP, then manually install and configure Php and MySQL. 如果您想使用IIS来托管Php应用程序,则它要复杂一些,您可能需要卸载WAMP,然后手动安装和配置Php和MySQL。

Installing Php into IIS is pretty strait forward: https://docs.microsoft.com/en-us/iis/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install-iis-and-php 将php安装到IIS非常困难: https : //docs.microsoft.com/zh-cn/iis/application-frameworks/scenario-build-a-php-website-on-iis/configuring-step-1-install -iis和php

Broadly speaking the steps are: 概括地说,步骤是:

  • Install IIS 安装IIS
  • Install Web Platform Installer 安装Web平台安装程序
  • Install Php Framework 安装PHP框架

For your database, you can install MySQL Server onto your ec2-instance (latest download and instructions - https://dev.mysql.com/downloads/mysql/ ). 为了您的数据库,可以安装MySQL服务器安装到您的EC2实例(最新的下载和说明- https://dev.mysql.com/downloads/mysql/ )。 If your running MySQL on the instance do not open port 3306 (mysql) to the world - it should only be accessible to IP's where you administer the database. 如果您在实例上运行的MySQL没有向世界开放端口3306(mysql),那么只有管理数据库的IP才可以访问它。

Personally i would recommend hosting the database in RDS or Aurora and let AWS take care of the database server details. 我个人建议将数据库托管在RDS或Aurora中,并让AWS处理数据库服务器的详细信息。 When setting up the security group for the database, ensure you only allow your server access and any administrative IP addresses you own. 为数据库设置安全组时,请确保仅允许您访问服务器以及您拥有的任何管理IP地址。

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

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