User Tools

Site Tools


Author note: I will format this and write it in proper form later. For the moment, this is a how-to with no explanations :)

sudo mkdir /mnt/nas /mnt/pes/nas cifs nounix,rw,username=SMBUSER,password=SMBPASSWORD,uid=LINUXUSER 0 0 So, this might look like: /mnt/nas cifs nounix,rw,username=rferguson,password=potato,uid=robbie 0 0

sudo mount -a

If all went well, your nas will now be on /mnt/nas - try ls /mnt/nas

Edit the configuration file: sudo gedit /etc/apache2/sites-enabled/000-default

Change DocumentRoot from /var/www to /mnt/nas, or if your web files are in a folder on the nas, you might use /mnt/nas/website. If there are spaces in the name, use quotes.

For example, DocumentRoot “/mnt/nas/Web Site”

You'll also see <Directory /var/www/> which must be changed to <Directory “/mnt/pes/nas/Web Design/”>, or whatever your folder is (note the trailing slash).

Save that and close it.

Now we need to make apache play nicely with samba, so edit your configuration file with sudo gedit /etc/apache2/apache2.conf

Go to the very bottom of that file and add: EnableSendfile Off

Save and close, and then restart apache with: sudo apachectl restart

If you refresh your http://localhost/, you should now be looking at your site, hosted directly from the NAS.

tutorials/apache_nas.txt · Last modified: 2012/01/26 14:25 by robbie