Probleme d'Alias avec apache
Résolu
J'essaye de faire pointer apache avec des alias sur un repertoire :
Pour cela dans le httpd.conf j'ai tapé :
....
Alias /netmap-admin "/usr/local/netmap/www/admin"
Alias /netmap "/usr/local/netmap/www/ui"
<Directory /usr/local/netmap/netmap/www >
Options ExecCGI
AllowOverride AuthConfig
</Directory>
....
Cependant il me met accès refusé erreur 403.
J'ai donc ensuite essayé en suprimant ces Alias et cela ma mi la meme chose!
Donc je pense que cela vien d'autre part mais ou je ne voi pas..
Les droits sont bon.
J'ai aussi essayer avec un autre repertoire a coté toujours avec Alias dans le httpd.conf
...
Alias /matt "/usr/local/matthieu/"
...
Du coup l'erreur a été 404 non trouvé.
Si qqun peut m'aidé je précise que dans le repertoire /var/www/html j'ai bien réussi a visualisé une page html de test.
Pour cela dans le httpd.conf j'ai tapé :
....
Alias /netmap-admin "/usr/local/netmap/www/admin"
Alias /netmap "/usr/local/netmap/www/ui"
<Directory /usr/local/netmap/netmap/www >
Options ExecCGI
AllowOverride AuthConfig
</Directory>
....
Cependant il me met accès refusé erreur 403.
J'ai donc ensuite essayé en suprimant ces Alias et cela ma mi la meme chose!
Donc je pense que cela vien d'autre part mais ou je ne voi pas..
Les droits sont bon.
J'ai aussi essayer avec un autre repertoire a coté toujours avec Alias dans le httpd.conf
...
Alias /matt "/usr/local/matthieu/"
...
Du coup l'erreur a été 404 non trouvé.
Si qqun peut m'aidé je précise que dans le repertoire /var/www/html j'ai bien réussi a visualisé une page html de test.
A voir également:
- Apache alias
- Apache open office gratuit - Télécharger - Suite bureautique
- Rachid a créé un raccourci (alias ou lien) du fichier expositions sur son bureau. quel est le numéro de l'icône correspondant à ce raccourci ? ✓ - Forum Logiciels
- Supprimer alias icloud - Forum iPhone
- Redemarrer apache - Forum Linux / Unix
- Redemarrer apache ✓ - Forum Linux / Unix
7 réponses
Si ça peut t'aider...
# # This should be changed to whatever you set DocumentRoot to. # <Directory "/var/www/htdocs"> [...] <IfModule mod_alias.c> # # Note that if you include a trailing / on fakename then the server will # require it to be present in the URL. So "/icons" isn't aliased in this # example, only "/icons/". If the fakename is slash-terminated, then the # realname must also be slash terminated, and if the fakename omits the # trailing slash, the realname must also omit it. # Alias /icons/ "/var/www/icons/" <Directory "/var/www/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> [...] </IfModule> # End of aliases
Si tu nous donnait un lein vers ce que tu tente d'installer? (enfin sauf si c'est un projet personnel donc non disponible sur le net.)
Les options que je vois me font plus penser à une configuration du type viewcvs dans ces cas là, il faut voir du coté de la directive ScriptAlias.
Une belette, un lapin !?
C'est pas normal!
Les options que je vois me font plus penser à une configuration du type viewcvs dans ces cas là, il faut voir du coté de la directive ScriptAlias.
ScriptAlias /viewcvs "/usr/local/viewcvs-0.9.2/cgi/viewcvs.cgi" ScriptAlias /viewcvs/ "/usr/local/viewcvs-0.9.2/cgi/"--
Une belette, un lapin !?
C'est pas normal!
le projet que j'ai a réalisé s'appelle netmap et est disponible sur le site http://www.it.teithe.gr/~v13/.
Sinon pour ce qui est des script alias je n voi pas bien comment cela fonctionne... dsl mais je suis débutant! ;)
Sinon pour ce qui est des script alias je n voi pas bien comment cela fonctionne... dsl mais je suis débutant! ;)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Voici mon fichier de conf pour apache, peut etre ca pourra vous aidez :
### 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
###### Donc Alias du fichier en question ###########
Alias /netmap /usr/local/netmap/www/ui
Alias /netmap-admin /usr/local/netmap/www/admin
<Directory /usr/local/netmap/www >
Options FollowSymLinks
AllowOverride None
</Directory>
########################################
########## Test sur un autre fichier #################
Alias /matt /usr/local/matthieu
<Directory /usr/local/matthieu >
Options None
AllowOverride None
</Directory>
######################################
### 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 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
###
### 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>
###
### 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>
Voila aucun des 2 Alias ne marchent... HELP
### 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
###### Donc Alias du fichier en question ###########
Alias /netmap /usr/local/netmap/www/ui
Alias /netmap-admin /usr/local/netmap/www/admin
<Directory /usr/local/netmap/www >
Options FollowSymLinks
AllowOverride None
</Directory>
########################################
########## Test sur un autre fichier #################
Alias /matt /usr/local/matthieu
<Directory /usr/local/matthieu >
Options None
AllowOverride None
</Directory>
######################################
### 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 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
###
### 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>
###
### 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>
Voila aucun des 2 Alias ne marchent... HELP
Re,
Bon, pas trop eu le temps de regarder le projet en question, mais un truc pour commencer :)
Quand on édite un fichier de conf, sauf configuration particuliere, on ajoute ses lignes en fin de fichier :)
La tu fait appel a alias avant de charger le module alias :)
Le plus sage étant même de rajouter (pour apache)
la derniere ligne:
Include /etc/httpd/mon_projet.conf
Et de mettre tes directive dans ce fichier.
Une fois que c'est fait, tu relance apache (apachectl graceful) et tu test, si ça ne fonctionne pas, tu regarde les logs en priorité.
/var/log/httpd/access.log
/var/log/httpd/warning.log
/var/log/httpd/error.log
(ça peut ne pas se trouver dans httpd chez toi.)
++
Bon, pas trop eu le temps de regarder le projet en question, mais un truc pour commencer :)
Quand on édite un fichier de conf, sauf configuration particuliere, on ajoute ses lignes en fin de fichier :)
La tu fait appel a alias avant de charger le module alias :)
Le plus sage étant même de rajouter (pour apache)
la derniere ligne:
Include /etc/httpd/mon_projet.conf
Et de mettre tes directive dans ce fichier.
Une fois que c'est fait, tu relance apache (apachectl graceful) et tu test, si ça ne fonctionne pas, tu regarde les logs en priorité.
/var/log/httpd/access.log
/var/log/httpd/warning.log
/var/log/httpd/error.log
(ça peut ne pas se trouver dans httpd chez toi.)
++
J'ai bien déplacé mes Alias a la fin du fichier de conf, aucun changement toujours acces forbidden.
Cependant j'ai essayé un truc en deplacant tout le repertoire "netmap" dans le repertiore par defaut de apache /var/www/html et la j'avais la meme erreur mais il me disait qu'il n'avai pas acces au fichier index.cgi alors que dans l'autre cas il met pas acces au fichier index.html.
Sachan qu'a chaque fois je fais pointé sur le meme fichier http://localhost/netmap-admin/index.html
peut etre ca peu vous aidé a mieu comprendre!
Sinon pour les logs je regarde cela juste apres!
Cependant j'ai essayé un truc en deplacant tout le repertoire "netmap" dans le repertiore par defaut de apache /var/www/html et la j'avais la meme erreur mais il me disait qu'il n'avai pas acces au fichier index.cgi alors que dans l'autre cas il met pas acces au fichier index.html.
Sachan qu'a chaque fois je fais pointé sur le meme fichier http://localhost/netmap-admin/index.html
peut etre ca peu vous aidé a mieu comprendre!
Sinon pour les logs je regarde cela juste apres!