Click to See Complete Forum and Search --> : port 80 displays "Index of" and file table
rioguia
09-19-2002, 07:55 AM
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"
mychl
09-19-2002, 08:14 AM
Apache will show that by default unless there is an index.* file in that directory. * being html, php, etc...
There is a setting for this in httpd.conf somewhere I think. But try putting an index.html page in your server root directory.
HTH
rioguia
09-19-2002, 09:33 AM
I'm not sure what the html code would look like. this is a dynamically generated web page using MySQL /PHP.
Here is the info 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>
DocumentRoot "/opt/ezpublish/sites/default"
mychl
09-19-2002, 10:59 AM
Is this the root of the server?
If so, then you need to tell apache to use whatever file you are generating, or, tell ezpublish to generate is't page as index.*
If this is not the root of the server, then I'm guessing you are linking to a directory, and not a specific file. If that is the case, then link directly to the file and not the directory.
Basically, and directory you access under apache, if there is no index.*, then you will get the file listing that you spoke of.
rioguia
09-19-2002, 11:35 AM
You really know what you are talking about. Right again. I am using a directory. In the directory is a php file called site.ini.
here is some of the relevant part of the begining of the file. after the pertinent information, it appears to provide template information for a bunch of pages begining with [eZAdMain] and then concludes with URL translators. I've comapared them to a clean install on a different test server and nothing jumps out at me as being wrong.
Thanks for any additional help you may provide.
<?php /*
#
# If you have a production site and a staging site with different settings
# you can create a directory called "override" in the main publish directory.
#
# In that directory you can have a completly different site.ini file which will
# be used instead of the correct one (this). This is great if the working
# site.ini is commited to CVS and you don't want to do changes to it.
#
# You can also create a file called site.ini.append in the override directory,
# that file will then be appended and override only those settings set in that
# file. This function can be used to select a staging database instead of the
# production database, but in all other parts use the correct site.ini settings.
#
[site]
SiteURL=www.xxxxxcom
AdminSiteURL=www.admin.xxxxx.com
UserSiteURL=www.xxxxx.com
SiteDesign=standard
SiteStyle=ezpublish
SiteTitle=Sxxxxxxs
Keywords=Sxxxxxxs Content Management State Legislature Regulations Government Relations Association Open Source
Language=en_GB
# Meta content variable
SiteAuthor=Substantis
SiteCopyright=Sxxxxxxs © 2002
SiteDescription=Sxxxxxs Content Management - the Web Application Suite for State Legislative and Regulatory Affairs
SiteKeywords=Sxxxxxxs Content Management State Legislature Regulations Government Relations Association Open Source Content Management System, CMS, e-commerce
HelpLanguage=en_GB
SiteTmpDir=/tmp/
# Database settings set DatabaseImplementation to mysql|postgresql|informix..
DatabaseImplementation=mysql
Server=localhost:3400
Database=publish
User=publish
Password=secret
# If you need to specify the socket to use with mysql use this variable
MySQLSocket=/opt/ezpublish/mysql.sock
# can be e.g. /article/view/42 or disabled
DefaultPage=/article/frontpage/1/
LogFile=error.log
EnabledModules=eZArticle;eZTrade;eZForum;eZLink;eZ Poll;eZAd;eZNewsfeed;eZBug;eZContact;eZTodo;eZCale ndar;eZFileManager;eZImageCatalogue;eZMediaCatalog ue;eZAddress;eZForm;eZBulkMail;eZMessage;eZQuiz;eZ Stats;eZURLTranslator;eZSiteManager;eZUser
CacheHeaders=true
CheckDependence=enabled
ModuleTab=enabled
URLTranslationKeyword=section-standard;section-intranet;section-trade;section-news
Sections=enabled
DefaultSection=1
# Site cache works only on simple sites with no user specific data. E.g. an pure article site.
SiteCache=disabled
# How long before a cache times out, in minutes
SiteCacheTimeout=60
# Charsets for admin that can be used to display different languages
# You can leave this value blank to disble this option
CharsetSwitch=disabled
Charsets=en_GB-English;en_UC-Unicode;no_NO-Norwegian;ru_RU-Russian;lv_LV-Latvian;
#fr_FR-French;it_IT-Italian;de_DE-German;
[classes]
AdminTemplateDir=templates/standard/
TemplateDir=templates/standard/
ImageConversionProgram=convert
DefaultSection=1
[eZAdMain]
AdminTemplateDir=templates/standard/
TemplateDir=templates/standard/
ImageDir=images/standard/
Language=en_GB
DefaultCategory=1
DefaultSection=1
*********************TEMPLATES OMITTED
[eZURLTranslatorMain]
AdminTemplateDir=templates/standard/
TemplateDir=templates/standard/
Language=en_GB
DefaultSection=1
[eZUserMain]
AdminTemplateDir=templates/standard/
TemplateDir=templates/standard/
ImageDir=/images/standard/
Language=en_GB
DocumentRoot=./ezuser/
AnonymousUserGroup=2
SelectCountry=enabled
UserWithAddress=enabled
RequireUserLogin=disabled
SimultaneousLogins=enabled
DefaultSimultaneousLogins=0
MaxUserList=10
DefaultCountry=162
DefaultRedirect=/
DefaultSection=1
ReminderMailFromAddress=nospam@ez.no
RequireAddress=disabled
RequireFirstAddress=disabled
OverrideUserWithAddress=disabled
[eZXMLRPC]
UserIndex=/index.php
*/ ?>
mychl
09-19-2002, 11:43 AM
Ok, the ini file is not for viewing, it is to set up your system. Usually though, the php.ini file is found in /etc/, so I think your publisher stuff is creating it's own initialization stuff.
I'm not sure what you are using this for, but I think you should see what else it can generate.... this ini file is setting variables or resource locations so that php pages it creates will work better.
And if you look at the last line, you can see that the server will still expect an index file, index.php.
Good Luck
rioguia
09-21-2002, 09:32 PM
I'm still working this problem with little progress. 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>
If you can look in your '/opt/ezpublish/sites/default' directory and verify that there is indeed a file there named 'index.html' and let us know, or at least show a listing of all applicable files in that directory (such as index.htm, index.php, index.shtml, etc) that would be very helpful.
rioguia
09-22-2002, 03:53 PM
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. i just want the user site to respond to a request for a page www.xxxxxx.com rather than the www.xxxxxx.com:1337 that is now required.
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
the index.php file is attached (sorry: its about five printed pages). i can understand a little of what its trying to do.
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];
Unfortunately, it looks like you're way over your head with this content management system, so I'd suggest you find support (http://shop.ez.no/shop/support/) from the people that produce ezpublish. As far as your problem with showing the index rather than showing a real webpage, you'll need to do two things within your apache httpd.conf file. First of which is to change the section 'DirectoryIndex' to read like so:
<IfModule mod_dir.c>
DirectoryIndex index.html index.php index.htm
</IfModule>
Note I added the 'index.php' file, which is the file found in your DocumentRoot. The second thing to do is find 'AddType' for adding php document types to the server config.
# AddType allows you to tweak mime.types without actually editing
# it, or to make certain files to be certain types.
#
# For example, the PHP 3.x module (not part of the Apache
# distribution - see http://www.php.net) will typically use:
#
#AddType application/x-httpd-php3 .php3
#AddType application/x-httpd-php3-source .phps
#
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Once you've made sure to make those changes, restart the apache server with the command 'apachectl graceful' and you should be set. Good luck!
rioguia
09-23-2002, 09:56 AM
Thanks your solution looked good but it didn't work. I have paid for basic support from the development team in Norway, but I think they took last week off for THOR HEYERDAHL's birthday or something.
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.
mychl
09-23-2002, 11:08 AM
I think you have 2 services running on port 80, apache and the user site for your software... that's probably not a good thing.
rioguia
09-23-2002, 01:13 PM
your question makes sense. perphaps i don't understand virtual hosting. the examples from the apache site all seem to show port 80 (but then again i may not understand what they are explaining). i'm trying to allow my default user site to respond to the domain name www.xxxxxx.com (so far, i have only had success using either localhost: port 1337, localhost: port 80, IP.ADD.RES.##:port 13337 or www.xxxxx.com:port 1337). right now, with CMS port set to port 80, i can't connect to the user side at all (the admin side works fine as long as i specify the port). this seems to support your conclusion but then the question is, how do i get the virtual host to arbitrate between the user and admin site cname aliases?
http://httpd.apache.org/docs/vhosts/examples.html
thanks for any help.
mychl
09-24-2002, 11:51 AM
Well, you can't connect to CSM? on port 80 because apache is running on port 80, for the virtual hosting thing you need to specify the port you want the domain name to be on. So lets say you have www.mysite.com running on port 80 via apache, then you have this other software that you try to also run on port 80, there is going to be a conflict of interests here.....
Now you can configure apache to host www.mysite.software.com on port 8080, so when apache gets a request for www.mysite.software.com, it'll redirect to the server you told it to run on port 8080.....
Sorry if this is redundant for you, but this seems to me to be where your confusion lies.
Basically, apache is your web server, the CSM thing is just there to dynamically generate web pages for you right.... Well you need to configure apache to use CSM as well as CSM to use apache.
Good Luck
rioguia
09-25-2002, 10:51 AM
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. the site is answering on port 80 and the admin site on its assigned port.
again thanks to all.