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
- stinhamboAspirantSorry for the delay! Been busy getting some sites to launch stage.
I have an NVX Pioneer.
Basically I'd like a setup with one click install AND .htaccess (mod rewrite) working! PHP 5.2.6 is fine to be honest but I do have some add-ons that don't use eregi anymore and my live hosting uses 5.3.2.
We use DynDNS so we use aliases and subdomains too. - stinhamboAspirantI'm now getting random PHP errors on dynamic sites. If I remove PHP and MySQL and reinstall, will I start from scratch? I'm hoping I can so I can start clean and leave the .htaccess issues alone until you have a look around or do you prefer to look around before I do this?
Cheers! - WhoCares_MentorRemoving and re-installing add-ons *should* work. However, there's no guarantee it actually does. Also, it is normally not necessary to remove an add-on before re-installing it. Removing of any existing versions of an add-on is part of the installation process.
As for the random errors: it might help if you could post at least the error message.
-Stefan - stinhamboAspirantI sent you a PM :)
- Chop1AspirantHi Stefan!!
I'm trying to use your HOWTO to host my website without the share name in the url (http://domain.com/share --> http://domain.com/), and it works perfectly for the files contained in the principal folder of my share. But I can't load images (contained in the /images folder in my share) without use the share name (http://domain.com/share/images) in my HTML/PHP files.
I tried LOT of RewriteRule, but nothing worked (I don't use Apache very often so maybe I screw somewhere in the RewriteRule I tried). Do you have any idea to submit me? :( - WhoCares_MentorThe problem is that /images is already "taken" by FrontView. Try to move your images to /img for example.
-Stefan - Chop1AspirantOk, you are a genius.
Thanks a lot. :-D - montrose_itAspirantHello All,
i opening this one up again! i'll try and keep my post short.
my employer has a NV+ which i have been allowed to host a website on for a little while. I have recently added a file upload section to the site, however have had trouble with the upload file size. i have edited this as per instructions found in the forum but to no avail, max file size is still about 1.3 mb. I understood that the problem probably lay in the fact i was using SP's PHP which there are some issues with. Due to the fact that this doesn't uninstall properly, I purchased a DUO off a friend with a view to starting on a clean footing.
Heres what I have done:
Installed PHP 5.2.13 viewtopic.php?f=47&t=35880#p199466
Set up a share called 'sites'
Set up a sub folder as my website domain - e.g. 'mydomain'
edited Virtual.conf as above
added my-virtual.conf
this rendered Frontview and http access not avaliable so i changed Virtual.conf back again and removed my-virtual.conf to get back into the setup
with the PHP addon above, i should be able to upload 8mb - it still fails at over 1.5mb - what is the problem?
i can access my web pages ok but the nas asks me to log in every time. since 'sites' is set as read-only with no user authentication, i can't understand this.
i don't actually want to host 2 websites but rather avoid having to have 'sites' after the domain before the page name . e.g. http://www.mydomain.com/sites/index.html
from the post i understand it is possible to do this - i have it nearly working on the NV+ apart from the fact is likewise asks you to login.
i will be grateful for all suggestions and help
-Rick - sphardy1ApprenticeMaybe this will help. I setup a mirror for a website on my NAS - here's the virtual host setup copy & pasted right off the box. It ensures that the Frontview default HTTP settings don't override this host. Might be more than you need but should get you started. (looking at it now there appears to be some redundancy in the settings - but it works)
<VirtualHost *:80>
ServerName website.sphardy.com
DocumentRoot /c/website
<Location />
Options FollowSymLinks
SetHandler none
Order Allow,Deny
Allow from all
DirectoryIndex redirect.html index.html index.php
</Location>
SSLEngine off
</VirtualHost>
Make sure you have edited the default host in the original Virtual.conf<VirtualHost *:80>
SSLEngine off
RewriteEngine on
RewriteRule ^/$ /public [R,L]
RewriteRule ^/admin/(.*)$ https://%{SERVER_NAME}/admin/$1 [R,L]
</VirtualHost>
Include /c/shared/sphardy.com/Virtual.conf
Edit: Simplified Config - montrose_itAspirantthanks, i now get the following error:
[Mon Apr 11 22:14:46 2011] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
btw - i didn't realise there were 4 pages to this post *groan* - some more reading
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!