Index not automated?

Questions about hosting a Website, using MySQL and PhP may be posted here.
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu

Index not automated?

Postby xantios » Sat May 05, 2012 5:46 pm

Hello other synology owners,

I am grinding my teeth on this for 2 days now, and I guessed maybe you guys can help me out...

I have this Synology DS212J, running the web services, and it runs quite okay, although i find it a bit weird that i cant access a directory without pointing my browser manually to the index.html/php file.

First of, a bit more bout my config, guess that helps a lot.
I have my web directory, living in /volume1/homes/Xantios/www/ and i can point my browser to:
http://nas/~Xantios/ where i can acces the files and all.

But for some reason, when i put an index.html or index.php into this directory ( or any subdir for that matter) I manualy need to point my browser to this file.

For what I know, this is not apache default behavior, I tried editing the config file but i cant for the life of me figure out where that definition is missing.

This kind of ruins things like Wordpress and other software, cause they assume they can go to a folder and the index.php will be parsed automaticly.

So can anybody help me out with this one?

Also I'm wondering is this default for Synology or is this a bug or misconfig in my NAS ?

Thanks for the help

With kind regards,
Xantios Krugor
xantios
I'm New!
I'm New!
 
Posts: 2
Joined: Sat May 05, 2012 5:39 pm

Re: Index not automated?

Postby crhiles » Wed May 09, 2012 4:35 am

This is the part of the apache config that regulates the directory index pages:
Code: Select all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.cgi index.php index.php3
</IfModule>

You can look for that in the apache configuration file or try putting:
Code: Select all
DirectoryIndex index.html index.htm index.cgi index.php index.php3
in an htaccess file in your directory. I'm not sure what else to try if that does not work. Maybe your module dir_module is not loading.
DS211 | DSM 4.0 2199 | 2xST31000528AS
crhiles
Beginner
Beginner
 
Posts: 22
Joined: Thu Mar 08, 2012 1:54 am
Location: Canada

Re: Index not automated?

Postby xantios » Fri May 11, 2012 3:35 pm

crhiles wrote:This is the part of the apache config that regulates the directory index pages:
Code: Select all
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.cgi index.php index.php3
</IfModule>

You can look for that in the apache configuration file or try putting:
Code: Select all
DirectoryIndex index.html index.htm index.cgi index.php index.php3
in an htaccess file in your directory. I'm not sure what else to try if that does not work. Maybe your module dir_module is not loading.


Thanks! That does help! :-)
Although the dir_module piece IS in the config, it doesnt have any effect as it seems,
when i put the code in .htaccess in a directory however it magicly works...

Problem ofcourse being that i have to create/edit the .htaccess file for ever folder which is kind of a bummer... i guess i'll try modding the config in a way where this command ends up in the GLOBAL config instead of the therefore created user config.

I'll keep you posted! :-)

UPDATE!

When i mod the /usr/syno/apache/conf/extra/httpd-userdir.conf-user file to read like this

Code: Select all
# Settings for user home directories
#
# Required module: mod_userdir
 
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.  Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir www
 
#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/var/services/homes/*/www">
# No stupid HTML error's
# Though code is in here, in case you want them...
#    ErrorDocument 403 /webdefault/sample.php?status=403&subweb=www
#    ErrorDocument 404 /webdefault/sample.php?status=404&subweb=www
#    ErrorDocument 500 /webdefault/sample.php?status=500&subweb=www
 
# Set Options
Options +Indexes FollowSymLinks +ExecCGI MultiViews
# Override almost everything
AllowOverride AuthConfig FileInfo All
# set possible indexes
# NOTICE these are in oder! ( html has first priority)
DirectoryIndex index.html index.htm index.cgi index.php index.php3
# permissions
Order allow,deny
Allow from all
 
</Directory>


Stuff finally works as god ( Or at least Me ) intended! ( No flame intended FYI ! )
So, yeah whell... Lets rock the web on this box!!

Thanks for the info man! :-)
It's just basic apache, but with weird configs which you really need to get the hang off,
so i guess it would be nice to post my solution, just for future purposes

- Xantios
xantios
I'm New!
I'm New!
 
Posts: 2
Joined: Sat May 05, 2012 5:39 pm


Return to Web Server + PHP / MySQL

Who is online

Users browsing this forum: No registered users and 2 guests