|
| 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