PDA

View Full Version : Apache non ho i permessi


texerasmo
09-12-2004, 16:31
Ciao a tutti ho un problemino..
Ho installato e configurato Apache e Tomcat


Ho creato un Vhost e quindi commentato in httpd.conf la documentRoot.

Quando chiamo il mio ip da un altro pc che è messo in rete mi dice che non ho il permesso di vedere, cosa mi manca per la configurazione?

texerasmo
09-12-2004, 16:35
You don't have permission to access / on this server.


--------------------------------------------------------------------------------

Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/5mdk) mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/4.3.8 Server at localhost Port 80

kingv
09-12-2004, 17:29
hai installato jk2?

texerasmo
09-12-2004, 17:39
jk2 cos'è? un moduulo di apache

texerasmo
09-12-2004, 17:42
jk2.properties sotto conf di tomcat c'è ma è tutto commentato

kingv
09-12-2004, 17:44
jk2 e' il connettore tra apache e tomcat.
nell'httpd.conf devi avere una riga del genere:

LoadModule jk2_module modules/mod_jk2.so

texerasmo
09-12-2004, 17:48
si non ce l'ho

che faccio lo scaricoda web?

texerasmo
09-12-2004, 17:50
non trovo la folder module

texerasmo
09-12-2004, 17:56
allora go trovato mod_jk.so

e ho incollato questo in httpd.conf

LoadModules jk_module modules/mod_jk.so

texerasmo
09-12-2004, 18:00
non riesce a caricarmelo

kingv
09-12-2004, 19:44
Originariamente inviato da texerasmo
non riesce a caricarmelo


sono andato ora sul sito e ho letto che jk2 e' in stato unsupported perche' alla gente non piaceva il modo di configurarlo :muro:


bisogna usare il vecchio mod_jk :muro: :muro:


hai bisogno di inserire delle direttive tipo:

LoadModule jk_module libexec/mod_jk.so
AddModule mod_jk.c
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkMount /examples/*.jsp worker1


nella directory conf trovi un esempio di workers.properties

texerasmo
10-12-2004, 10:52
ho eseguito quello che hai detto tu
ma non mi riesce a caricare il modulo.

Devo compilare apache?
se si come si fa?
il ./configure non ce l'ho
tieni presente che apache l'ho preso dal pacchetto di mandake10.0

kingv
10-12-2004, 11:27
scarica il modulo qui:

http://mirror.tomato.it/apache/jakarta/tomcat-connectors/jk/binaries/

texerasmo
10-12-2004, 11:38
lo scarico e lo rinomino
mod_jk.so e lo metto in modules?

texerasmo
10-12-2004, 11:45
tnk il modulo lo ha caricato
ora il pb è un altro mi da un
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

ora smanetto un po' se non riesco ti ridisturbo posso?

kingv
10-12-2004, 11:54
non e' buon segno, prova a scaricare i sorgenti e a compilarlo.

ma non ho ancora capito se usi linux o win :wtf:

kingv
10-12-2004, 11:55
posta anche i messaggi dell'error log di apache.

texerasmo
10-12-2004, 11:57
questo è il log si ssl_error

[Fri Dec 10 11:53:02 2004] [warn] RSA server certificate CommonName (CN) `localhost.H2J831' does NOT match server name!?
[Fri Dec 10 11:53:02 2004] [warn] RSA server certificate CommonName (CN) `localhost.H2J831' does NOT match server name!?


questo è il lor error.log

[Fri Dec 10 11:52:57 2004] [notice] caught SIGTERM, shutting down
[Fri Dec 10 11:53:02 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/apache2-suexec)
[Fri Dec 10 11:53:02 2004] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 10 11:53:02 2004] [notice] Digest: done
[Fri Dec 10 11:53:03 2004] [notice] Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/5mdk) mod_jk/1.2.6 mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/4.3.8 configured -- resuming normal operations


puoi aiutarmi e mettermi sulla buona strada?

texerasmo
10-12-2004, 12:09
Forbidden
You don't have permission to access / on this server.

Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/5mdk) mod_jk/1.2.6 mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/4.3.8 Server at localhost Port 80

kingv
10-12-2004, 12:25
quello su ssl_error e' un warning normale perche' il cn del certificato (presumo self signed) non corrisponde al nome del server.

l'error log non riesco a capirlo.

fai così pulisci error_log e access_log e poi col browser fai una singola richiesta al server.
quando va in errore non fare ulteriori richieste e posta tutto quello che c'e' dentro i due file.

texerasmo
10-12-2004, 12:30
[Fri Dec 10 12:28:14 2004] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/apache2-suexec)
[Fri Dec 10 12:28:14 2004] [notice] Digest: generating secret for digest authentication ...
[Fri Dec 10 12:28:14 2004] [notice] Digest: done
[Fri Dec 10 12:28:15 2004] [notice] Apache-AdvancedExtranetServer/2.0.50 (Mandrakelinux/5mdk) mod_jk/1.2.6 mod_ssl/2.0.50 OpenSSL/0.9.7d PHP/4.3.8 configured -- resuming normal operations
[Fri Dec 10 12:28:23 2004] [error] [client 192.168.0.116] client denied by server configuration: /etc/httpd/2.0/htdocs

kingv
10-12-2004, 12:43
[Fri Dec 10 12:28:23 2004] [error] [client 192.168.0.116] client denied by server configuration: /etc/httpd/2.0/htdocs


ma hai configurato tu un virtual server su quella directory?

non è che apache gira come nobody o qualche altro utente diverso da root e non ha i permessi per leggere quella dir?

texerasmo
10-12-2004, 12:47
virtual server dove si configura? in httpd.conf

io ho commentanto la documentRoot in httpd.conf
e nel mio virtualHost ho /etc/www/html/eyecontent

:muro: :muro:

texerasmo
10-12-2004, 12:54
ho fatto ps -axfu e l'utente è apache

texerasmo
10-12-2004, 13:15
<Directory />
Order Deny,Allow
Deny from all
</Directory>

devo mettere una cosa del genere? nel file vHost

Se metto nel file http.conf la documetRoot /var/www/html/miacartella
non mi da errore di permessi

penso che il pb è nel Vhost

:muro: :muro:

kingv
10-12-2004, 13:45
ma perche' metti come Document Root delle directory contenute in /etc ???
/etc è una directory riservata ai file di configurazione e buona aprte dei file sono leggibili solo da root.

metti come documentroot un'altra directory.

kingv
10-12-2004, 13:45
Originariamente inviato da texerasmo
<Directory />
Order Deny,Allow
Deny from all
</Directory>

devo mettere una cosa del genere? nel file vHost



decisamente no ;)

texerasmo
10-12-2004, 14:53
ok ho messo la documentRoot
/home/erasmo/eyecontent
ora questa folder che permesso deve avere?

kingv
10-12-2004, 15:43
Originariamente inviato da texerasmo
ok ho messo la documentRoot
/home/erasmo/eyecontent
ora questa folder che permesso deve avere?


neache quella e' una buona idea, tu non sei l'utente che fa girare apache e quindi non e' visibile.


creati una /var/tuosito di proprietà di root ma con permessi 755

texerasmo
10-12-2004, 15:58
ti incollo un po di cose

qyesto è il mio file Vhosts.conf

<IfModule mod_jk.c>
JkWorkersFile /etc/httpd/conf/workers.properties
#JkLogFile /var/log/httpd/mod_jk.log
#JkLogLevel info
<VirtualHost 127.0.0.1>
DocumentRoot /var/www/eyecontent
# ErrorLog /var/log/cms-itsecurity-error_log
# CustomLog /var/log/eyecontent-access_log combined env=!nolog
JkMount /eyecontent/* ajp13
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /*.gif ajp13
JkMount /*.GIF ajp13
JkMount /*.JPEG ajp13
JkMount /*.jpeg ajp13
JkMount /*.jpg ajp13
JkMount /*.JPG ajp13
JkMount /*.swf ajp13
JkMount /*.SWF ajp13
JkMount /*.mov ajp13
JkMount /*.MOV ajp13
JkMount /*.dwt ajp13
JkMount /*.DWT ajp13
JkMount /*.css ajp13
....
</VirtualHost>
</IfModule>

questi sono i permessi della dir
DocumentRoot /var/www/eyecontent
drwxr-xr-x 2 root root 4096 dic 10 15:51 eyecontent/


Questo è il htttpd.conf
### Main Configuration Section
### You really shouldn't change these settings unless you're a guru
###
ServerRoot /etc/httpd/2.0/
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ErrorLog logs/error_log
LogLevel warn
#DocumentRoot /var/www/html


### Dynamic Shared Object (DSO) Support
###
### You should always leave those three, as they are needed for
### normal use.
### mod_access (Order, Allow, etc..)
### mod_log_config (Transferlog, etc..)
### mod_mime (AddType, etc...)
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
##LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
##LoadModule charset_lite_module modules/mod_charset_lite.so
##LoadModule case_filter_module modules/mod_case_filter.so
##LoadModule case_filter_in_module modules/mod_case_filter_in.so
##LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
##LoadModule log_forensic_module /usr/lib/apache2/mod_log_forensic.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
##LoadModule mime_magic_module modules/mod_mime_magic.so
##LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
##LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
##LoadModule cgid_module modules/mod_cgid.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
##LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule jk_module modules/mod_jk.so
###

### Global Configuration
###
# We now support multiple apache configurations on the same server. In
# common.conf, we put all directives that are common to all implementations
# (httpd, httpd-perl, etc.)
# For Apache2 we load all conf files in conf.d
Include /etc/httpd/conf.d/*.conf
Include conf/commonhttpd.conf


###
### IP Address/Port and Proxied configuration section
###
# The APACHEPROXIED setting can be set in /etc/rc.d/init.d/httpd if you
# are using a proxy or accelerator, like the Apache-SGI or khttpd, so that
# the fast web server serves static content while Apache handles the
# cgi or php files

#BindAddress *
<IfDefine APACHEPROXIED>
Listen 8080
</IfDefine>
<IfDefine !APACHEPROXIED>
Listen 80
</IfDefine>

# Likewise, we can set apache as the server by default and send perl
# requests via ProxyPass to apache-mod_perl. It increases performance
# since the perl interpreter is only used for perl and the standard apache
# does all the html and image files, with a smaller footprint.
#
# If you install apache and apache-mod_perl, this is the default config.
# If you don't want two web servers to use perl, uninstall apache, and
# apache-mod_perl will not be proxied.

<IfDefine PERLPROXIED>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^proxy:.* - [F]
RewriteRule ^(.*\/perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
RewriteRule ^(.*\/cgi-perl\/.*)$ http://%{HTTP_HOST}:8200$1 [P]
</IfModule>
</IfDefine>

###
### Log configuration Section
###

<IfModule mod_log_config.c>
#Single logfile with access, agent and referer information
#This is the default, if vlogs are not defined for the main server
CustomLog logs/access_log combined env=!VLOG
#If VLOG is defined in conf/vhosts/Vhost.conf, we use this entry
CustomLog "|/usr/sbin/advxsplitlogfile" vhost env=VLOG
</IfModule>


#<Directory /var/www/html>

#AllowOverride All
#<IfModule mod_access.c>
#Order deny,allow
#Allow from all
#</IfModule>
#</Directory>

###
### Virtual Hosts
###
# We include different templates for Virtual Hosting. Have a look in the
# vhosts directory and modify to suit your needs.
Include conf/vhosts/Vhosts.conf
#Include conf/vhosts/DynamicVhosts.conf
#Include conf/vhosts/VirtualHomePages.conf


###
### Performance settings Section
###
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15


# prefork MPM [THIS IS THE DEFAULT]
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>

###
### webapps configuration section
###

# Web applications should be activated _after_ apache has been
# configured properly.
Include /etc/httpd/webapps.d/*.conf

Cmq Grazie spero che mi sia messo in condizioni di farmi aiutare .

texerasmo
10-12-2004, 16:21
Forse non ho chiaro l'utilizzo del Vhost.





Perche se la documentRoot la decommento apache mi fa vedere
/var/www/eyecontent

mentre stessa documentRoot non la vedo nel Vhost

texerasmo
13-12-2004, 09:14
uppdete !!!:cry: