Thanks for the answer. I’m fine with WD’s firmware at the moment, it does everything I expect from a NAS and I don’t see which benefits I could get from OMV.
Here are the config files:
Apache2.conf loads:
IncludeOptional ${SERVER_ROOT}/conf.d/*.conf
in this folder, we have
additional-httpd.conf
Document root will point to /var/www/htdocs
DocumentRoot ${DOCUMENT_ROOT}
ServerAdmin webmaster@localhost
ServerName localhost
define default language
<IfModule mod_mime.c>
DefaultLanguage en
AddLanguage en-us .en
AddLanguage fr-fr .fr
AddLanguage it-IT .it
AddLanguage de-DE .de
AddLanguage es-ES .es
AddLanguage zh-TW .zht
AddLanguage zh-HK .zhk
AddLanguage ja-JP .ja
AddLanguage ko-KR .ko
AddLanguage ru-RU .ru
AddLanguage pt-BR .pt
########
TODO: Need to figure out where to handle this: who’s in charge of the default error pages?
###############
Enabling server-side includes for error pages.
<Directory ${DOCUMENT_ROOT}>
AllowOverride none
Options MultiViews IncludesNoExec FollowSymLinks
AddType text/html .shtml
<FilesMatch “.shtml[.$]”> # Limit the scope of this directory directive to only .shtml files
SetOutputFilter INCLUDES
“400 Bad Request”,
ErrorDocument 400 ${DOCUMENT_ROOT}/errordocs/400/400
“401 Authorization Required”,
ErrorDocument 401 ${DOCUMENT_ROOT}/errordocs/401/401
“403 Forbidden”,
ErrorDocument 403 ${DOCUMENT_ROOT}/errordocs/403/403
“404 Not Found”,
ErrorDocument 404 ${DOCUMENT_ROOT}/errordocs/404/404
“500 Internal Server Error”,
ErrorDocument 500 ${DOCUMENT_ROOT}/errordocs/500/500
###########
Options FollowSymLinks
AllowOverride None
<Directory ${DOCUMENT_ROOT}>
Options +FollowSymLinks +MultiViews -Indexes
AllowOverride All
Require all granted
ErrorLog ${APACHE_LOG_DIR}/error.log
Include the virtual host configurations:
IncludeOptional ${SERVER_ROOT}/sites-enabled/*.conf
SSL
<VirtualHost *:443>
<IfModule mod_ssl.c>
SSLEngine on
<FilesMatch “.(cgi|shtml|phtml|php)$”>
SSLOptions +StdEnvVars
BrowserMatch “.*MSIE.*” \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
IncludeOptional /etc/nas/apache2/server-name.conf
# Enable “sites” on https port
IncludeOptional ${SERVER_ROOT}/sites-enabled/*.conf
In sites-enabled , we have
wdnas-rest-api.conf
SetEnv __ADMIN_API_ROOT ${REST_API_ROOT}
LogLevel error
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/api/([0-9.]+)/rest/(.*) /api/rest/index.php [L]
<IfModule mod_rewrite.c>
# configure landing page for webdav applet
RewriteRule ^/LandingPage /mapdrive/securityCheck.php [L]
####################
WebDav extension
####################
<Ifmodule dav_module>
Include /etc/nas/apache2/auth/alias.inc
Include /etc/nas/apache2/auth/require.inc
<IfModule mod_ssl.c>
# Rest API certificate files.
SSLCertificateFile /var/www/rest-api/config/server.crt
SSLCertificateKeyFile /var/www/rest-api/config/server.key
wdnas-ui.conf
<IfModule mod_rewrite.c>
<Directory “${DOCUMENT_ROOT}/UI”>
${LOCAL_NET}
RewriteEngine On
RewriteBase /UI/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /UI/ [R]
As you can see, additional-httpd.conf is slighly different from the file posted in the thread I’ve linked to above. When I try to add a website adding a new file in sites-enabled like I’d do on a regular Debian running Apache, I get the virtualhost within virtualhost error. I’m pretty sure that’s caused by the additional-httpd.conf but I can’t figure out why.
Merry xmas guys