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
- sphardy1ApprenticeAs mentioned - you *must* update the original vhost definition in the default Virtual.conf file. See the example I posted
- montrose_itAspirant
sphardy wrote: As mentioned - you *must* update the original vhost definition in the default Virtual.conf file. See the example I posted
have done :) ... well... hang on - what do i put instead of this?Include /c/shared/sphardy.com/Virtual.conf
EDIT: HANG ON, i rebooted and something seems to be happening :? - sphardy1ApprenticeEither a reference to your own custom file containing the vhost definition, or replace with your vhost definition
Note that the vhost definitions begin: <VirtualHost *:80>, not <VirtualHost _default_:80>
See: http://httpd.apache.org/docs/current/vh ... mples.html
You must restart apache after the changes are made - montrose_itAspirantright - issue(s) solved. website now up and running - index page only - i have some major editing to do. :(
just fyi i've used a configuration very similar to that posted right at the start of this howto... will post the final code tomorrow when i can get back in the box. (bed now!)
just off hand does anyone know if you can edit the timeout time of a webpage...? as i mentioned i have this upload page which works fine on files up to about 2.8mb or so but the webpage times out on larger files before the script can actually upload them. therefore you don't get a error message to same unsupported file type or too large as neither are true.
when i had Sp's php i edited PHP.ini so am aware how to do this if the answer is there.
thanks in anticipation
edit: sorted the upload issue by editing some files in php.ini can now upload any size i want :) - montrose_itAspiranthi all,
final post to show the code i used:
Virtual.conf:
NameVirtualHost *:80
<VirtualHost *:80>
SSLEngine off
RewriteEngine on
RewriteRule ^/admin/(.*)$ https://%{SEVER_NAME}/admin/$1 [R,L]
</VirtualHost>
my-virtual.conf
<VirtualHost *:80>
ServerName www.mysite.com
DocumentRoot /c/path/to/mysite
<Directory /c/path/to/mysite>
Options Indexes
Order allow,Deny
Allow from all
</Directory>
<Location /index.html>
SetHandler none
Order Allow,Deny
Allow from all
</Location>
SSLEngine off
</VirtualHost>
it seems as if the putting '/c/' helped and also a reboot sorted it :) - sphardy1ApprenticeGlad it is working
Just note that specifying "Options Indexes" (the frontvew default) will prevent you from using .htaccess files. May or may not be an issue depending on how you intend to develop the website. (For example: if using WordPress, it uses .htaccess to create readable links) - montrose_itAspirantah - i see... should i really put Options All then? I don't really intend to use Wordpress but I'm not sure what other addons and facilities would be affected by this issue
- sphardy1Apprentice"Options All" fully opens the configuration - here are the possibilities: http://httpd.apache.org/docs/current/mo ... ml#options
- montrose_itAspiranthi guys, some more help please.
i currently have one domain name . www.xxxxxx.com. this is forwarded fine to my ext IP and works ok with the configuration above.
I would now like to set up a 'sub' site as follows : www.mysubsite.xxxxxxx.com using the same domain name
is it possible to set up the configuration above to handle this so i don't have to forward the address to www.xxxxx.com/sites/subsitefolder/index.html ? i effectively want to get 'rid' of having to insert /sites/subsitefolder in the web path
replies asap appreciated. - sphardy1Apprenticeyes - just create a new (ie additional) vhost configuration with the required servername and make sure you have DNS setup to forward that domain to the same IP address - see the example I gave previously
Related Content
NETGEAR Academy

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