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
- montrose_itAspirantok done - i had a problem with using www.mysubsite.xxxxxx.com as my domain name hence the reason of the post above.
i am now using mysubsite.xxxxx.com otherwise it just defaults to /shares - must be a problem with my domain provider :(
anyway all working so i'm not bothered :)
what i am bothered with is my downloads web page - has any one got experiance with this? - ProgressedAspirantHoping someone can help me... Im trying to solve a .htaccess problem what gave me the following error from apache errorlog:
Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /c/websites/
when searching for the solution i came accros this topic and i want to host more websites :)
So i converted my website (set in frontview) to a virtual host... But I would like to get the authentication back to what it was... and that is checking the usergroups i authenticated on the folder!
Heres my VH:<VirtualHost *:80>
Servername projects.prog.nl
DocumentRoot /c/websites
<Directory /c/websites>
Options Indexes
Order allow,deny
Allow from all
AllowOverride all
DirectoryIndex index.php index.html
</Directory>
<Location /c/websites>
AuthName "Restricted"
AuthType Basic
Require valid-user
</Location>
SSLEngine off
</VirtualHost> - BigHoskeyAspirantI have read two books and did a lot of line commands on Linux Mint to get a better understanding on how everything works. Well I was ready to set up the ReadyNas Nv+ with the new my-virtual.conf file in /etc/frontview/apache/addons. But this is my problem how do I login to the SSH addon. After I rebooted the Readynas after installing everything, whats next?
- BartezzAspirantAm very new to all this and don't know a thing about command lines since the extinction of commodore 64 :)
Is there an add-on thru which I could achieve a multi site setup via a gui? Or is one in the making?
Cheers - cmonardAspirantHello All!
I've followed you indication, try many version but, the readynas duo still redirect my domain name to /shares/ directory.
Don't understand why it does this.
Can someone help me?
Thanks a lot! - cmonardAspirantHello I've found the answer,
When you create your new share for a website, don't make it accessible to the web via "share list" > "http/s" > "access" => "read" // that is the wrong way. Juste leave it to "no access".
Then the conf in your Virtual.conf should take effect. :)
Nice - Avon_FoxAspirantdevbobo, this worked a treat!
Thank you so much. After moving from an old Windows server and then having to have /sharename/ in the URL killed all my built up indexing with Google and there was nothing they could do about it.
So very happy! :D - Avon_FoxAspirantI've started a new topic for this but I probably should have posted it here in hindsight. If either gets the problem solved I'll link one to the other.
Hi there, this one has me boggled so I'm hoping you can help.
I'm running 4.1.7
I've modified my /etc/frontview/apache/Virtual.conf and added a my-virtual.conf to /etc/frontview/apache/addons as detailed earlier in this topic and it all went well.
My problem is that some folders in the /web/ directory (where I keep my web files) have indexes and some are just folders of files that I need to access without an index.
My my-virtual.conf file has "Options Indexes" listed but when I web surf to those index free folders I get "Forbidden You don't have permission to access /apps/ on this server."
Shouldn't mod_autoindex generate a directly listing or is it not supported on the ReadyNAS?
Cheers for any help/ideas you fine folks can offer.
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 http://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> - WhoCares_MentorTry using "+Indexes +MultiViews" instead of just "Indexes". You may also be interested in this: https://gitorious.org/readynas/apache-configs
-Stefan - Avon_FoxAspirantThanks for the suggestion but sadly no good. I've just tested and it works fine (generates indexes) for shares that I make and enable http access for that don't have indexes.
It's just those that are sitting in the folder that I have set up in 'my-virtual.conf' that it doesn't work for. Is there something in httpd.conf that would conflict with how I've set up access to the /web/ folder?
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!