PDA

Bekijk Volledige Versie : Cacti alias wil niet werken



adknoth
22/09/10, 14:26
Hallo Allemaal,

Heb net cacti geinstalleerd op een lege machine met apache 2, alles gaat goed tot het laatste puntje. Een alias aanmaken in de httpd.conf.

Volgende regels toegevoegd aan de httpd.conf:

Alias /cacti/ "/home/cactiuser/cacti/"

<Directory "/home/cactiuser/cacti/">
Options Indexes FollowSymLinks Includes MultiViews
Order allow,deny
Allow from all
</Directory>

Maar geeft een 404 terug. Iemand een idee waar dit aan ligt?

marcussmit
22/09/10, 15:04
Mag httpd of apache of hoe het webaccount op je server ook maar heet de bestanden lezen ?

adknoth
22/09/10, 15:09
de dir cacti heeft een chmod 755 dus mag gelezen worden. Overigens even de error die terug komt. Ik heb dit nog niet eerder meegemaakt met een cacti installatie, weet ook even niet waar ik het probleem moet zoeken. Rechten staan goed.


Forbidden

You don't have permission to access /cacti on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

marcussmit
22/09/10, 15:13
mag het webserver account ook in /home/cactiuser ? dit is nodig om naar /home/cactiuser/cacti te kunnen bladeren.

adknoth
22/09/10, 15:16
Uiteraard mag dat ook. Ik vermoed dat het echt in de Alias zit die misschien ergens niet goed is gezien het feit deze installatie al een aantal malen is uitgevoerd op andere machines met Apache 1.

marcussmit
22/09/10, 15:19
ik vraaaaag maar... ;- )

probeer eens zonder die aanhalingstekens ? (verwacht het niet, dan zou je gewoon een 404 moeten krijgen, maar toch....)

adknoth
22/09/10, 15:24
Heb ik ook al geprobeerd, ik heb alle mogelijke varianten die denkbaar waren gehad geloof ik. En er is er geen die werkt. Daarom is het ook een beetje frustrerend.

phreak
22/09/10, 15:28
Stop er een extra / achter, dus .. /cacti/

adknoth
22/09/10, 15:35
Alias /cacti/ "/home/cactiuser/cacti/"

<Directory "/home/cactiuser/cacti/">
Options Indexes FollowSymLinks Includes MultiViews
Order allow,deny
Allow from all
</Directory>


Waar bedoel je precies? Want volgens mij was dat al zo. Ik heb het ook al geprobeerd met /cacti maar dat hielp niks.

marcussmit
22/09/10, 15:41
Wil je de httpd.conf eens posten ? Kan niet zijn dat in de config al expliciet /home denied is ?

adknoth
22/09/10, 15:43
httpd.conf:



#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.

ServerRoot "/etc/httpd"
Listen 80

#LoadModule dummy_module /usr/lib/apache/mod_dummy.so
#LoadModule php5_module /usr/lib/apache/libphp5.so
Include /etc/httpd/conf/extra/httpd-phpmodules.conf

User apache
Group apache

Alias /cacti/ /home/cactiuser/cacti/

<Directory /home/cactiuser/cacti/>
Options Indexes MultiViews
Order allow,deny
Allow from all
</Directory>

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

<Directory /home/*>
AllowOverride All
Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

<Directory />
Options All
AllowOverride All
</Directory>

<Directory "/var/www/html">
Options -Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
<IfModule mod_suphp.c>
suPHP_Engine On
suPHP_UserGroup webapps webapps
SetEnv PHP_INI_SCAN_DIR
</IfModule>
</Directory>

<IfModule dir_module>
DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel warn

<IfModule log_config_module>
#replace %b with %O for more accurate logging
<IfModule mod_logio.c>
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%O" bytes

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

CustomLog /var/log/httpd/access_log common
</IfModule>

<IfModule alias_module>
# Include some DirectAdmin alias
Include conf/extra/httpd-alias.conf
</IfModule>

<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-gzip .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .cgi
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType video/x-ms-asf .avi
AddType video/mpeg .mpg
AddType video/mpeg .mpeg
AddType video/quicktime .mov
AddType video/x-ms-wmv .wmv
</IfModule>

#EnableMMAP off
#EnableSendfile off

################################################## #####################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
################################################## #####################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

# Deflate module settings
Include conf/extra/httpd-deflate.conf

# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf

# For user configurations not maintained by DirectAdmin. Empty by default.
Include conf/extra/httpd-includes.conf

################################################## #####################################
# End of included files that are rewritten by DirectAdmin #
################################################## #####################################

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>


ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Allow from all
</Location>

marcussmit
22/09/10, 15:46
precies, dat bedoel ik. wil je dat stukje directory /home eens uitremmen ?

adknoth
22/09/10, 15:50
Neem aan dat je dit bedoelde:



<Directory /home/*>
AllowOverride All
Options -MultiViews -Indexes FollowSymlinks IncludesNoExec +Includes
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>


Als ik het verwijder en dan de httpd restart veranderd er niks hoor.

phreak
22/09/10, 15:57
Waar bedoel je precies? Want volgens mij was dat al zo. Ik heb het ook al geprobeerd met /cacti maar dat hielp niks.

In je URL .. dus http://blabla/cacti/ <- let op de laatste /

Je Alias is /cacti/ dan moet je die laatste / ook in je URL zetten.

marcussmit
22/09/10, 16:00
Nou, een laatste poging, daarna rest mij alleen nog de packaged versie voor je distributie aan te bevelen (rpm of deb)

<Directory />
Options All
AllowOverride All
Order deny,allow
Allow from all
</Directory>

adknoth
22/09/10, 16:04
@phreak: ja bij de ene krijg ik een echte 404 zonder / en bij de met / krijg ik een forbidden.

@marcus: nope... helaas. ik ben er geloof ik redelijk klaar mee, jammer dat het niet wil werken.

phreak
22/09/10, 16:06
dan moet je eens naar de permissions en/of ownership gaan kijken in de cacti dir (en het is met /cacti/ erachter, 404 is not found, forbidden ligt of aan htaccess of permissions).

adknoth
22/09/10, 16:10
er is geen .htaccess en de rechten staan naar mijn idee goed. Ik zal hem anders zo eens even in de /var/www/html/ proberen te installeren.

T. Verhaeg
22/09/10, 16:15
Httpd.conf overschrijft toevallig niks qua forbidden / allowed rechten op die map?

The-BosS
22/09/10, 18:34
Hebben je mappen (directorys) wel de juiste user instellingen (chown dus), gebruik je toevallig geen suphp en heb je ergens een instelling vergeten. Geef eens een tail van de error log van apache, daar staat meestal wel in waarom hij forbiden/not found is.

adknoth
23/09/10, 07:55
Uit de errorlog:



[Thu Sep 23 07:56:32 2010] [crit] [client ***] (13)Permission denied: /home/cactiuser/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Thu Sep 23 07:56:32 2010] [error] [client ***] File does not exist: /var/www/html/403.shtml


Echter is er geen .htaccess file in /home/cactiuser/ wat zou er in deze .htaccess moeten staan of mag deze gewoon leeg zijn?

adknoth
23/09/10, 10:01
Ok het probleem is met een klein beetje hulp van google inmiddels opgelost. Ik heb maar een leeg htaccess bestand aangemaakt met een chmod 755, vervolgens kwam er een nieuwe error naar voren en deze was in een minuutje opgelost.

Iedereen in ieder geval bedankt voor het meedenken.

daveww
23/09/10, 16:28
.htaccess kan gewoon 644 hebben hoor, 755 is enkel nodig bij bij directories.