Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
omenking authored Feb 26, 2024
1 parent d23f25e commit a0ae706
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ec2/userdata/userdata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $zipPath = "C:\apache.zip"
# Download Apache HTTP Server zip
# Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath -MaximumRedirection 5

# Invote-WebRequest was getting 308 redirect refuses to work with proper flag
# Invoke-WebRequest was getting 308 redirect refuses to work with proper flag
# So we can use the web client to download instead.
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile($downloadUrl,$zipPath)
Expand All @@ -40,7 +40,7 @@ $httpdPath = Join-Path -Path $extractPath -ChildPath "Apache24\bin\httpd.exe"
Start-Process -FilePath $httpdPath -ArgumentList "-k install -d C:\Apache24" -Wait

# Configure apache to start on port 8080
(Get-Content C:\Apache24\conf\httpd.conf) -replace '^Listen 80$', 'Listen 8080' | Set-Content C:\Apache24\conf\httpd.conf
#(Get-Content C:\Apache24\conf\httpd.conf) -replace '^Listen 80$', 'Listen 8080' | Set-Content C:\Apache24\conf\httpd.conf

# Start the Apache service
Start-Service -Name "Apache2.4"
Expand Down
4 changes: 1 addition & 3 deletions ec2/userdata/userdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ write_files:
</html>
owner: root:root
permissions: '0644'

runcmd:
- systemctl start httpd.service
- systemctl enable httpd.service
- systemctl restart httpd.service
Instructions for Use:
- systemctl restart httpd.service

0 comments on commit a0ae706

Please sign in to comment.