質問編集履歴
10
コード追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,11 +9,236 @@
|
|
9
9
|
■やったこと
|
10
10
|
httpd.confに記載した内容です。
|
11
11
|
```ここに言語を入力
|
12
|
+
~中略~
|
13
|
+
# least PidFile.
|
14
|
+
#
|
15
|
+
ServerRoot "/etc/httpd"
|
16
|
+
|
17
|
+
~中略~
|
18
|
+
#Listen 12.34.56.78:80
|
19
|
+
Listen 80
|
20
|
+
|
21
|
+
~中略~
|
22
|
+
#
|
23
|
+
Include conf.modules.d/*.conf
|
24
|
+
|
25
|
+
~中略~
|
26
|
+
#
|
27
|
+
User apache
|
28
|
+
Group apache
|
29
|
+
|
30
|
+
~中略~
|
31
|
+
# as error documents. e.g. admin@your-domain.com
|
32
|
+
#
|
33
|
+
ServerAdmin root@localhost
|
34
|
+
|
35
|
+
~中略~
|
36
|
+
#ServerName www.example.com:80
|
37
|
+
|
38
|
+
#
|
39
|
+
# Deny access to the entirety of your server's filesystem. You must
|
40
|
+
# explicitly permit access to web content directories in other
|
41
|
+
# <Directory> blocks below.
|
42
|
+
#
|
43
|
+
<Directory />
|
44
|
+
AllowOverride none
|
45
|
+
Require all denied
|
46
|
+
</Directory>
|
47
|
+
|
48
|
+
~中略~
|
49
|
+
#
|
50
|
+
#DocumentRoot "/var/www/html"
|
51
|
+
|
52
|
+
#
|
53
|
+
# Relax access to content within /var/www.
|
54
|
+
#
|
55
|
+
<Directory "/var/www">
|
56
|
+
AllowOverride All
|
57
|
+
# Allow open access:
|
58
|
+
Require all granted
|
59
|
+
</Directory>
|
60
|
+
|
61
|
+
|
12
62
|
<VirtualHost *:80>
|
13
63
|
DocumentRoot /var/www/html/hogehoge
|
14
64
|
ServerName hogehoge.com
|
15
65
|
</VirtualHost>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
# Further relax access to the default document root:
|
70
|
+
|
16
|
-
|
71
|
+
<Directory "/var/www/html">
|
72
|
+
# or any combination of:
|
73
|
+
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
|
74
|
+
#
|
75
|
+
# Note that "MultiViews" must be named *explicitly* --- "Options All"
|
76
|
+
# doesn't give it to you.
|
77
|
+
#
|
78
|
+
# The Options directive is both complicated and important. Please see
|
79
|
+
# http://httpd.apache.org/docs/2.4/mod/core.html#options
|
80
|
+
# for more information.
|
81
|
+
#
|
82
|
+
Options Indexes FollowSymLinks
|
83
|
+
|
84
|
+
#
|
85
|
+
# AllowOverride controls what directives may be placed in .htaccess files.
|
86
|
+
# It can be "All", "None", or any combination of the keywords:
|
87
|
+
# Options FileInfo AuthConfig Limit
|
88
|
+
#
|
89
|
+
AllowOverride All
|
90
|
+
|
91
|
+
#
|
92
|
+
# Controls who can get stuff from this server.
|
93
|
+
#
|
94
|
+
Require all granted
|
95
|
+
</Directory>
|
96
|
+
|
97
|
+
#
|
98
|
+
# DirectoryIndex: sets the file that Apache will serve if a directory
|
99
|
+
# is requested.
|
100
|
+
#
|
101
|
+
<IfModule dir_module>
|
102
|
+
DirectoryIndex index.html
|
103
|
+
</IfModule>
|
104
|
+
|
105
|
+
#
|
106
|
+
# The following lines prevent .htaccess and .htpasswd files from being
|
107
|
+
# viewed by Web clients.
|
108
|
+
#
|
109
|
+
<Files ".ht*">
|
110
|
+
Require all denied
|
111
|
+
#
|
112
|
+
# ErrorLog: The location of the error log file.
|
113
|
+
# If you do not specify an ErrorLog directive within a <VirtualHost>
|
114
|
+
# container, error messages relating to that virtual host will be
|
115
|
+
#
|
116
|
+
ErrorLog "logs/error_log"
|
117
|
+
|
118
|
+
#
|
119
|
+
# LogLevel: Control the number of messages logged to the error_log.
|
120
|
+
# Possible values include: debug, info, notice, warn, error, crit,
|
121
|
+
# alert, emerg.
|
122
|
+
#
|
123
|
+
LogLevel warn
|
124
|
+
|
125
|
+
<IfModule log_config_module>
|
126
|
+
#
|
127
|
+
# The following directives define some format nicknames for use with
|
128
|
+
# a CustomLog directive (see below).
|
129
|
+
#
|
130
|
+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
131
|
+
|
132
|
+
<IfModule logio_module>
|
133
|
+
# You need to enable mod_logio.c to use %I and %O
|
134
|
+
</IfModule>
|
135
|
+
|
136
|
+
#
|
137
|
+
# The location and format of the access logfile (Common Logfile Format).
|
138
|
+
# If you do not define any access logfiles within a <VirtualHost>
|
139
|
+
# container, they will be logged here. Contrariwise, if you *do*
|
140
|
+
# define per-<VirtualHost> access logfiles, transactions will be
|
141
|
+
# logged therein and *not* in this file.
|
142
|
+
#
|
143
|
+
#CustomLog "logs/access_log" common
|
144
|
+
|
145
|
+
#
|
146
|
+
# If you prefer a logfile with access, agent, and referer information
|
147
|
+
# (Combined Logfile Format) you can use the following directive.
|
148
|
+
#
|
149
|
+
CustomLog "logs/access_log" combined
|
150
|
+
</IfModule>
|
151
|
+
|
152
|
+
<IfModule alias_module>
|
153
|
+
~中略~
|
154
|
+
#
|
155
|
+
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
|
156
|
+
|
157
|
+
</IfModule>
|
158
|
+
|
159
|
+
#
|
160
|
+
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
|
161
|
+
# CGI directory exists, if you have that configured.
|
162
|
+
#
|
163
|
+
<Directory "/var/www/cgi-bin">
|
164
|
+
AllowOverride None
|
165
|
+
Options None
|
166
|
+
Require all granted
|
167
|
+
</Directory>
|
168
|
+
|
169
|
+
<IfModule mime_module>
|
170
|
+
#
|
171
|
+
# TypesConfig points to the file containing the list of mappings from
|
172
|
+
# filename extension to MIME-type.
|
173
|
+
#
|
174
|
+
TypesConfig /etc/mime.types
|
175
|
+
|
176
|
+
~中略~
|
177
|
+
AddType application/x-compress .Z
|
178
|
+
AddType application/x-gzip .gz .tgz
|
179
|
+
|
180
|
+
~中略~
|
181
|
+
AddType text/html .shtml
|
182
|
+
AddOutputFilter INCLUDES .shtml
|
183
|
+
</IfModule>
|
184
|
+
|
185
|
+
~中略~
|
186
|
+
AddDefaultCharset UTF-8
|
187
|
+
|
188
|
+
<IfModule mime_magic_module>
|
189
|
+
#
|
190
|
+
# The mod_mime_magic module allows the server to use various hints from the
|
191
|
+
# contents of the file itself to determine its type. The MIMEMagicFile
|
192
|
+
# directive tells the module where the hint definitions are located.
|
193
|
+
#
|
194
|
+
MIMEMagicFile conf/magic
|
195
|
+
</IfModule>
|
196
|
+
|
197
|
+
~中略~
|
198
|
+
# (You will also need to add "Includes" to the "Options" directive.)
|
199
|
+
#
|
200
|
+
AddType text/html .shtml
|
201
|
+
AddOutputFilter INCLUDES .shtml
|
202
|
+
</IfModule>
|
203
|
+
|
204
|
+
#
|
205
|
+
# Specify a default charset for all content served; this enables
|
206
|
+
# interpretation of all content as UTF-8 by default. To use the
|
207
|
+
# default browser choice (ISO-8859-1), or to allow the META tags
|
208
|
+
# in HTML content to override this choice, comment out this
|
209
|
+
# directive:
|
210
|
+
#
|
211
|
+
AddDefaultCharset UTF-8
|
212
|
+
|
213
|
+
<IfModule mime_magic_module>
|
214
|
+
#
|
215
|
+
# The mod_mime_magic module allows the server to use various hints from the
|
216
|
+
# contents of the file itself to determine its type. The MIMEMagicFile
|
217
|
+
# directive tells the module where the hint definitions are located.
|
218
|
+
#
|
219
|
+
MIMEMagicFile conf/magic
|
220
|
+
</IfModule>
|
221
|
+
|
222
|
+
#
|
223
|
+
# Customizable error responses come in three flavors:
|
224
|
+
# 1) plain text 2) local redirects 3) external redirects
|
225
|
+
#
|
226
|
+
# Some examples:
|
227
|
+
#ErrorDocument 500 "The server made a boo boo."
|
228
|
+
#ErrorDocument 404 /missing.html
|
229
|
+
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
|
230
|
+
#ErrorDocument 402 http://www.example.com/subscription_info.html
|
231
|
+
#
|
232
|
+
|
233
|
+
~中略~
|
234
|
+
#EnableMMAP off
|
235
|
+
EnableSendfile on
|
236
|
+
|
237
|
+
# Supplemental configuration
|
238
|
+
#
|
239
|
+
# Load config files in the "/etc/httpd/conf.d" directory, if any.
|
240
|
+
IncludeOptional conf.d/*.conf
|
241
|
+
|
17
242
|
```
|
18
243
|
|
19
244
|
|
9
文言
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
Apache/2.4.6 (CentOS)
|
8
8
|
|
9
9
|
■やったこと
|
10
|
-
|
10
|
+
httpd.confに記載した内容です。
|
11
11
|
```ここに言語を入力
|
12
12
|
<VirtualHost *:80>
|
13
13
|
DocumentRoot /var/www/html/hogehoge
|
8
文言変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,31 +8,15 @@
|
|
8
8
|
|
9
9
|
■やったこと
|
10
10
|
|
11
|
-
httpd.confに下記を追加
|
12
11
|
```ここに言語を入力
|
13
|
-
NameVirtualHost *:10022
|
14
|
-
|
15
|
-
<VirtualHost *:
|
12
|
+
<VirtualHost *:80>
|
16
|
-
|
17
13
|
DocumentRoot /var/www/html/hogehoge
|
18
|
-
|
19
14
|
ServerName hogehoge.com
|
20
|
-
|
21
|
-
ServerAlias www.hogehoge.com
|
22
|
-
|
23
|
-
<Directory "/var/www/html/hogehoge">
|
24
|
-
|
25
|
-
AllowOverride All
|
26
|
-
|
27
|
-
</Directory>
|
28
|
-
|
29
15
|
</VirtualHost>
|
30
|
-
```
|
31
|
-
・コメントアウト
|
32
|
-
```ここに言語を入力
|
33
16
|
#DocumentRoot "/var/www/html"
|
34
17
|
```
|
35
18
|
|
19
|
+
|
36
20
|
■その他
|
37
21
|
関係ないかもですが、/var/www/html/hogehoge/.htaccessファイルの
|
38
22
|
コードです。
|
7
文言追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
■したいこと
|
4
4
|
hogehoge.comでサイトを表示させたい。
|
5
5
|
|
6
|
+
■apacheのversion
|
7
|
+
Apache/2.4.6 (CentOS)
|
6
8
|
|
7
9
|
■やったこと
|
8
10
|
|
6
syusei
title
CHANGED
File without changes
|
body
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
RewriteRule ^index\.php$ - [L]
|
44
44
|
RewriteCond %{REQUEST_FILENAME} !-f
|
45
45
|
RewriteCond %{REQUEST_FILENAME} !-d
|
46
|
-
RewriteRule . /
|
46
|
+
RewriteRule . /hogehoge/index.php [L]
|
47
47
|
</IfModule>
|
48
48
|
|
49
49
|
# END WordPress
|
5
文言変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -27,8 +27,28 @@
|
|
27
27
|
</VirtualHost>
|
28
28
|
```
|
29
29
|
・コメントアウト
|
30
|
+
```ここに言語を入力
|
30
31
|
#DocumentRoot "/var/www/html"
|
32
|
+
```
|
31
33
|
|
34
|
+
■その他
|
35
|
+
関係ないかもですが、/var/www/html/hogehoge/.htaccessファイルの
|
36
|
+
コードです。
|
37
|
+
|
38
|
+
```ここに言語を入力
|
39
|
+
# BEGIN WordPress
|
40
|
+
<IfModule mod_rewrite.c>
|
41
|
+
RewriteEngine On
|
42
|
+
RewriteBase /hogehoge/
|
43
|
+
RewriteRule ^index\.php$ - [L]
|
44
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
45
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
46
|
+
RewriteRule . /akkin01/index.php [L]
|
47
|
+
</IfModule>
|
48
|
+
|
49
|
+
# END WordPress
|
50
|
+
|
51
|
+
```
|
32
52
|
■現状
|
33
53
|
DocumentRoot /var/www/html/hogehogeとしているのに
|
34
54
|
hogehoge.com/hogehogeとアクセスしないと表示されない。
|
4
追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -26,6 +26,8 @@
|
|
26
26
|
|
27
27
|
</VirtualHost>
|
28
28
|
```
|
29
|
+
・コメントアウト
|
30
|
+
#DocumentRoot "/var/www/html"
|
29
31
|
|
30
32
|
■現状
|
31
33
|
DocumentRoot /var/www/html/hogehogeとしているのに
|
3
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -38,4 +38,26 @@
|
|
38
38
|
|
39
39
|
[http://www.xn--vps-073b3a72a.com/9.html](http://www.xn--vps-073b3a72a.com/9.html)
|
40
40
|
|
41
|
+
|
42
|
+
■httpd -Sで確認した実行結果
|
43
|
+
VirtualHost configuration:
|
44
|
+
```ここに言語を入力
|
45
|
+
*:80 hogehoge.com (/etc/httpd/conf/httpd.conf:131)
|
46
|
+
ServerRoot: "/etc/httpd"
|
47
|
+
Main DocumentRoot: "/var/www/html"
|
48
|
+
Main ErrorLog: "/etc/httpd/logs/error_log"
|
49
|
+
Mutex authdigest-opaque: using_defaults
|
50
|
+
Mutex proxy-balancer-shm: using_defaults
|
51
|
+
Mutex rewrite-map: using_defaults
|
52
|
+
Mutex authdigest-client: using_defaults
|
53
|
+
Mutex proxy: using_defaults
|
54
|
+
Mutex authn-socache: using_defaults
|
55
|
+
Mutex default: dir="/run/httpd/" mechanism=default
|
56
|
+
Mutex mpm-accept: using_defaults
|
57
|
+
PidFile: "/run/httpd/httpd.pid"
|
58
|
+
Define: DUMP_VHOSTS
|
59
|
+
Define: DUMP_RUN_CFG
|
60
|
+
```
|
61
|
+
|
62
|
+
|
41
63
|
どうすればhogehoge.comで表示できるのかご教示頂ければありがたいです。
|
2
リンクにした
title
CHANGED
File without changes
|
body
CHANGED
@@ -36,6 +36,6 @@
|
|
36
36
|
|
37
37
|
■参考にしたサイト
|
38
38
|
|
39
|
-
http://www.xn--vps-073b3a72a.com/9.html
|
39
|
+
[http://www.xn--vps-073b3a72a.com/9.html](http://www.xn--vps-073b3a72a.com/9.html)
|
40
40
|
|
41
41
|
どうすればhogehoge.comで表示できるのかご教示頂ければありがたいです。
|
1
サイトを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -34,4 +34,8 @@
|
|
34
34
|
hogehoge.comではhtmlディレクトリにあるindex.htmlに向いてしまう。
|
35
35
|
同階層にhogehogeディレクトリがある状態です。
|
36
36
|
|
37
|
+
■参考にしたサイト
|
38
|
+
|
39
|
+
http://www.xn--vps-073b3a72a.com/9.html
|
40
|
+
|
37
41
|
どうすればhogehoge.comで表示できるのかご教示頂ければありがたいです。
|