Difference between revisions of "Web Hosting"
(Initial release) |
(No difference)
|
Latest revision as of 22:35, 10 October 2011
After some messing around, here is a solution on how to host simple web site while keeping Webend settings intact, and using minimal resources.
So here we go. Task is - host a simple (html) website on WDTV Live, using only external drive as resource. Prerequisites could be ddclient set up for dynamic addressing if you wish. ;)
1. Use directions from http://wiki.wdlxtv.com/NoPasswordApache to create writable apache config file, but not removing Webend protection. So...
cp /etc/apache2/sites-available/default /conf/apache-default
2. Edit new file apache-default (using nano for example) and add new section after existing <Location> section/directive, assuming that web page will be located at path /tmp/www-tmp/my_site. This will allow connections without having to input user/password.
<Location /tmp/my_site> Allow From All Satisfy Any </Location>
3. Again from wiki page: Create a new file /conf/S00user-script (it may already exist) putting the following into it:
#!/bin/sh mount -o bind /conf/apache-default /etc/apache2/sites-available/default
4. Restart... not sure if needed, you could just try rebooting apache (/etc/init.d/S66apache2 restart)... but... nevermind:
sync; sync; reboot
5. Assuming that your website directory is placed in a root of external hdd on path /tmp/mnt/12D3-4321/my_website ... (with main page index.html...)
cd /var/www/tmp ln -s /tmp/mnt/12D3-4321/my_website my_website
And thats it! You can try to access your site by using WDXLTV IP address or domain name for outside (ex. 192.168.0.4/tmp/my_website).
You should not be asked for user/pwd for your site, while keeping Webend protected. ;)
rikifeld