Is it possible to setup an apache web site on mycloud on another port (Iet the UI intact 80)
I am newbie on linux
I read from google about a Virtual Host
Thanks you in advance.
Is it possible to setup an apache web site on mycloud on another port (Iet the UI intact 80)
I am newbie on linux
I read from google about a Virtual Host
Thanks you in advance.
Hello,
It might be possible, but any software modifications are not supported by WD. You might get some help from other Community users
I have configured default site (UI) on 80/443 and own virtual host on port 80 but on other domain (different servername).
I had to make some changes in conf.d/additional-httpd.conf and create some new includes.
Will post my apache2 config files tomorrow.
Configuration for multiple domains on the same IP (name-based virtualhosts). You can easily change it to ip-based or port-based configuration.
file /etc/apache2/conf.d/additional-httpd.conf :
<VirtualHost _default_:80>
# include original site config
Include ${SERVER_ROOT}/conf.d/common.inc
# Include the virtual host configurations:
IncludeOptional ${SERVER_ROOT}/sites-enabled/*.conf
</VirtualHost>
# include definition of your own virtualhost
Include ${SERVER_ROOT}/conf.d/mysite.mydomain.vhost
## SSL
<VirtualHost _default_:443>
# include original site config
Include ${SERVER_ROOT}/conf.d/common.inc
<IfModule mod_ssl.c>
SSLEngine on
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
IncludeOptional /etc/nas/apache2/server-name.conf
</IfModule>
# Enable "sites" on https port
IncludeOptional ${SERVER_ROOT}/sites-enabled/*.conf
</VirtualHost>
file /etc/apache2/conf.d/common.inc :
# common part of original WD My Cloud configuration - do not change
# Document root will point to /var/www/htdocs
DocumentRoot ${DOCUMENT_ROOT}
ServerAdmin webmaster@localhost
## define default language
<IfModule mod_mime.c>
DefaultLanguage en
</IfModule>
########
# 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
</FilesMatch>
</Directory>
# "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
###########
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory ${DOCUMENT_ROOT}>
Options +FollowSymLinks +MultiViews -Indexes
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
file /etc/apache2/conf.d/mysite.mydomain.vhost :
<VirtualHost *:80>
ServerAdmin webmaster@localhost
# replace /var/www/homepage with path to your files
DocumentRoot /var/www/homepage
# Replace mysite.mydomain with your own domain name
ServerName mysite.mydomain
# change path and optionaly customize for your own needs
<Directory /var/www/homepage>
AllowOverride none
Options +MultiViews +IncludesNoExec +FollowSymLinks -Indexes
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
# replace if you wish path and filename
ErrorLog ${APACHE_LOG_DIR}/MySite-error.log
CustomLog ${APACHE_LOG_DIR}/MySite-access.log combined
</VirtualHost>
Depends on your local bandwidth - I have only 1Mbps outgoing speed but for small, not overloaded with images site it is quite enough.