Skip to content

Commit 4f040b1

Browse files
author
Septiyadi
committed
Set Directory Root Apache2 Web Server
7 April 2018
1 parent 3783948 commit 4f040b1

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

README.md

100644100755
File mode changed.

config/set-root-werserver

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<mxfile userAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" version="8.5.3" editor="www.draw.io" type="device"><diagram id="5451542e-f0b9-0cae-d5ed-c286b578744e" name="Page-1">7VpLk+I2EP41HHH5DRwHGJLDJjVVs1W7e9oStrCVsS1HljHk16clyzZ+MFDDY3cTOIDVbr26v259bTOyFvHuN4bS8A/q42hk6v5uZC1HpmlObRd+hGRfSgzTUpKAEV/JGsEr+Qcroa6kOfFx1lLklEacpG2hR5MEe7wlQ4zRoq22oVF71hQFaka9Ebx6KMI9tS/E52EpnToH2r9jEoTVzIau7qyR9xYwmidqvoQmuLwTo2oYpZqFyKfFgch6HlkLRikvr+LdAkfCrpXFyn6rI3frJTOc8HM6TNUy+L7aNfbBCKpJGQ9pQBMUPTfSuZezLRb9DWjIbcqWDq2Qx5G64aMsrLUyjhh/Ej4BgTSHkq1IFKm+OPErjXVEvbfPIUlKsVISA/2FOd8rqKCcUxA1i/xEaVpPyOgbXtCIMrktS9dd17LqO5VDhWRDE75CMYkEUBc0ZwQzsMmfuFA31XzCO7LdGlZ8QF7aURjvqCeUKIMZPKVlKlgjFmClNalRAJGFaYw524MKwxHiZNseHSmEB7Ve42q4UN4e9ryaeouiXA3ag8IWM04gHj6hNY5eaEY4oYlwD+WcxrBplKVl4G3ITvj60P9V56eIBKITF77p+EUhgeY8IglIqzgWBoXISMU64l0g8ovmEc7ITivw+nuGAYDQfx6Jhc3raOsMuwHYtFy1gM+1/I3Utjxwr1yLMifsGu/eh0DfuaqDq5KCSphVjiia5DOzS1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server.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Backup Original file : /etc/apache2/sites-available/000-default.conf
2+
<VirtualHost *:80>
3+
# The ServerName directive sets the request scheme, hostname and port that
4+
# the server uses to identify itself. This is used when creating
5+
# redirection URLs. In the context of virtual hosts, the ServerName
6+
# specifies what hostname must appear in the request's Host: header to
7+
# match this virtual host. For the default virtual host (this file) this
8+
# value is not decisive as it is used as a last resort host regardless.
9+
# However, you must set it for any further virtual host explicitly.
10+
#ServerName www.example.com
11+
12+
ServerAdmin webmaster@localhost
13+
DocumentRoot /var/www/html
14+
15+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
16+
# error, crit, alert, emerg.
17+
# It is also possible to configure the loglevel for particular
18+
# modules, e.g.
19+
#LogLevel info ssl:warn
20+
21+
ErrorLog ${APACHE_LOG_DIR}/error.log
22+
CustomLog ${APACHE_LOG_DIR}/access.log combined
23+
24+
# For most configuration files from conf-available/, which are
25+
# enabled or disabled at a global level, it is possible to
26+
# include a line for only one particular virtual host. For example the
27+
# following line enables the CGI configuration for this host only
28+
# after it has been globally disabled with "a2disconf".
29+
#Include conf-available/serve-cgi-bin.conf
30+
</VirtualHost>
31+
32+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
33+
34+
# Backup Original file : /etc/apache2/sites-available/default-ssl.conf
35+
<IfModule mod_ssl.c>
36+
<VirtualHost _default_:443>
37+
ServerAdmin webmaster@localhost
38+
39+
DocumentRoot /var/www/html
40+
41+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
42+
# error, crit, alert, emerg.
43+
# It is also possible to configure the loglevel for particular
44+
# modules, e.g.
45+
#LogLevel info ssl:warn
46+
...............................................................etc
47+
48+
## Config 2 File default-ssl.conf (For Default SSL) & 000-default.conf (Default Folder)
49+
### /etc/apache2/sites-available/000-default.conf
50+
<VirtualHost *:80>
51+
# The ServerName directive sets the request scheme, hostname and port that
52+
# the server uses to identify itself. This is used when creating
53+
# redirection URLs. In the context of virtual hosts, the ServerName
54+
# specifies what hostname must appear in the request's Host: header to
55+
# match this virtual host. For the default virtual host (this file) this
56+
# value is not decisive as it is used as a last resort host regardless.
57+
# However, you must set it for any further virtual host explicitly.
58+
#ServerName www.example.com
59+
60+
ServerAdmin webmaster@localhost
61+
DocumentRoot /media/command/dataD/server.local
62+
63+
<Directory /media/command/dataD/server.local>
64+
Options Indexes FollowSymLinks
65+
AllowOverride None
66+
Require all granted
67+
68+
</Directory>
69+
70+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
71+
# error, crit, alert, emerg.
72+
# It is also possible to configure the loglevel for particular
73+
# modules, e.g.
74+
#LogLevel info ssl:warn
75+
76+
ErrorLog ${APACHE_LOG_DIR}/error.log
77+
CustomLog ${APACHE_LOG_DIR}/access.log combined
78+
79+
# For most configuration files from conf-available/, which are
80+
# enabled or disabled at a global level, it is possible to
81+
# include a line for only one particular virtual host. For example the
82+
# following line enables the CGI configuration for this host only
83+
# after it has been globally disabled with "a2disconf".
84+
#Include conf-available/serve-cgi-bin.conf
85+
</VirtualHost>
86+
87+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
88+
89+
### /etc/apache2/sites-available/default.conf
90+
<IfModule mod_ssl.c>
91+
<VirtualHost _default_:443>
92+
ServerAdmin webmaster@localhost
93+
94+
DocumentRoot /media/command/dataD/server.local
95+
96+
<Directory /media/command/dataD/server.local>
97+
Options Indexes FollowSymLinks
98+
AllowOverride None
99+
Require all granted
100+
</Directory>
101+
102+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
103+
# error, crit, alert, emerg.
104+
# It is also possible to configure the loglevel for particular
105+
# modules, e.g.
106+
#LogLevel info ssl:warn
107+
108+
ErrorLog ${APACHE_LOG_DIR}/error.log
109+
CustomLog ${APACHE_LOG_DIR}/access.log combined
110+
111+
# For most configuration files from conf-available/, which are
112+
# enabled or disabled at a global level, it is possible to
113+
# include a line for only one particular virtual host. For example the
114+
# following line enables the CGI configuration for this host only
115+
# after it has been globally disabled with "a2disconf".
116+
#Include conf-available/serve-cgi-bin.conf
117+
...............................................................etc
118+
119+
CTRL + X -> Y -> Enter (For Save)
120+
121+
```shell
122+
command@army:~$ sudo /etc/init.d/apache2 restart
123+
[ ok ] Restarting apache2 (via systemctl): apache2.service.
124+
```

0 commit comments

Comments
 (0)