NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Vaclav
Nov 13, 2013Aspirant
OS 6.1.4 apache2 mod_rewrite .htaccess problem
Hi, I'm trying configure apache2 to enable mod_rewrite in my HTTP enabled share folder. I use that folder as my personal webserver for PHP development. I have root access via SSH to my ReadyNAS, I...
Vaclav
Nov 18, 2013Aspirant
Finished my Apache2 excourse. PROBLEM SOLVED,
will sumarize solution and tips for the others.
will sumarize solution and tips for the others.
- Firstly, the problem was not related with file permission. Ownership was set propperly to admin:admin, which is what you need for web access as well as for local network sharing. There's no need to fiddle with permissions in most cases.
- You need create your configuration in
/etc/apache2/sites-enabled
You should create separed file for your configuration. Since all files in that folder are included by apache in order by filename, it is good convention to start your configuration file with number higher than alredy existing files. There are configuration files for frontview (ReadyNAS administration page), that begins with 000- and apps configuration files begins with 090-, I named my configuration file like 099-. - You could put your config file directly in sites-enabled folder or you can put it in sites-available, which will make that site available, but not enabled yet. You can than enable that config file with command
a2ensite <your_config_name>
It is usefull, if you want sometimes shutdown that site with commanda2dissite <your_config_name>
but as far as I know, otherwise from this purpose, it doesn't matter. - Because of some security reason, the rewriteEngine is only permitted to operated under configured virtual host. I firstly configured only <Directory>, which led to 403 : forbidden. In the end, I use this config
Apache documentation recommends leave all directory paths without last slash and you can ommit double quotes, but I saw config files with that in place and it seem to operate normally.
<VirtualHost *:80>
ServerName <your_server_name>
DocumentRoot <your_path_to_DocumentRoot>
<Directory <your_path_to_DocumentRoot> >
Options FollowSymLinks
AllowOverride FileInfo Options
Order allow,deny
allow from all
</Directory>
</VirtualHost> - In <Directory> section, I allowed to override FileInfo and Options, which is perfect minimum for RewriteEngine to work. You must also enable FollowSymLinks in options!
- Than you have to link <your_server_name> to your NAS, that means modify hosts file on your machine. I use Win7, so I modified
Windows/system32/driver/etc/hosts
added new line<your_NAS_IP> <your_server_name>
I use serverName without top level domain (country code), so it'll not conflict with some existing page. - Once its all configured, you can enter <your_server_name> into address bar of your web browser and it should redirect you to your web shared folder with rewriteEngine on. Beware of your browser, sometimes it perform search your_server_name on search engine, instead of access it. It is crucial to acces your folder through <your_server_name>. I accessed them differently before and that also led to error 403 : forbidden.
- Dont forget to run
service apache2 reload
after changes to take effect.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!