Kom ihåg mig?
Home Menu

Menu


Apache 2.0.40

Ämnesverktyg Visningsalternativ
Oläst 2005-03-09, 21:32 #1
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
Hi.

I'm currently trying to configure Apache 2.0.40 on a machine running Linux Redhat 9.0 (with PHP/mySQL).

Since this is a publicly accessible server, I have created some virtualhosts for testing purposes, and for access to various functions. Also, it's within the VirtualHost configuration the problem arises.

Dont get me wrong, the VirtualHosts are working, but only to a ceratin point (Description below).

When i open f.ex. http://privat.sveg.servemp3.com a test page comes up, thats fine enough. Problem is that the test page should not come up. I've made a temporary index.php page containing the following code:
Citat:

<?
echo "Just Testing";
?>
This page is not showed at all. When I look in the error log, it displays:
Citat:

[Tue Mar 08 03:02:00 2005] [error] [client 192.168.0.2] Directory index forbidden by rule: /home/www/privat.sveg.servemp3.com/
For the virtualHost configuration directives (httpd.conf), I have the following:
Citat:

NameVirtualHost 192.168.0.4:80
<VirtualHost 192.168.0.4:80>
ServerName sveg.servemp3.com
ServerAdmin [email protected]
DocumentRoot /home/www/sveg.servemp3.com
ErrorLog /home/www/error_log
</VirtualHost>

<VirtualHost 192.168.0.4:80>
ServerName privat.sveg.servemp3.com
ServerAdmin [email protected]
DocumentRoot /home/www/privat.sveg.servemp3.com
ErrorLog /home/www/error_privat_log
</VirtualHost>
Permissions on the files and directoryes mentioned herein are all set to 755, and the owner:group permissions are correct for my setup.

Please dont ask me if I've read the manuals, trust me, I've read them from beginning to end regarding the virtualhost directive, and Options direcetive, also documentroot.
I dont mind replys in swedish, I'm just not sure how to exactly get my point made as I'm not that good at writing technical swedish.
If anyone have experienced similar problems and have solved them, please, let me know. If you know of a friend that have had this problem, also please let me know.

(Btw, if this is the wrong place to post this, I'm sorry)

Thanks in advance for help/tips/pointers solving this problem.
Best regards,
Martin
owner of www.oldgames.org
hobby linux user, php programmer webdeveloper.
oldgames är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-09, 21:41 #2
Joels avatar
Joel Joel är inte uppkopplad
Mycket flitig postare
 
Reg.datum: Nov 2003
Inlägg: 790
Joel Joel är inte uppkopplad
Mycket flitig postare
Joels avatar
 
Reg.datum: Nov 2003
Inlägg: 790
Wn utvidgar
Dags för en engelsk forumdel snart också? B)
Joel är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 00:16 #3
grazzy grazzy är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Mar 2004
Inlägg: 3 471
grazzy grazzy är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Mar 2004
Inlägg: 3 471
Try adding a / to the directory:
DocumentRoot /home/www/privat.sveg.servemp3.com/

You also might want to try the "serveralias" attribute just to make sure things are working:
ServerAlias *.servemp3.com
grazzy är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 00:23 #4
Decibels avatar
Decibel Decibel är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Aug 2003
Inlägg: 2 413
Decibel Decibel är inte uppkopplad
Klarade millennium-buggen
Decibels avatar
 
Reg.datum: Aug 2003
Inlägg: 2 413
try without :80 , like this...
And like qrazzy said, with a ending /

added "Option all" , apache2 is somewhat different from Apache 1.x.x , may work better with that.

NameVirtualHost 192.168.0.4
<VirtualHost 192.168.0.4>
ServerName sveg.servemp3.com
ServerAdmin [email protected]
DocumentRoot /home/www/sveg.servemp3.com
Options All
ErrorLog /home/www/error_log
</VirtualHost>

<VirtualHost 192.168.0.4>
ServerName privat.sveg.servemp3.com
ServerAdmin [email protected]
DocumentRoot /home/www/privat.sveg.servemp3.com
Options All
ErrorLog /home/www/error_privat_log
</VirtualHost>
Decibel är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 12:52 #5
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
thanks for the answers, will try them as soon as i'm home from work

will let you know whether or not they worked.
oldgames är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 13:01 #6
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
Citat:
Originally posted by Decibel@Mar 10 2005, 01:23
added "Option all" , apache2 is somewhat different from Apache 1.x.x , may work better with that.
If I understand the documentation correctly
Citat:

The default in the absence of any other settings is All.
( http://httpd.apache.org/docs-2.0/mod/core.html#options )
if the Options directive is missing, it defaults to All.

But, I'm not saying you're incorrect, or that I'm incorrect, it's just that the above sentence can be misunderstood.
oldgames är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 14:31 #7
Decibels avatar
Decibel Decibel är inte uppkopplad
Klarade millennium-buggen
 
Reg.datum: Aug 2003
Inlägg: 2 413
Decibel Decibel är inte uppkopplad
Klarade millennium-buggen
Decibels avatar
 
Reg.datum: Aug 2003
Inlägg: 2 413
Citat:
Ursprungligen postat av oldgames
Citat:
Ursprungligen postat av Decibel
added "Option all" , apache2 is somewhat different from Apache 1.x.x , may work better with that.
If I understand the documentation correctly
Citat:

The default in the absence of any other settings is All.
( http://httpd.apache.org/docs-2.0/mod/core.html#options )

if the Options directive is missing, it defaults to All.

But, I'm not saying you're incorrect, or that I'm incorrect, it's just that the above sentence can be misunderstood.
Ops, try with indexes and follow symlinks
Correct that all is default
Decibel är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 16:07 #8
Thomass avatar
Thomas Thomas är inte uppkopplad
Administratör
 
Reg.datum: May 2003
Inlägg: 3 901
Thomas Thomas är inte uppkopplad
Administratör
Thomass avatar
 
Reg.datum: May 2003
Inlägg: 3 901
Humn sounds more to me that .php may be excluded from the DirectoryIndex in httpd.conf

Citat:
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.php4 index.pl index.jsp
And if you have one index.html and one index.php in the same directory, index.html will most likely show up. Depending of the order of appearance in the DirectoryIndex syntax.

I belive that the Document root should the fine according to the errormessage that points to /home/www/privat.sveg.servemp3.com/

Thomas
Thomas är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 16:26 #9
Marcuss avatar
Marcus Marcus är inte uppkopplad
Supermoderator
 
Reg.datum: Nov 2003
Inlägg: 2 655
Marcus Marcus är inte uppkopplad
Supermoderator
Marcuss avatar
 
Reg.datum: Nov 2003
Inlägg: 2 655
I would try with the following basic settings to begin with, just to see if that works.
Kod:
NameVirtualHost *

<VirtualHost *>
DocumentRoot /home/www/sveg.servemp3.com/
ServerName sveg.servemp3.com
ServerAlias www.sveg.servemp3.com
</VirtualHost>

<VirtualHost *>
DocumentRoot /home/www/privat.sveg.servemp3.com/
ServerName privat.sveg.servemp3.com
ServerAlias www.privat.sveg.servemp3.com
</VirtualHost>
__________________
[ Finanstips.se | Riktnummer.se | Väderlek.se | 3W.se | WWWW.se ]
. [ Marbella.se | ValutaGraf.se | Virusprogram.se | Malta Bolag.se | Växlingskontor.se ] .
Marcus är inte uppkopplad   Svara med citatSvara med citat
Oläst 2005-03-10, 20:11 #10
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
oldgames oldgames är inte uppkopplad
Nykomling
 
Reg.datum: Mar 2004
Inlägg: 7
Citat:
Originally posted by Thomas@Mar 10 2005, 17:07
Humn sounds more to me that .php may be excluded from the http://httpd.apache.org/docs-2.0/mod...directoryindex in httpd.conf
Sorry, but that is not the case. I always go through the config file, looking for the basic settings, and yes, DirectoryIndex is of course one of them.
Citat:

To be exact:
DirectoryIndex index.html index.html.var index.php index.phps index.phtml index index.shtml index.php3 index.php4 default.html default.htm default.php default.phps default.php3 default.php4
But anyway, the problem is solved. The problem was the port number of the NameVirtualHost and VirtualHost alternatives. When removed (and the index page exists in the dir you're trying to set as documentroot) it's working perfectly.

Citat:

Try adding a / to the directory:
DocumentRoot /home/www/privat.sveg.servemp3.com/
There is no need for adding a / at the end. However, if you define a directory alias, and add a / at the end, it is required to be present also in the url to work properly.

Thanks for all the suggestions/tips received.
oldgames är inte uppkopplad   Svara med citatSvara med citat
Svara


Aktiva användare som för närvarande tittar på det här ämnet: 1 (0 medlemmar och 1 gäster)
 

Regler för att posta
Du får inte posta nya ämnen
Du får inte posta svar
Du får inte posta bifogade filer
Du får inte redigera dina inlägg

BB-kod är
Smilies är
[IMG]-kod är
HTML-kod är av

Forumhopp


Alla tider är GMT +2. Klockan är nu 14:41.

Programvara från: vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson
 
Copyright © 2017