Nas Apache Web Server

  



  1. Home Nas Server
  2. Qnap Nas Web Server
  3. Nas Apache Web Server Login

(20140208 – This post has been amended to provided an updated version of the Apache directive — iceflatline)

Over this past summer I had the pleasure of cobbling together a few spare parts in order to build a Network Attached Storage (“NAS”) box based on FreeNAS. This device has more than fulfilled my initial requirements for reliable file storage and media server in my network. This post will describe how I configured this FreeNAS box to store web files and serve as a document root for the Apache http server implemented in my Ubuntu server. This approach places my local web files on a solid, reliable and centralized RAID 5 disk storage system, and provides good logical and physical separation between file storage and file server functionality.

The versions for the software used in this post were as follows:

Home

All NAS Series Use SSH to log in to the NAS as an administrator. Open the apache-default-modules.conf file: /etc/config/apache/apache.conf Add any additional modules. The Apache HTTP Server is one of the most widely used web server softwares available. A web server is the software that powers a website. It is an open-source software that can be run on a large number of different operating systems, including Windows. This article will teach you how to install the Apache web server on your Windows PC. XigmaNAS is one of the best Linux NAS server solutions for open source enthusiasts. It offers a substantial list of modern-day features that make large-scale data management easier for people with limited or no exposure to NAS. It is based on the FreeNAS open source codebase and features the simplified BSD license. The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.

  • FreeNAS v0.7.1 Shere (revision 5127)
  • Ubuntu Server v10.04 LTS (x64)
  • Apache v2.1.14
  • nfs-common v1:1.2.0-4ubuntu4
  • portmap v6.0.0-1ubuntu2

Configuring the FreeNAS Server

Home Nas Server

I began by creating the directory www on /mnt/files, an existing mount point. This directory would serve as my new Apache document root. Then, I enabled the Network File System (“NFS”) service in FreeNAS so that /mnt/files/www could be accessed from the Ubuntu server. To do this, navigate to Services->NFS->Settings and make sure that the check box for enabling NFS is checked and specify the number of servers that will run (the default value of four should easily handle dozens of users). Now select “Save and Restart.” Next, navigate to Services->NFS->Shares and select the “+” icon, where you are presented with the configuration screen for creating a new NFS share. Enter the path to be shared; the network that is authorized to access this shared path; and, make sure that the “All dirs” checkbox selected. The remaining options can retain their defaults (See Figure 1). Now select “Add” then “Apply changes.”

Configuring the Ubuntu Server

To configure the Ubuntu server I needed to add a couple of packages in order to mount the NFS shared path without error. The nfs-common package is needed when a host acts as an NFS client, and includes a number of processes that ensure a particular NFS connection is allowed and may proceed. Because NFS relies upon remote procedure calls to function, the package portmap is also needed to map RPC requests to the NFS service:

Next, I created a directory so I could mount the NFS shared path. Here you must include the IP address of the FreeNAS server as well as the directory created on it previously:

2
4
6
#Mount the FreeNAS directory /mnt/file/www for use as an Apache document root
192.168.10.5:/mnt/files/www/media/www nfs defaults00
###End iceflatline

I made sure the directory permissions were set correctly, and modified the owner and group associated with /media/www so that the Apache http server could access it:

2
4
6
8
10
#Alias and directive for FreeNAS directory /mnt/file/www
<Directory“/media/www>
AllowOverride None
</Directory>
###End iceflatline

I created an index.html file and moved it to /media/www to test the above configuration, and made sure the file permissions were set correctly: