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
- mdgm-ntgrNETGEAR Employee RetiredPort forwarding is for WAN access (i.e. over the internet).
- stinhamboAspirantOk so I'm using the PHP 1.4 add-on and I can access phpMyAdmin ok as well as static sites. The big problem is .htaccess and mod_rewrite. I get 443 errors.
None of the threads on this forum seem to help and I'm getting a little bit frustrated as I just want a system that works.
Can someone give me a pointer (and some code!) as to what I should do to enable mod_rewrite?
I get the following error.log message -
[Mon Feb 21 09:24:45 2011] [error] [client 192.168.0.192] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /c/sites/mysite/ - WhoCares_MentorSince I don't know how you configured your virtual host, this is just a generic advice. Under the <Directory ....> statement for your master directory (DocumentRoot) add:
Options +FollowSymLinks
-Stefan - stinhamboAspirantHi Stefan!
Here is an example from my Virtual Host which is in /etc/frontview/apache/addons/my-virtual.conf
<VirtualHost *:80>
ServerName xxx.xxx.dynalias.com
DocumentRoot /c/sites/xxx/
SSLEngine off
RewriteEngine on
DirectoryIndex index.php
Options All
</VirtualHost> - WhoCares_MentorOk, so you'd need to add:
<Directory /c/sites/xxx>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Somewhere between <VirtualHost ...> and </VirtualHost>. Don't forget to restart Apache afterwards.
-Stefan - stinhamboAspirantNo dice :(
Still getting 403 errors. The error log still gives the same error.
Yes I did restart apache! - stinhamboAspirantAny other diagnostics I could run to make sure nothing is conflicting?
- stinhamboAspirantMy .htaccess is -
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L] - WhoCares_Mentor403 means "no access". Or in short: the process apache is running under doesn't have sufficient file system rights to access the data of your vhosts. You can try running
cd /c/sites
chmod -R a+r *
-Stefan - stinhamboAspirantStill not working. Tried it with a static html page. Works fine without .htaccess but I get the 403 if I add the .htaccess.
Related Content
NETGEAR Academy

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