Gadgets, Computers and Nerdy Stuff
Configuring DiskStation for multiple websites
The Synology DiskStation comes with the Apache webserver. The “Web Station” functionality allows you to host a website. You can even run multiple virtual hosts. These “default” virtual hosts, however, cannot be configured in detail.
But it is very well possible to host multiple websites on a single DiskStation, while still being able to configure the virtual host in every detail. Here is how:
- Log in to the DiskStation
- Edit the /usr/syno/apache/conf/httpd.conf-user file
DiskStation% sudo vi /usr/syno/apache/conf/httpd.conf-user
Locate the following text:
# Virtual hosts #Include conf/extra/httpd-vhosts.conf
Uncomment the last line, so that it becomes:
# Virtual hosts Include conf/extra/httpd-vhosts.conf
Save the file.
- Now create the httpd-vhosts.conf file (the one you included above):
DiskStation% sudo vi /usr/syno/apache/conf/extra/httpd-vhosts.conf
Make sure this file starts with the following directive:
NameVirtualHost *:80
Now you can define your <VirtualHost>’s. Here’s an example:
NameVirtualHost *:80 # # site1.mydomain.nl # <VirtualHost *:80> ServerName site1.mydomain.nl DocumentRoot /volume1/web/site1.mydomain.nl/htdocs php_admin_value magic_quotes_gpc off </VirtualHost> # # site2.mydomain.nl # <VirtualHost *:80> ServerName site2.mydomain.nl DocumentRoot /volume1/web/site2.mydomain.nl/htdocs php_admin_value magic_quotes_gpc off </VirtualHost>
- Restart Apache:
DiskStation% sudo /usr/syno/apache/bin/httpd -k restart
Note that I set magic_quotes_gpc to off explicitly in all my virtual hosts. Synology’s own PHP-code (for the admin interface) needs the magic quotes setting to be on, which is just bad practice.
| Print article | This entry was posted by Arjan on March 20, 2010 at 15:11, and is filed under Apache, DiskStation, PHP. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |

