Skip to content

Commit a5c833b

Browse files
author
redray
committed
fixed session error when changing from nonssl to ssl and fast-cgi is active. Problem was different web-root dir in ssl-directive!
1 parent 7eaafe6 commit a5c833b

File tree

1 file changed

+122
-117
lines changed

1 file changed

+122
-117
lines changed

server/conf/vhost.conf.master

Lines changed: 122 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,98 @@
11

22
<VirtualHost <tmpl_var name='ip_address'>:80>
33
<tmpl_if name='php' op='==' value='suphp'>
4-
DocumentRoot <tmpl_var name='web_document_root'>
4+
DocumentRoot <tmpl_var name='web_document_root'>
55
</tmpl_else>
6-
DocumentRoot <tmpl_var name='web_document_root_www'>
6+
DocumentRoot <tmpl_var name='web_document_root_www'>
77
</tmpl_if>
88

9-
ServerName <tmpl_var name='domain'>
9+
ServerName <tmpl_var name='domain'>
1010
<tmpl_if name='alias'>
11-
ServerAlias <tmpl_var name='alias'>
11+
ServerAlias <tmpl_var name='alias'>
1212
</tmpl_if>
13-
ServerAdmin webmaster@<tmpl_var name='domain'>
13+
ServerAdmin webmaster@<tmpl_var name='domain'>
1414

15-
ErrorLog <tmpl_var name='document_root'>/log/error.log
15+
ErrorLog <tmpl_var name='document_root'>/log/error.log
1616
<tmpl_if name='errordocs'>
1717

18-
ErrorDocument 400 /error/invalidSyntax.html
19-
ErrorDocument 401 /error/authorizationRequired.html
20-
ErrorDocument 403 /error/forbidden.html
21-
ErrorDocument 404 /error/fileNotFound.html
22-
ErrorDocument 405 /error/methodNotAllowed.html
23-
ErrorDocument 500 /error/internalServerError.html
24-
ErrorDocument 503 /error/overloaded.html
18+
ErrorDocument 400 /error/invalidSyntax.html
19+
ErrorDocument 401 /error/authorizationRequired.html
20+
ErrorDocument 403 /error/forbidden.html
21+
ErrorDocument 404 /error/fileNotFound.html
22+
ErrorDocument 405 /error/methodNotAllowed.html
23+
ErrorDocument 500 /error/internalServerError.html
24+
ErrorDocument 503 /error/overloaded.html
2525
</tmpl_if>
2626

27-
<Directory {tmpl_var name='web_document_root_www'}>
28-
Options FollowSymLinks
29-
AllowOverride Indexes AuthConfig Limit FileInfo
30-
Order allow,deny
31-
Allow from all
27+
<Directory {tmpl_var name='web_document_root_www'}>
28+
Options FollowSymLinks
29+
AllowOverride Indexes AuthConfig Limit FileInfo
30+
Order allow,deny
31+
Allow from all
3232
<tmpl_if name='ssi' op='==' value='y'>
33-
34-
# ssi enabled
35-
AddType text/html .shtml
36-
AddOutputFilter INCLUDES .shtml
37-
Options +Includes
33+
34+
# ssi enabled
35+
AddType text/html .shtml
36+
AddOutputFilter INCLUDES .shtml
37+
Options +Includes
3838
</tmpl_if>
39-
</Directory>
39+
</Directory>
4040

4141
<tmpl_if name='cgi' op='==' value='y'>
42-
# cgi enabled
43-
ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
44-
AddHandler cgi-script .cgi
45-
AddHandler cgi-script .pl
42+
# cgi enabled
43+
ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
44+
AddHandler cgi-script .cgi
45+
AddHandler cgi-script .pl
4646
</tmpl_if>
4747
<tmpl_if name='suexec' op='==' value='y'>
48-
# suexec enabled
49-
SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
48+
# suexec enabled
49+
SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
5050
</tmpl_if>
5151
<tmpl_if name='php' op='==' value='mod'>
52-
# mod_php enabled
53-
AddType application/x-httpd-php .php .php3 .php4 .php5
52+
# mod_php enabled
53+
AddType application/x-httpd-php .php .php3 .php4 .php5
5454
</tmpl_if>
5555
<tmpl_if name='php' op='==' value='suphp'>
56-
# suphp enabled
57-
<Directory {tmpl_var name='web_document_root'}>
58-
suPHP_Engine on
59-
# suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
60-
AddHandler x-httpd-suphp .php .php3 .php4 .php5
61-
suPHP_AddHandler x-httpd-suphp
62-
</Directory>
56+
# suphp enabled
57+
<Directory {tmpl_var name='web_document_root'}>
58+
suPHP_Engine on
59+
# suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
60+
AddHandler x-httpd-suphp .php .php3 .php4 .php5
61+
suPHP_AddHandler x-httpd-suphp
62+
</Directory>
6363
</tmpl_if>
6464
<tmpl_if name='php' op='==' value='cgi'>
65-
# php as cgi enabled
66-
AddType application/x-httpd-php .php .php3 .php4 .php5
65+
# php as cgi enabled
66+
AddType application/x-httpd-php .php .php3 .php4 .php5
6767
</tmpl_if>
6868
<tmpl_if name='php' op='==' value='fast-cgi'>
69-
# php as fast-cgi enabled
70-
<Directory {tmpl_var name='web_document_root_www'}>
71-
AddHandler fcgid-script .php .php3 .php4 .php5
72-
FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
73-
Options +ExecCGI
74-
AllowOverride all
75-
Order allow,deny
76-
Allow from all
77-
</Directory>
69+
# php as fast-cgi enabled
70+
<Directory {tmpl_var name='web_document_root_www'}>
71+
AddHandler fcgid-script .php .php3 .php4 .php5
72+
FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
73+
Options +ExecCGI
74+
AllowOverride all
75+
Order allow,deny
76+
Allow from all
77+
</Directory>
7878
</tmpl_if>
7979
<tmpl_if name="rewrite_enabled">
80-
81-
RewriteEngine on
80+
81+
RewriteEngine on
8282
<tmpl_loop name="redirects">
83-
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
84-
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
83+
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
84+
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
8585
</tmpl_loop>
8686
</tmpl_if>
8787
<tmpl_if name='php' op='!=' value=''>
88-
89-
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
90-
php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
91-
php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
92-
#php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
88+
89+
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
90+
php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
91+
php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
92+
#php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
9393
</tmpl_if>
9494

95-
<tmpl_var name='apache_directives'>
95+
<tmpl_var name='apache_directives'>
9696
</VirtualHost>
9797

9898

@@ -104,91 +104,96 @@
104104
###########################################################
105105

106106
<VirtualHost <tmpl_var name='ip_address'>:443>
107-
DocumentRoot <tmpl_var name='web_document_root'>
108-
ServerName <tmpl_var name='domain'>
107+
<tmpl_if name='php' op='==' value='suphp'>
108+
DocumentRoot <tmpl_var name='web_document_root'>
109+
</tmpl_else>
110+
DocumentRoot <tmpl_var name='web_document_root_www'>
111+
</tmpl_if>
112+
113+
ServerName <tmpl_var name='domain'>
109114
<tmpl_if name='alias'>
110-
ServerAlias <tmpl_var name='alias'>
115+
ServerAlias <tmpl_var name='alias'>
111116
</tmpl_if>
112-
ServerAdmin webmaster@<tmpl_var name='domain'>
113-
114-
ErrorLog <tmpl_var name='document_root'>/log/error.log
117+
ServerAdmin webmaster@<tmpl_var name='domain'>
118+
119+
ErrorLog <tmpl_var name='document_root'>/log/error.log
115120

116121
<tmpl_if name='is_errordocs'>
117-
ErrorDocument 400 /error/invalidSyntax.html
118-
ErrorDocument 401 /error/authorizationRequired.html
119-
ErrorDocument 403 /error/forbidden.html
120-
ErrorDocument 404 /error/fileNotFound.html
121-
ErrorDocument 405 /error/methodNotAllowed.html
122-
ErrorDocument 500 /error/internalServerError.html
123-
ErrorDocument 503 /error/overloaded.html
124-
125-
</tmpl_if>
126-
SSLEngine on
127-
SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.crt
128-
SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.key
122+
ErrorDocument 400 /error/invalidSyntax.html
123+
ErrorDocument 401 /error/authorizationRequired.html
124+
ErrorDocument 403 /error/forbidden.html
125+
ErrorDocument 404 /error/fileNotFound.html
126+
ErrorDocument 405 /error/methodNotAllowed.html
127+
ErrorDocument 500 /error/internalServerError.html
128+
ErrorDocument 503 /error/overloaded.html
129+
130+
</tmpl_if>
131+
SSLEngine on
132+
SSLCertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.crt
133+
SSLCertificateKeyFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.key
129134
<tmpl_if name='has_bundle_cert'>
130-
SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.bundle
135+
SSLCACertificateFile <tmpl_var name='document_root'>/ssl/<tmpl_var name='domain'>.bundle
131136
</tmpl_if>
132137

133138
<tmpl_if name='cgi'op='==' value='y'>
134-
# cgi enabled
135-
ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
136-
AddHandler cgi-script .cgi
137-
AddHandler cgi-script .pl
139+
# cgi enabled
140+
ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
141+
AddHandler cgi-script .cgi
142+
AddHandler cgi-script .pl
138143
</tmpl_if>
139144
<tmpl_if name='ssi'op='==' value='y'>
140-
# ssi enabled
141-
AddType text/html .shtml
142-
AddOutputFilter INCLUDES .shtml
145+
# ssi enabled
146+
AddType text/html .shtml
147+
AddOutputFilter INCLUDES .shtml
143148
</tmpl_if>
144149
<tmpl_if name='suexec'op='==' value='y'>
145-
# suexec enabled
146-
SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
150+
# suexec enabled
151+
SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
147152
</tmpl_if>
148153
<tmpl_if name='php' op='==' value='mod'>
149-
# mod_php enabled
150-
AddType application/x-httpd-php .php .php3 .php4 .php5
154+
# mod_php enabled
155+
AddType application/x-httpd-php .php .php3 .php4 .php5
151156
</tmpl_if>
152157
<tmpl_if name='php' op='==' value='suphp'>
153-
# suphp enabled
154-
suPHP_Engine on
155-
suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
156-
AddHandler x-httpd-php .php .php3 .php4 .php5
157-
suPHP_AddHandler x-httpd-php
158+
# suphp enabled
159+
suPHP_Engine on
160+
suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
161+
AddHandler x-httpd-php .php .php3 .php4 .php5
162+
suPHP_AddHandler x-httpd-php
158163
</tmpl_if>
159164
<tmpl_if name='php' op='==' value='cgi'>
160-
# php as cgi enabled
161-
AddType application/x-httpd-php .php .php3 .php4 .php5
165+
# php as cgi enabled
166+
AddType application/x-httpd-php .php .php3 .php4 .php5
162167
</tmpl_if>
163168
<tmpl_if name='php' op='==' value='fast-cgi'>
164-
# php as fast-cgi enabled
165-
<Directory {tmpl_var name='web_document_root_www'}>
166-
AddHandler fcgid-script .php .php3 .php4 .php5
167-
FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
168-
Options +ExecCGI
169-
AllowOverride all
170-
Order allow,deny
171-
Allow from all
172-
</Directory>
169+
# php as fast-cgi enabled
170+
<Directory {tmpl_var name='web_document_root_www'}>
171+
AddHandler fcgid-script .php .php3 .php4 .php5
172+
FCGIWrapper <tmpl_var name='fastcgi_starter_path'><tmpl_var name='fastcgi_starter_script'> .php
173+
Options +ExecCGI
174+
AllowOverride all
175+
Order allow,deny
176+
Allow from all
177+
</Directory>
173178
</tmpl_if>
174179
<tmpl_if name="rewrite_enabled">
175-
176-
RewriteEngine on
180+
181+
RewriteEngine on
177182
<tmpl_loop name="redirects">
178-
179-
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
180-
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
183+
184+
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
185+
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
181186
</tmpl_loop>
182187
</tmpl_if>
183188
<tmpl_if name='php' op='!=' value=''>
184-
185-
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
186-
php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
187-
php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
188-
#php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
189+
190+
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
191+
php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
192+
php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
193+
#php_admin_value open_basedir <tmpl_var name='document_root'>:/usr/share/php5
189194
</tmpl_if>
190195

191-
<tmpl_var name='apache_directives'>
196+
<tmpl_var name='apache_directives'>
192197
</VirtualHost>
193198
</IfModule>
194199

0 commit comments

Comments
 (0)