Skip to content

Commit a3d4b04

Browse files
committed
Finish config changes that allow html pages to live in pages subdir
Include an example htaccess file and apache vhost config file that shows how to configure the webserver. Signed-off-by: Vernon Mauery <[email protected]>
1 parent 3c86789 commit a3d4b04

File tree

3 files changed

+49
-65
lines changed

3 files changed

+49
-65
lines changed

apache-vhost.example

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<VirtualHost hostname>
2+
3+
SSLEngine off
4+
ServerName hostname
5+
6+
ServerAdmin webmaster@localhost
7+
8+
DocumentRoot /path/to/pyrobox/html/pages
9+
ServerRoot /path/to/pyrobox/html/pages
10+
11+
FastCgiServer /path/to/pyrobox/config.fcgi
12+
#FastCgiExternalServer /path/to/pyrobox/config.fcgi -host localhost:4545
13+
14+
<Directory />
15+
Options FollowSymLinks
16+
AllowOverride None
17+
</Directory>
18+
<Directory /path/to/pyrobox/html/>
19+
Options Indexes FollowSymLinks MultiViews
20+
AllowOverride All
21+
Order allow,deny
22+
allow from all
23+
</Directory>
24+
25+
Alias /config/ /path/to/pyrobox/config.fcgi
26+
27+
Alias /js /path/to/pyrobox/html/js/
28+
Alias /css /path/to/pyrobox/html/css/
29+
Alias /theme /path/to/pyrobox/html/theme/
30+
31+
32+
ErrorLog /var/log/apache2/error.log
33+
34+
# Possible values include: debug, info, notice, warn, error, crit,
35+
# alert, emerg.
36+
LogLevel warn
37+
38+
CustomLog /var/log/apache2/access.log combined
39+
ServerSignature On
40+
41+
</VirtualHost>
42+

fcgi/config.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class JSON_Request: public Fastcgipp::Request<char>
8888
std::stringstream& form_response(std::stringstream& ss, const std::string& form_name) {
8989
here();
9090
// build the form
91-
std::string form_file_name = "js/json/forms/";
91+
std::string form_file_name = "html/js/json/forms/";
9292
form_file_name += form_name;
9393
std::ifstream form_file;
9494
form_file.open(form_file_name.c_str(), std::ios::binary);
@@ -112,7 +112,7 @@ class JSON_Request: public Fastcgipp::Request<char>
112112
// send the form (with return code/error info)
113113
} else {
114114
here();
115-
ss << "form: {},\n";
115+
ss << form_name << ": {form: {elements:[]}, values: {}, },\n";
116116
}
117117
return ss;
118118
}

html/.htaccess

+5-63
Original file line numberDiff line numberDiff line change
@@ -8,79 +8,21 @@
88
#</FilesMatch>
99

1010
# Don't show directory listings for URLs which map to a directory.
11-
#Options -Indexes
11+
Options -Indexes
1212

1313
# Follow symbolic links in this directory.
1414
Options +FollowSymLinks
1515

16-
# Customized error messages.
17-
#ErrorDocument 404 /index.html
18-
19-
# Set the default handler.
20-
#DirectoryIndex index.html
21-
22-
# Override PHP settings. More in sites/default/settings.php
23-
# but the following cannot be changed at runtime.
24-
25-
# Requires mod_expires to be enabled.
26-
#<IfModule mod_expires.c>
27-
# # Enable expirations.
28-
# ExpiresActive On
29-
# # Cache all files for 2 weeks after access (A).
30-
# ExpiresDefault A1209600
31-
# # Do not cache dynamically generated pages.
32-
# ExpiresByType text/html A1
33-
#</IfModule>
34-
3516
# Various rewrite rules.
3617
<IfModule mod_rewrite.c>
3718
RewriteEngine on
3819

39-
# If your site can be accessed both with and without the 'www.' prefix, you
40-
# can use one of the following settings to redirect users to your preferred
41-
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
42-
#
43-
# To redirect all users to access the site WITH the 'www.' prefix,
44-
# (http://example.com/... will be redirected to http://www.example.com/...)
45-
# adapt and uncomment the following:
46-
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
47-
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
48-
#
49-
# To redirect all users to access the site WITHOUT the 'www.' prefix,
50-
# (http://www.example.com/... will be redirected to http://example.com/...)
51-
# uncomment and adapt the following:
52-
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
53-
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
54-
55-
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
56-
# VirtualDocumentRoot and the rewrite rules are not working properly.
57-
# For example if your site is at http://example.com/drupal uncomment and
58-
# modify the following line:
59-
# RewriteBase /drupal
60-
#
61-
# If your site is running in a VirtualDocumentRoot at http://example.com/,
62-
# uncomment the following line:
63-
# RewriteBase /
64-
65-
# Rewrite old-style URLs of the form 'node.php?id=x'.
66-
#RewriteCond %{REQUEST_FILENAME} !-f
67-
#RewriteCond %{REQUEST_FILENAME} !-d
68-
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
69-
#RewriteRule node.php index.php?q=node/view/%1 [L]
70-
71-
# Rewrite old-style URLs of the form 'module.php?mod=x'.
72-
#RewriteCond %{REQUEST_FILENAME} !-f
73-
#RewriteCond %{REQUEST_FILENAME} !-d
74-
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
75-
#RewriteRule module.php index.php?q=%1 [L]
20+
RewriteCond %{REQUEST_FILENAME} !-f
21+
RewriteCond %{REQUEST_FILENAME} !-d
22+
RewriteCond %{REQUEST_URI} !\.html$
23+
RewriteRule ^(.*)$ $1.html [L]
7624

77-
RewriteCond %{REQUEST_FILENAME} -d
78-
RewriteCond ^([.*]/[^[.]*) $1.html
7925

80-
# Rewrite current-style URLs of the form 'index.php?q=x'.
81-
#RewriteCond %{REQUEST_FILENAME} !-f
82-
#RewriteCond %{REQUEST_FILENAME} !-d
83-
#RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
8426
</IfModule>
8527

8628
DefaultType text/html

0 commit comments

Comments
 (0)