質問編集履歴
1
httpd\.conf追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -47,4 +47,256 @@
|
|
47
47
|
もともとローカルの仮想環境で開発していて、その時は正常でした。(rails serverでlocalhost:3000のアクセス)
|
48
48
|
SELinuxを完全に無効にしてみたりもしましたが治りませんでした。
|
49
49
|
|
50
|
-
怪しいところ、些細なことでもいいのでアドバイス頂きたいです。
|
50
|
+
怪しいところ、些細なことでもいいのでアドバイス頂きたいです。
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
追記
|
55
|
+
|
56
|
+
|
57
|
+
apache conf
|
58
|
+
```
|
59
|
+
# SHTMLに対応していないブラウザ
|
60
|
+
SetEnvIfExpr "!(%{HTTP_ACCEPT} -strcmatch '*application/xhtml+xml*') || %{HTTP_USER_AGENT} =~ m#UP\\.Browser/6\\.2|Nintendo 3DS| NX/1\\.#" LEGACY_BROWSER
|
61
|
+
|
62
|
+
ServerRoot "/etc/httpd"
|
63
|
+
|
64
|
+
|
65
|
+
#
|
66
|
+
#Listen 12.34.56.78:80
|
67
|
+
Listen 80
|
68
|
+
|
69
|
+
|
70
|
+
#
|
71
|
+
# Example:
|
72
|
+
# LoadModule foo_module modules/mod_foo.so
|
73
|
+
#
|
74
|
+
Include conf.modules.d/*.conf
|
75
|
+
|
76
|
+
#
|
77
|
+
# If you wish httpd to run as a different user or group, you must run
|
78
|
+
# httpd as root initially and it will switch.
|
79
|
+
#
|
80
|
+
# User/Group: The name (or #number) of the user/group to run httpd as.
|
81
|
+
# It is usually good practice to create a dedicated user and group for
|
82
|
+
# running httpd, as with most system services.
|
83
|
+
#
|
84
|
+
User apache
|
85
|
+
Group apache
|
86
|
+
|
87
|
+
|
88
|
+
#
|
89
|
+
# ServerAdmin: Your address, where problems with the server should be
|
90
|
+
# e-mailed. This address appears on some server-generated pages, such
|
91
|
+
# as error documents. e.g. admin@your-domain.com
|
92
|
+
#
|
93
|
+
ServerAdmin <私のメールアドレス>
|
94
|
+
|
95
|
+
#
|
96
|
+
# ServerName gives the name and port that the server uses to identify itself.
|
97
|
+
# This can often be determined automatically, but we recommend you specify
|
98
|
+
# it explicitly to prevent problems during startup.
|
99
|
+
#
|
100
|
+
# If your host doesn't have a registered DNS name, enter its IP address here.
|
101
|
+
#
|
102
|
+
ServerName <このサーバのホスト名>:80
|
103
|
+
|
104
|
+
#
|
105
|
+
# Deny access to the entirety of your server's filesystem. You must
|
106
|
+
# explicitly permit access to web content directories in other
|
107
|
+
# <Directory> blocks below.
|
108
|
+
#
|
109
|
+
<Directory />
|
110
|
+
AllowOverride none
|
111
|
+
Require all denied
|
112
|
+
</Directory>
|
113
|
+
|
114
|
+
|
115
|
+
#
|
116
|
+
# DocumentRoot: The directory out of which you will serve your
|
117
|
+
# documents. By default, all requests are taken from this directory, but
|
118
|
+
# symbolic links and aliases may be used to point to other locations.
|
119
|
+
#
|
120
|
+
DocumentRoot "/var/www/html"
|
121
|
+
|
122
|
+
#
|
123
|
+
# Relax access to content within /var/www.
|
124
|
+
#
|
125
|
+
# <Directory "/var/www">
|
126
|
+
# AllowOverride None
|
127
|
+
# # Allow open access:
|
128
|
+
# Require all granted
|
129
|
+
# </Directory>
|
130
|
+
|
131
|
+
# Further relax access to the default document root:
|
132
|
+
<Directory "/var/www">
|
133
|
+
|
134
|
+
# The Options directive is both complicated and important. Please see
|
135
|
+
# http://httpd.apache.org/docs/2.4/mod/core.html#options
|
136
|
+
# for more information.
|
137
|
+
#
|
138
|
+
Options FollowSymLinks
|
139
|
+
|
140
|
+
#
|
141
|
+
# AllowOverride controls what directives may be placed in .htaccess files.
|
142
|
+
# It can be "All", "None", or any combination of the keywords:
|
143
|
+
# Options FileInfo AuthConfig Limit
|
144
|
+
#
|
145
|
+
AllowOverride None
|
146
|
+
|
147
|
+
#
|
148
|
+
# Controls who can get stuff from this server.
|
149
|
+
#
|
150
|
+
# Require all granted
|
151
|
+
</Directory>
|
152
|
+
|
153
|
+
#
|
154
|
+
# DirectoryIndex: sets the file that Apache will serve if a directory
|
155
|
+
# is requested.
|
156
|
+
#
|
157
|
+
<IfModule dir_module>
|
158
|
+
DirectoryIndex index.html
|
159
|
+
</IfModule>
|
160
|
+
# スラッシュで終わるURLを、「index」を追加したURLにリダイレクトする
|
161
|
+
# RedirectMatch permanent ^(.*)/$ $1/index
|
162
|
+
|
163
|
+
#
|
164
|
+
# The following lines prevent .htaccess and .htpasswd files from being
|
165
|
+
# viewed by Web clients.
|
166
|
+
#
|
167
|
+
<Files ".ht*">
|
168
|
+
Require all denied
|
169
|
+
</Files>
|
170
|
+
|
171
|
+
#
|
172
|
+
# ErrorLog: The location of the error log file.
|
173
|
+
# If you do not specify an ErrorLog directive within a <VirtualHost>
|
174
|
+
# container, error messages relating to that virtual host will be
|
175
|
+
# logged here. If you *do* define an error logfile for a <VirtualHost>
|
176
|
+
# container, that host's errors will be logged there and not here.
|
177
|
+
#
|
178
|
+
ErrorLog "logs/error_log"
|
179
|
+
|
180
|
+
#
|
181
|
+
# LogLevel: Control the number of messages logged to the error_log.
|
182
|
+
# Possible values include: debug, info, notice, warn, error, crit,
|
183
|
+
# alert, emerg.
|
184
|
+
#
|
185
|
+
LogLevel warn
|
186
|
+
|
187
|
+
<IfModule log_config_module>
|
188
|
+
#
|
189
|
+
# The following directives define some format nicknames for use with
|
190
|
+
# a CustomLog directive (see below).
|
191
|
+
#
|
192
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
|
193
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
194
|
+
|
195
|
+
<IfModule logio_module>
|
196
|
+
# You need to enable mod_logio.c to use %I and %O
|
197
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
|
198
|
+
</IfModule>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
#
|
203
|
+
# If you prefer a logfile with access, agent, and referer information
|
204
|
+
# (Combined Logfile Format) you can use the following directive.
|
205
|
+
#
|
206
|
+
CustomLog "logs/access_log" combined
|
207
|
+
</IfModule>
|
208
|
+
|
209
|
+
<IfModule alias_module>
|
210
|
+
#
|
211
|
+
# Redirect: Allows you to tell clients about documents that used to
|
212
|
+
# exist in your server's namespace, but do not anymore. The client
|
213
|
+
# will make a new request for the document at its new location.
|
214
|
+
# Example:
|
215
|
+
# Redirect permanent /foo http://www.example.com/bar
|
216
|
+
<If "-n %{PATH_INFO}">
|
217
|
+
# 存在しないディレクトリがURLに含まれていれば、404 Not Found を返す
|
218
|
+
Redirect 404 /
|
219
|
+
</If>
|
220
|
+
|
221
|
+
|
222
|
+
#
|
223
|
+
# ScriptAlias: This controls which directories contain server scripts.
|
224
|
+
# ScriptAliases are essentially the same as Aliases, except that
|
225
|
+
# documents in the target directory are treated as applications and
|
226
|
+
# run by the server when requested rather than as documents sent to the
|
227
|
+
# client. The same rules about trailing "/" apply to ScriptAlias
|
228
|
+
# directives as to Alias.
|
229
|
+
#
|
230
|
+
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
|
231
|
+
|
232
|
+
</IfModule>
|
233
|
+
|
234
|
+
#
|
235
|
+
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
|
236
|
+
# CGI directory exists, if you have that configured.
|
237
|
+
#
|
238
|
+
<Directory "/var/www/cgi-bin">
|
239
|
+
AllowOverride None
|
240
|
+
Options None
|
241
|
+
Require all granted
|
242
|
+
</Directory>
|
243
|
+
|
244
|
+
|
245
|
+
<IfModule mime_module>
|
246
|
+
|
247
|
+
#
|
248
|
+
# If the AddEncoding directives above are commented-out, then you
|
249
|
+
# probably should define those extensions to indicate media types:
|
250
|
+
#
|
251
|
+
AddType application/x-compress .Z
|
252
|
+
AddType application/x-gzip .gz .tgz
|
253
|
+
|
254
|
+
|
255
|
+
#
|
256
|
+
# Filters allow you to process content before it is sent to the client.
|
257
|
+
#
|
258
|
+
# To parse .shtml files for server-side includes (SSI):
|
259
|
+
# (You will also need to add "Includes" to the "Options" directive.)
|
260
|
+
#
|
261
|
+
# AddType text/html .shtml
|
262
|
+
# AddOutputFilter INCLUDES .shtml
|
263
|
+
|
264
|
+
<If "-n reqenv('LEGACY_BROWSER')">
|
265
|
+
# XHTMLに対応していなければ
|
266
|
+
AddType text/html .xhtml
|
267
|
+
</If>
|
268
|
+
</IfModule>
|
269
|
+
|
270
|
+
#
|
271
|
+
# Specify a default charset for all content served; this enables
|
272
|
+
# interpretation of all content as UTF-8 by default. To use the
|
273
|
+
# default browser choice (ISO-8859-1), or to allow the META tags
|
274
|
+
# in HTML content to override this choice, comment out this
|
275
|
+
# directive:
|
276
|
+
#
|
277
|
+
# AddDefaultCharset UTF-8
|
278
|
+
|
279
|
+
# content-typeヘッダにcharsetパラメータを付加する
|
280
|
+
AddCharset utf-8 .xhtml .html .css .es .js .txt .json .xml .csv
|
281
|
+
|
282
|
+
<IfModule mime_magic_module>
|
283
|
+
#
|
284
|
+
# The mod_mime_magic module allows the server to use various hints from the
|
285
|
+
# contents of the file itself to determine its type. The MIMEMagicFile
|
286
|
+
# directive tells the module where the hint definitions are located.
|
287
|
+
#
|
288
|
+
MIMEMagicFile conf/magic
|
289
|
+
</IfModule>
|
290
|
+
|
291
|
+
EnableSendfile on
|
292
|
+
|
293
|
+
# Supplemental configuration
|
294
|
+
#
|
295
|
+
# Load config files in the "/etc/httpd/conf.d" directory, if any.
|
296
|
+
IncludeOptional conf.d/*.conf
|
297
|
+
|
298
|
+
ServerTokens ProductOnly
|
299
|
+
Header always set x-content-type-options nosniff
|
300
|
+
Header always set x-ua-compatible IE=edge
|
301
|
+
|
302
|
+
```
|