File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 10
10
do_git_checkout = False
11
11
assume_yes = False
12
12
13
+ cwd = os .path .dirname (os .path .realpath (__file__ ))
14
+ vhost_tpl_path = cwd + '/vhost.tpl'
15
+
13
16
if not os .access ('/etc/hosts' , os .W_OK ):
14
17
exit ('Cannot write to /etc/hosts, please run this script as root or with sudo' )
15
18
16
- if not os .access ('vhost.tpl' , os .W_OK ):
19
+ if not os .access (vhost_tpl_path , os .W_OK ):
20
+ print vhost_tpl_path
17
21
exit ('Cannot read vhost template file!' )
18
22
19
23
cfg = ConfigParser .ConfigParser ()
20
- configfile = ' create-vhost.ini'
24
+ configfile = cwd + '/ create-vhost.ini'
21
25
22
26
print '--- Create vhost script for Apache2 ---'
23
27
print '--- Copyright Stephen Hoogendijk 2013, Licensed under the GPL V2 License ---'
@@ -97,7 +101,7 @@ def create_vhost():
97
101
98
102
99
103
# read the template and replace the variables
100
- vhost_tpl = open ('vhost.tpl' , 'r' ).read ()
104
+ vhost_tpl = open (vhost_tpl_path , 'r' ).read ()
101
105
102
106
103
107
vhost_tpl = vhost_tpl .replace ('{APACHE_PORT}' , str (apache_port ))
Original file line number Diff line number Diff line change
1
+ <VirtualHost *:80>
2
+ ServerName test.dev
3
+ ServerAlias www.test.dev
4
+ DocumentRoot "/var/www/test"
5
+ <Directory "/var/www/test">
6
+ AllowOverride All
7
+ Order allow,deny
8
+ Allow from all
9
+ </Directory>
10
+ </VirtualHost
You can’t perform that action at this time.
0 commit comments