Difference between revisions of "HTTP File Access via Apache"

From OSNEXUS Online Documentation Site
Jump to: navigation, search
m (Changing Apache's Default Ports)
m (Changing Apache's Default Ports)
Line 28: Line 28:
 
</pre>
 
</pre>
  
 +
=== Enabling Access to Network Shares ===
 +
 +
Now we need to provide access to the Network Shares by editing the default access rules for the web server to allow access to the /export folder.
  
 +
<pre>
 +
nano /etc/apache2/sites-enabled/000-default
 +
</pre>
 +
 +
In there you'll want to change the VirtualHost port number to the one you put into the ports.conf file such as 8001 like so:
 
<pre>
 
<pre>
 
<VirtualHost *:8001>
 
<VirtualHost *:8001>
</pre
+
</pre>
  
 +
You'll also need to add a section which enables access to the Network Shares.  Note that there's no requirement that you provide access to all shares and you can create aliases for specific network shares by creating one or more aliases and associated Directory stanzas.
  
 
<pre>
 
<pre>
 +
....
 +
 
         Alias /export/ "/export/"
 
         Alias /export/ "/export/"
 
         <Directory "/export/">
 
         <Directory "/export/">
Line 42: Line 53:
 
                 Allow from all
 
                 Allow from all
 
         </Directory>
 
         </Directory>
 +
....
 
</pre>
 
</pre>

Revision as of 21:27, 7 October 2015

For cloud and other applications it can be useful to be able to access files in QuantaStor Network Shares via the HTTP protocol as well as through the standard NFS/CIFS protocols. Apache configuration and security issues are a broad topic which is too much for us to cover in this article. As such this article focuses on how to install apache and how to provide public access to all available network shares via HTTP. From there you can use the many online guides to further tune and adjust the configuration settings to meet your specific application and security requirements for your data.

Fixing Port Conflicts

QuantaStor uses many network interface ports the full list of which can be found in the /etc/init.d/iptables file on the appliance. This includes the default HTTP and HTTPS ports which are port 80 and 443. As such we recommend choosing alternate ports like 8001 and 4443 for the apache web server to be used for HTTP file access.

Changing Apache's Default Ports

Edit the /etc/apache2/ports.conf file to make the default port numbers 8001 and 4443 or some other unused port numbers like so:

nano /etc/apache2/ports.conf

After updating the file it should look roughly like this (comments removed for brevity):

NameVirtualHost *:8001
Listen 8001

<IfModule mod_ssl.c>
    Listen 4443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 4443
</IfModule>

Enabling Access to Network Shares

Now we need to provide access to the Network Shares by editing the default access rules for the web server to allow access to the /export folder.

nano /etc/apache2/sites-enabled/000-default

In there you'll want to change the VirtualHost port number to the one you put into the ports.conf file such as 8001 like so:

<VirtualHost *:8001>

You'll also need to add a section which enables access to the Network Shares. Note that there's no requirement that you provide access to all shares and you can create aliases for specific network shares by creating one or more aliases and associated Directory stanzas.

....

        Alias /export/ "/export/"
        <Directory "/export/">
                Options Indexes MultiViews FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>
....