Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Sunday, 20 July 2014

How to build a read only file server using Apache in Debian


This post explains how to create an anonymous read only file server using apache web server in Debian.

INSTALL APACHE


First we need apache installed in our system:

Debian:
$ sudo aptitude install apache2

In my system: apache 2.4.9-2 version gets installed.


Centos:
$ sudo yum install httpd


HOW TO LISTEN TO A PORT DIFFERENT FROM 80


We will set our file server to listen on port 2221.


Edit /etc/apache2/ports.conf and add this line:
Listen 2221

Restart apache server:
$ sudo apache2ctl restart

After having apache listening on port 2221 we will be able to edit configuration file to add a virtual host for that port.

<VirtualHost *:2221>
...
</VirtualHost><

http://httpd.apache.org/docs/current/bind.html


ENABLE REWRITE MODULE