/
turbo.me
109 lines (79 loc) · 2.58 KB
/
turbo.me
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
# Apache turbo.me file
# https://github.com/turboapps/turbome/tree/master/apache
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
requires privilege:admin
###################################
# Meta tags
###################################
meta title="apache"
meta name="apache"
meta namespace="apache"
###################################
# Pull dependency images
###################################
layer microsoft/vcredist:2012
using gnu/wget,7-zip/7-zip,python/python:3.4.1,gnu/sed
###################################
# Image settings
###################################
var port = "8080"
var email = "admin@localhost"
var intalldir = "C:\\apache\\apache2"
###################################
# Download and install
###################################
cmd pip install requests --quiet
# Set working directory
cmd mkdir c:\Workspace
workdir c:\Workspace
batch
echo import requests >> getVersion.py
echo import re >> getVersion.py
echo host = 'https://www.apachehaus.com/cgi-bin/download.plx' >> getVersion.py
echo headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0'} >> getVersion.py
echo r = requests.get(host , headers=headers, timeout=10) >> getVersion.py
echo print(re.findall('httpd-(.*x86-vc11.*)\.zip', r.text )[0]) >> getVersion.py
cmd python getVersion.py
var version = last
var url = "http://www.apachehaus.com/downloads/httpd-" + version + ".zip"
cmd "python -c ""print('%version%'.split('-')[0])"""
var tag = last
# Download
cmd "wget --no-check-certificate --no-verbose -O httpd.zip %url%"
cmd mkdir c:\apache
cmd 7z x httpd.zip -oc:\apache
cmd dir /b c:\apache | findstr A
var outputDir = last
workdir "c:\apache\Apache24"
batch
sed -i "s|^Listen 80|Listen 8080|" conf\httpd.conf
sed -i "s|\("^ServerAdmin\s" * *\).*|\1admin@localhost|" conf\httpd.conf
sed -i "s|\("^ServerName" *\)|#\1|" conf\httpd.conf
sed -i "s|/Apache24|C:\\apache\\Apache24|" conf\httpd.conf
batch
bin\httpd.exe -k install > nul
echo 1
###################################
# Environment Variables
###################################
env path="C:\apache\Apache24\bin"
###################################
# Clean up
###################################
workdir c:\
cmd rmdir c:\Workspace /s /q
cmd rmdir c:\wget /s /q
cmd rmdir c:\python34 /s /q
###################################
# Version
###################################
meta tag=tag
meta version=tag
###################################
# Startup File
###################################
setworkdir "C:\apache\Apache24"
# No startup files needed