NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
devbobo
Nov 29, 2009Aspirant
HOW TO: Hosting multiple websites
G'day Guys,
For some time I've wanted to host multiple websites from a single ReadyNAS unit...I haven't had the time to investigate it.
1. Backup all the .conf files in /etc/frontview/apache
2. Backup all the .conf files in /etc/frontview/apache - so you can restore the originals if you screw something up !!!
3. Edit /etc/frontview/apache/Virtual.conf
Original file
Modified file
4. Create a new my-virtual.conf file in /etc/frontview/apache/addons, this way it will be auto loaded without modifying any other files. The example below has definitions for two websites....add/remove as required.
my-virtual.conf
5. shutdown apache, killall apache-ssl
6. restart apache, apache-ssl -f /etc/frontview/apache/httpd.conf
7. All done :D
CAVEATS
1. Toggling the state of HTTP within Frontview rewrites Virtual.conf so the above changes will be lost.
ReadyNAS Team
1. It would be nice if the above changes could be made to the format of /etc/frontview/apache/Virtual.conf, so that changes aren't overwritten
2. I currently have to add the Location element to undo a global definition within httpd.conf. It would be awesome if this was removed from httpd.conf and added to Virtual.conf as...
Cheers,
David
For some time I've wanted to host multiple websites from a single ReadyNAS unit...I haven't had the time to investigate it.
1. Backup all the .conf files in /etc/frontview/apache
2. Backup all the .conf files in /etc/frontview/apache - so you can restore the originals if you screw something up !!!
3. Edit /etc/frontview/apache/Virtual.conf
Original file
<VirtualHost _default_:80>
SSLEngine off
RewriteEngine on
RewriteRule ^/admin/(.*)$ https://%{SERVER_NAME}/admin/$1 [R,L]
</VirtualHost>
Modified file
NameVirtualHost *:80
<VirtualHost *:80>
SSLEngine off
RewriteEngine on
RewriteRule ^/admin/(.*)$ https://%{SERVER_NAME}/admin/$1 [R,L]
</VirtualHost>
4. Create a new my-virtual.conf file in /etc/frontview/apache/addons, this way it will be auto loaded without modifying any other files. The example below has definitions for two websites....add/remove as required.
my-virtual.conf
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /path/to/example.com
<Directory /path/to/example.com>
Options Indexes
Order allow,deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost>
<VirtualHost *:80>
ServerName www.domain.net
DocumentRoot /path/to/domain.net
<Directory /path/to/domain.net>
Options Indexes
Order allow,deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost>
5. shutdown apache, killall apache-ssl
6. restart apache, apache-ssl -f /etc/frontview/apache/httpd.conf
7. All done :D
CAVEATS
1. Toggling the state of HTTP within Frontview rewrites Virtual.conf so the above changes will be lost.
ReadyNAS Team
1. It would be nice if the above changes could be made to the format of /etc/frontview/apache/Virtual.conf, so that changes aren't overwritten
2. I currently have to add the Location element to undo a global definition within httpd.conf. It would be awesome if this was removed from httpd.conf and added to Virtual.conf as...
NameVirtualHost *:80
<VirtualHost *:80>
<Location /index.html>
SetHandler server-status
Order Deny,Allow
Deny from all
</Location>
SSLEngine off
RewriteEngine on
RewriteRule ^/admin/(.*)$ https://%{SERVER_NAME}/admin/$1 [R,L]
</VirtualHost>
Cheers,
David
129 Replies
Replies have been turned off for this discussion
- Avon_FoxAspirantMultiple websites not working with removal of www from the URL.
I've got my RNPD200U set up with Virtual.conf and my-virtual.conf as shown below and it works fine for the 'www.the-liberator.net' URL but the 'the-liberator.net' URL fails. I've removed the DNS entry to the latter as it was confusing Google's indexing but I'd like to get it to work.
I had DNS A record set up for both www.the-liberator.net and the-liberator.net which worked fine on my old Windows web server but with the .conf files set as below it fails to work with for the www-less URL.
Any ideas greatly welcome. I can set up the A record again if anyone wants to test anything.
Cheers folks!
Virtual.conf
NameVirtualHost *:80
<VirtualHost *:80>
SSLEngine off
RewriteEngine on
RewriteRule ^/admin/(.*)$ https://%{SERVER_NAME}/admin/$1 [R,L]
</VirtualHost>
my-virtual.conf
<VirtualHost *:80>
ServerName www.the-liberator.net
DocumentRoot /c/web
<Directory /c/web>
Options Indexes
Order allow,deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost>
<VirtualHost *:80>
ServerName the-liberator.net
DocumentRoot /c/web
<Directory /c/web>
Options Indexes
Order allow,deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost> - WhoCares_MentorWhy don't you just remove the second <VirtualHost>...</VirtualHost> section and add a 'ServerAlias the-liberator.net' statement to the first?
-Stefan - Avon_FoxAspirant
Why don't you just remove the second <VirtualHost>...</VirtualHost> section and add a 'ServerAlias the-liberator.net' statement to the first?
Because I have much to learn. :wink: Thanks for the advice. My my-virtual.conf now looks like this (below).
I've re-added the A record to the-liberator.net to my DNS hosting service (I needed to do that right?) and am now waiting for DNS to update so I can test it.
I'll report back in a day and see how we went!
Thanks very much for your suggestion!
<VirtualHost *:80>
ServerName http://www.the-liberator.net
ServerAlias the-liberator.net
DocumentRoot /c/web
<Directory /c/web>
Options Indexes
Order allow,deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost> - Avon_FoxAspirantTHANK YOU very much for your help. Now that DNS has updated and with the ServerAlias entry in my-virtual.conf it's resolving perfectly!
Very, very happy! - WhoCares_MentorGlad I could be of help.
-Stefan - Avon_FoxAspirantI do still have the problem above the last where indexes are not being created with mod_autoindex for directories in the /c/web/ directory.
They are generated fine for any shares that have HTTP enabled via Frontview but not through the method described in this topic.
Does anyone know which files and settings govern which folders mod_autoindex is applied to? - ericclaerenAspirantHi,
Hopefully someone can help me, i'm stuck and have quite some regrets buying a ReadyNas Pro.
Got the Virtualhost working through this topic, thanks!
But ran into this problem. Images aren't shown on my site(s). I have a virtual site, call it example. It's in this dir /c/www/example
In my document root is a directory called /images, when I check the error.log file it says:
[Fri Feb 24 17:13:59 2012] [error] [client 192.168.1.4] File does not exist: /frontview/ui/resource/images/menu, referer: http://example.site/
It seems it rewrites the image folder of my current example site to /frontview/ui/resource/images
When looking at http.conf
Alias /images/ /frontview/ui/resource/images/
<Directory /images>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /theme/ /frontview/ui/resource/theme/
<Directory /theme>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /js/ /frontview/ui/resource/js/
<Directory /js>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /language/ /frontview/ui/resource/language/
<Directory /language>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /addons/ /etc/frontview/addons/ui/
<Directory /addons>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /html/ /frontview/ui/resource/html/
<Directory /html>
Options MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /admin /frontview/ui/resource/html
<Location /admin>
DirectoryIndex index.html
Options ExecCGI
Include /etc/frontview/apache/Auth.conf
AuthName "Control Panel"
require user admin
</Location>
There are a number of default aliasses set to a location, how can I override these? Admin and Images are quite often used directories.
My virtual host file
<VirtualHost *:80>
ServerName www.example.site
ServerAlias example.site
DocumentRoot /www/example
<Directory /www/example>
Options +Indexes +MultiViews +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost>
Really hope somebody has an Idea how this can be fixed.
Thanks!! - WhoCares_MentorHave a look at my repository at Gitorious: http://gitorious.org/readynas
In the apache-config section you should find some hints.
-Stefan - Avon_FoxAspirantThanks again Stefan. I'll have a look. I see now you've posted this above too. No idea how I missed it the first time!
I think it's probably beyond my level of experience to work it out but if I do I'll post back the results. - ericclaerenAspirantHi Stefan,
Thanks, I tried your apache Frontview version, but unfortunately they did not work for me, could not get apache running, Tried to move some parts around, but I'm not comfortable with that and didn't got it working.
Really thought when buying this NAS running a web server would be a piece of cake, just like a regular linux apache2 setup. So disappointed with this machine.
I can't understand why the developers of the ReadyNas did not separate the frontview interface from the apache setup like a regular site. Would have made things so much easier.
Thanks
These were the errors i got:
[Sun Feb 26 23:00:37 2012] [warn] module php5_module is already loaded, skipping
nas-eric:/etc/frontview/apache/addons# tail /var/log/frontview/error.log
[Sun Feb 26 22:48:01 2012] [error] Can't locate Frontview.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/ share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /frontview/ui/resource/html) at (eval 2) line 3.\n
[Sun Feb 26 22:48:01 2012] [error] Can't load Perl module Frontview for server localhost:80, exiting...
[Sun Feb 26 22:49:09 2012] [error] Can't locate Frontview.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/ share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /frontview/ui/resource/html) at (eval 2) line 3.\n
[Sun Feb 26 22:49:09 2012] [error] Can't load Perl module Frontview for server localhost:443, exiting...
[Sun Feb 26 22:53:33 2012] [error] Can't locate Frontview.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/ share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /frontview/ui/resource/html) at (eval 2) line 3.\n
[Sun Feb 26 22:53:33 2012] [error] Can't load Perl module Frontview for server localhost:443, exiting...
[Sun Feb 26 22:54:21 2012] [error] Can't locate Frontview.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/ share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /frontview/ui/resource/html) at (eval 2) line 3.\n
[Sun Feb 26 22:54:21 2012] [error] Can't load Perl module Frontview for server localhost:443, exiting...
[Sun Feb 26 23:00:37 2012] [error] Can't locate Frontview.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/ share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /frontview/ui/resource/html) at (eval 2) line 3.\n
[Sun Feb 26 23:00:37 2012] [error] Can't load Perl module Frontview for server localhost:443, exiting...
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!