LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   port 80 displays "Index of" and file table (https://www.linuxquestions.org/questions/linux-networking-3/port-80-displays-index-of-and-file-table-30697/)

rioguia 09-19-2002 07:11 AM

port 80 displays "Index of" and file table
 
I am trying to set up a webpage using ezpublish content management. I can display sites using the testing ports but can't when I attempt to use port 80. instead, a web page entitled "Index of" displays with a file table.

I used the defaults with the linux installer and installed the following packages on a stand alone Redhat 7.3 server:
eZ publish 2.2.6
MySQL 3.23.40
Apache 1.3.20
PHP 4.1.2
ImageMagick 5.3.7


TROUBLESHOOTING: I have attempted both listen (both 80 and ip-address80) and port 80 options in the eZconfig.included and in the httpd.conf. my eZconfig.included is as follows:

Listen 1337
Listen 1338
Port 1337
User nobody
Group nobody
******************************************
the DirectoryIndex variable from httpd.conf is:

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>

DocumentRoot "/opt/ezpublish/sites/defaullt"

markus1982 09-19-2002 08:10 AM

Check the DirectoryIndex variable in the httpd.conf

rioguia 09-19-2002 08:14 AM

from my httpd.conf file
 
This is from my hppd.conf file.

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>

geoffm33 09-19-2002 08:40 PM

Look for the section including ' DocumentRoot' in your httpd.conf file.

It will look like this:


Code:

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/usr/local/apache/htdocs"

Like rioguia said, check the DirectoryIndex value and make sure there is a file called index.htm or index.html in the document root directory. Depending on what the DirectoryIndex value is set to.

rioguia 09-21-2002 08:49 PM

virtual hosting issues?
 
In response to your question, the directorindex vaule from httpd.conf is provided below (but i'm not sure how to proceed):

# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>


HERE ARE SOME OTHER THINGS I HAVE TRIED

It looks like this is set up to use name-based virtual hosting. I've tried various ways of changing the virtual hosting config files (see the last four lines of the vitural hosting script below) but nothing seems to make a difference. I can't even decide if this is an apache problem or a PHP problem. I think it is an apache problem because the site works fine on the default ports for the user and admin versions of the site. I just can't make them respond to port 80. When I try I either get "connection refused" or I get the default "Index of" displaying the file tree.

If anyone can lend some insight I would be grateful.

In response to some of mychal's comments, i've determined that some of the relevant files are as follows:

document root =
Directory /opt/ezpublish/sites/default
server root =
/opt/ezpublish/apache-1.3.20

The virtual hosting configuration suggested bby the code's authors are setforth below. The virtual hosting file that is actually running the site is included in httpd.conf by reference to four files. they are simple and an example is set forth below as well
**********************************************
<SUGGESTED VIRTUAL CONFIGURATION

VirtualHost IP.NUM.BE.RS>
<Directory /opt/ezpublish/sites/default>
Options FollowSymLinks
AllowOverride None
</Directory>
RewriteEngine On
RewriteRule ^/stats/store/(.*).gif$ /opt/ezpublish/sites/default/ezstats/user/storestats.php [S=4]
RewriteRule ^/filemanager/filedownload/([^/]+)/(.*)$ /opt/ezpublish/sites/default/ezfilemanager/files/$1 [T="application/oct-stream",S=3]
RewriteRule .*/ezmediacatalogue/catalogue/(.*)$ /opt/ezpublish/sites/default/ezmediacatalogue/catalogue/$1 [T="application/oct-stream",S=2]
RewriteRule ^/xmlrpc.*$ /opt/ezpublish/sites/default/index_xmlrpc.php [S=1]
RewriteRule !\.(gif|css|jpg|png|jar)$ /opt/ezpublish/sites/default/index.php

ErrorLog logs/error-substantis.com
CustomLog logs/totals-substantis.com combined

ServerAdmin rioguia@xxxxxxx.com
DocumentRoot /opt/ezpublish/sites/default
ServerName xxxx.com
</VirtualHost>
<VirtualHost IP.NUM.BE.RS>
<Directory /opt/ezpublish/sites/default>
Options FollowSymLinks
AllowOverride None
</Directory>
RewriteEngine On
RewriteRule .*/ezmediacatalogue/catalogue/(.*)$ /opt/ezpublish/sites/default/ezmediacatalogue/catalogue/$1 [T="application/oct-stream",S=1]
RewriteRule !\.(gif|css|jpg|png|jar) /opt/ezpublish/sites/default/index_admin.php

ServerAdmin rioguia@xxxx.com
DocumentRoot /opt/ezpublish/sites/default
ServerName admin.xxxx.com
</VirtualHost>
*******************************************
CURRENT VIRTUAL CONFIGURATION FROM HTTPD.CONF IS AS FOLLOWS:

#</VirtualHost>

include conf/virtual_hosts/default_user_site.conf
include conf/virtual_hosts/default_admin_site.conf
include conf/virtual_hosts/lo_user_site.conf
include conf/virtual_hosts/lo_admin_site.conf
************************************************
THE REFERENCED FILES LOOK LIKE THIS:
<VirtualHost IP.NUM.BE.RS:1337>
<Directory /opt/ezpublish/sites/default>
Options FollowSymLinks Indexes ExecCGI
AllowOverride None
</Directory>

RewriteEngine On
RewriteRule ^/stats/store/(.*).gif$ /opt/ezpublish/sites/default/ezstats/user/storestats.php [S=4]
RewriteRule .*/ezmediacatalogue/catalogue/(.*)$ /opt/ezpublish/sites/default/ezmediacatalogue/catalogue/$1 [T="application/oct-stream",S=3]
RewriteRule /xmlrpc.*$ /opt/ezpublish/sites/default/index_xmlrpc.php [S=2]
RewriteRule ^/filemanager/filedownload/([^/]+)/(.*)$ /opt/ezpublish/sites/default/ezfilemanager/files/$1 [T="application/oct-stream",S=1]
RewriteRule !\.(gif|css|jpg|png)$ /opt/ezpublish/sites/default/index.php

ServerAdmin root@localhost
DocumentRoot /opt/ezpublish/sites/default
ServerName XXXX.com
</VirtualHost>

AltF4 09-21-2002 09:10 PM

>| <Directory /opt/ezpublish/sites/default>
>| Options FollowSymLinks Indexes ExecCGI
>| AllowOverride None
>| </Directory>

Options Indexes --> turns on indexing

remove "indexes" from options to remove indexing

rioguia 09-22-2002 03:01 PM

i tried AltF4's suggestion but it didn't seem to have any effect. the server still continues to refuse a connection when the site's domain name is requested by a browser unless the specified ports (1337 and 1338) are called. this content management system is supposed to set up a user site (1337) and an admin site (1338) to administer the default site. The index.php file that i think it is supposed to display is found in the document root directory "default."

here is the output of:
find /opt/ezpublish/sites/default/*index*

/opt/ezpublish/sites/default/index_admin.php
/opt/ezpublish/sites/default/index.php
/opt/ezpublish/sites/default/index_verify.php
/opt/ezpublish/sites/default/index_xmlrpc.php


I have included the first few lines of the code here because they seem to relate to the index. if my interpreation is correct:

1. the first line after the headers, ereg is a regular expression to look for some specific patterns in data, like the document root in this case and places it in an array $regs. The array works like this, if ereg found the entire match for the string, then it places in $regs[0], if ereg found a match for the string starting at the first left parenthesis, it goes in $regs[1]; if ereg found a match for the string starting at the first left parenthesis, it goes in $regs[2] if ereg matches the string starting at the second parenthesis.

2. the second line looks like it gives the variable "SiteDir"] the value the match for the string start at the first left parenthesis.

3. third line sets up the index relative to the string match recorded in $regs[2]?
************************************************

header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );

// Find out, where our files are.
if ( ereg( "(.*/)([^\/]+\.php)$", $SCRIPT_FILENAME, $regs ) )
{
$siteDir = $regs[1];
$index = "/" . $regs[2];

rioguia 09-23-2002 08:49 AM

apache permission problem?
 
After hacking with the code for a week, i determined that i could not test with confidence (because i might not be accounting for changes to the code i had made).

I uninstalled and reinstalled (as root) using the linux installer defaults except for specifying port 80 for the user site (and port 1338 for the admin site). I can access and use the admin and user site from the browser on the server itself. I can access access the admin site from a remote pc but not the user site. Instead I get the following message (I have "x-ed out" t my domain name for illustrative purposes), "Error InterScan HTTP Version 3.6-Build_SOL_1224 $Date: 05/08/2002 15:14:0040$ Connecting to www.xxxxxx.com: Connection refused"

this has to be an apache problem but i can't seem to figure it out.

peter_robb 09-23-2002 12:01 PM

The default httpd.conf will have way back in the beginning, a LISTEN option.
All these apply BEFORE the Virtual Rules.
So, if Apache can't find a Virtual Domain that matches the http://requested.domain supplied by the browser, it will feed up the default settings.
Make a set of rules for the default 1st, then tune the Virtuals..

ServerType standalone
ServerRoot "/etc/httpd"
LockFile /var/run/httpd.lock
PidFile /var/run/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 300
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 35
MinSpareServers 5
MaxSpareServers 20
StartServers 8
MaxClients 80
MaxRequestsPerChild 1000
#Listen 80
DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi
Port 80
User apache
Group apache
ServerAdmin xxx@yyy.zzz
ServerName xxx.xxx.xxx.xxx
DocumentRoot /var/www/html/

From the manual http://httpd.apache.org/docs-2.0/mod...reference.html the directive list also notes where these can be used, reused and which takes preference.
You can have totally different settings for each virtual server.
If you keep getting a file list served up rather than your xxx.htm* page, it's because Apache can't find a document that matches the DirectoryIndex statement for the server it allocates to the browser request.

Regards,
Peter

rioguia 09-25-2002 10:52 AM

apache issue? ./clearcache.sh
 
thanks to everyone who was kind enough to help me with this. i'm pleased to announce that this problem is resolved. probably any and all of the coding sollutions suggested here were correct.

the only problem was that I did not ./clearcache.sh in the apache root after making the changes. without clearing the cache, apache kept serving the error message rather than the new code. if this doesn't seem like a sensible answer, its the only one i have to explain why the site just popped up after a clean reinstall and reworking the same solutions as before. the site is answering on port 80 and the admin site on its assigned port.

again thanks to all.


All times are GMT -5. The time now is 01:50 AM.