Current time: 05-04-2024, 08:32 AM Hello There, Guest! (LoginRegister)


Post Reply 
[Resuelto] Consulta sobre .htaccess
Author Message
k12audio Offline
Junior Member
*

Posts: 37
Joined: May 2009
Reputation: 0
Post: #1
[Resuelto] Consulta sobre .htaccess
Hola.

Tengo una carpeta la cual tiene archivos con extencion .aspx pero estos archivos estan en lenguaje php. Necesito que el servidor lea estos archivos como si fueran simples archivos con extencion php. Eh probado con las siguientes lineas en el archivo .htaccess de la carpeta:

Code:
AddEncoding application/x-httpd-php .aspx
AddEncoding x-httpd-php .aspx
AddHandler application/x-httpd-php .aspx
AddHandler x-httpd-php .aspx
AddType application/x-httpd-php .aspx
AddType x-httpd-php .aspx

ninguna cumple con lo que necesito, pero si hacen algo. Por Ejemplo al escribir "AddType application/x-httpd-php" en el .htaccess y abrir un archivo .aspx desde el navegador me lo comienza a descargar, ahora si intento escribiendo "AddType x-httpd-php" en el .htaccess y cargo el mismo archivo me lo muestra, pero no lo lee el codigo php. Probe esto colocando el siguiente codigo:

Code:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

Para mostrar la phpinfo, al guarda el archivo en formato .php no tengo ningun problema, ya que este lo muestra sin ningun problema por el navegador web, pero al guardarlo en .aspx y verlo desde el navegador solo me muestra una pagina en blanco.

¿ Que tengo que hacer para que el servidor apache me lea los archivos .aspx como si fueran archivos .php ?

saludos.
(This post was last modified: 07-23-2009 04:38 AM by kurgans.)
07-21-2009 11:02 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #2
RE: Consulta sobre .htaccess
Bueno, depende de si uitilzas fcgid o fastcgi (puedes comprobar si tienes fastcgi_ispcp o fcgid_ispcp dentro de /etc/apache/mods-enabled para saber cual usas). En caso de usar fcgid, lo que debes añadir al htaccess es:
Code:
AddHandler fcgid-script .aspx
Por el contrario, si usas fastcgi:
Code:
AddHandler php-fastcgi .aspx
Y eso es todo Smile
07-21-2009 03:26 PM
Visit this user's website Find all posts by this user Quote this message in a reply
k12audio Offline
Junior Member
*

Posts: 37
Joined: May 2009
Reputation: 0
Post: #3
RE: Consulta sobre .htaccess
intente con fcgid, y al intentar abrir el archivo .aspx que contiene la info php me dice:

Service Unavailable!

aqui esta el link para que veas:

http://ranked.thedrinkteamserver.com/ASP/infophp.aspx
http://ranked.thedrinkteamserver.com/ASP/info.php

los dos archivos tienen el mismo codigo. La log del apache dice lo siguiente:

Code:
[Tue Jul 21 02:51:43 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17923) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:51:43 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17922) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:51:51 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17927) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:51:51 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17926) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:51:51 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17925) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:51:51 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17924) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:03 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17931) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:03 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17930) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:03 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17929) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:03 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17928) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:15 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17935) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:15 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17934) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:15 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17933) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:15 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17932) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:17 2009] [warn] mod_fcgid: can't apply process slot for /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx
[Tue Jul 21 02:52:27 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17939) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:27 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17938) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:27 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17937) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:27 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17936) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:37 2009] [warn] mod_fcgid: can't apply process slot for /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx
[Tue Jul 21 02:52:40 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17941) exit(server exited), terminated by calling exit(), return code: 121
[Tue Jul 21 02:52:40 2009] [notice] mod_fcgid: process /var/www/virtual/ranked.thedrinkteamserver.com/htdocs/ASP/infophp.aspx(17940) exit(server exited), terminated by calling exit(), return code: 121

eso es al intentar cargar el link de infophp.aspx una sola vez...
¿ Que mas puede ser ?

de antemano gracias.
07-21-2009 04:54 PM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #4
RE: Consulta sobre .htaccess
Mea culpa. Para que funcione en fcgid también tienes que añadir lo siguiente al fichero /etc/apache2/ispcp/domain.tld.conf (que debería existir pero estar vacío):
Code:
<IfModule mod_fcgid.c>
        <Directory /var/www/virtual/<domain.tld>/htdocs>
            FCGIWrapper /var/www/fcgi/<domain.tld>/php5-fcgi-starter .aspx
            Options +ExecCGI
        </Directory>
    </IfModule>
07-21-2009 11:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
k12audio Offline
Junior Member
*

Posts: 37
Joined: May 2009
Reputation: 0
Post: #5
RE: Consulta sobre .htaccess
Funciona exelente con los archivos .aspx Big Grin, pero me falta ahora que funcione con los .php.. la idea es que todo quede funcionando como antes con la diferencia de que ahora lea los archivos .aspx como si fueran .php. Ahora el problema es al reves, me muestra bien los .aspx pero los php me dice "Service Unavailable!" que puedo hacer o que tengo que agregar ? para que me funcione todo igual que antes y me lea los archivos .aspx como php?

saludo y muchas gracias Smile
07-22-2009 04:12 AM
Find all posts by this user Quote this message in a reply
k12audio Offline
Junior Member
*

Posts: 37
Joined: May 2009
Reputation: 0
Post: #6
RE: Consulta sobre .htaccess
man estube jugando un poco con las configuracion y agradesco la ayuda me sirvio bastante y llego a esto:

Archivo .htaccess
Code:
AddType fcgid-script .aspx .php

Archivo /etc/apache2/ispcp/domain.tld.conf
Code:
<IfModule mod_fcgid.c>
        <Directory /var/www/virtual/<domain.tld>/htdocs>
            FCGIWrapper /var/www/fcgi/<domain.tld>/php5-fcgi-starter .aspx
            FCGIWrapper /var/www/fcgi/<domain.tld>/php5-fcgi-starter .php
            Options +ExecCGI
        </Directory>
</IfModule>

se agradece toda la ayuda, el problema esta resuelto Big Grin
(This post was last modified: 07-22-2009 09:16 AM by k12audio.)
07-22-2009 07:26 AM
Find all posts by this user Quote this message in a reply
k12audio Offline
Junior Member
*

Posts: 37
Joined: May 2009
Reputation: 0
Post: #7
RE: Consulta sobre .htaccess
Consulta....

Donde puedo hacer esto con el dominio base ?, es decir que al escribir la ip del server me funcionen, igual que en el dominio antes configurado, los archivos .aspx ( Archivos puestos en esta direccion: /var/www/ispcp/gui )

¿ donde esta esta configuracion ? ¿ o que tengo que hacer para que funcione ?
(This post was last modified: 07-22-2009 12:54 PM by k12audio.)
07-22-2009 08:59 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #8
RE: Consulta sobre .htaccess
No se que pretendes con eso (es raro de cojones lo que pides) pero bueno, puedes ponerlo en el archivo /etc/apache2/sites-enabled/00_master.conf , aunque deberías adaptar también el /etc/ispcp/apache/00_master.conf
07-22-2009 04:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
k12audio Offline
Junior Member
*

Posts: 37
Joined: May 2009
Reputation: 0
Post: #9
RE: Consulta sobre .htaccess
cual es la diferencia entre: /etc/apache2/sites-enabled/00_master.conf y este archivo /etc/ispcp/apache/00_master.conf ?

ya edite el primero pero no tube buenos resultados, el server solo me mostro como texto el codigo que tenia el archivo. mira los resultados y dime:

http://www.thedrinkteamserver.com/info/info.aspx

en el archivo .htaccess de la carpeta "info" esta escrito esto:

Code:
AddHandler fcgid-script .aspx

y en el archivo /etc/apache2/sites-enabled/00_master.conf esto:

Code:
<VirtualHost 190.162.126.9:80>

    ServerAdmin     mail@domain.tld
    DocumentRoot    /var/www/ispcp/gui

    ServerName      admin.thedrinkteamserver.com

    Alias /errors   /var/www/ispcp/gui/errordocs/

    ErrorDocument 401 /errors/401.html
    ErrorDocument 403 /errors/403.html
    ErrorDocument 404 /errors/404.html
    ErrorDocument 500 /errors/500.html
    ErrorDocument 503 /errors/503.html

    Alias /pma      /var/www/ispcp/gui/tools/pma/
    Alias /webmail  /var/www/ispcp/gui/tools/webmail/
    Alias /ftp      /var/www/ispcp/gui/tools/filemanager/

    <IfModule suexec_module>
           SuexecUserGroup vu2000 vu2000
    </IfModule>

    <Directory /var/www/ispcp/gui>
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    <IfModule mod_fcgid.c>
        <Directory /var/www/ispcp/gui>
            FCGIWrapper /var/www/fcgi/master/php5-fcgi-starter .php
            FCGIWrapper /var/www/fcgi/master/php5-fcgi-starter .aspx
            Options +ExecCGI
        </Directory>
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>
    <IfModule mod_fastcgi.c>
        ScriptAlias /php5/ /var/www/fcgi/master/
        <Directory "/var/www/fcgi/master">
            AllowOverride None
            Options +ExecCGI MultiViews -Indexes
            Order allow,deny
            Allow from all
        </Directory>
    </IfModule>

    <IfModule mod_php5.c>
        <Directory /var/www/ispcp/gui>
            php_admin_value open_basedir "/var/www/ispcp/gui/:/etc/ispcp/:/var/run/ispcp.lock:/proc/:/bin/df:/bin/mount:/var/log/rkhunter.log:/var/log/chkrootkit.log:/usr/share/php/"
            php_admin_value session.save_path "/var/www/ispcp/gui/phptmp/"
            php_admin_value upload_tmp_dir "/var/www/ispcp/gui/phptmp/"
        </Directory>
    </IfModule>

</VirtualHost>

pero como se ve al carga la pagina, solo muestra el codigo del archivo. ¿Que me falta hacer ? o ¿ Que esta mal ?

Disculpen a este nobato Tongue xD
gracias.
07-22-2009 06:14 PM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #10
RE: Consulta sobre .htaccess
La configuración del dominio principal (el de ispcp) es algo distinta que la de los usuarios. Entre estas diferencias, una de ellas es que:
Code:
<Directory /var/www/ispcp/gui>
        Options -Indexes Includes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
AllowOverride está a None, lo cual deshabilita totalmente los ficheros .htaccess para este virtual host. Evidentemente, se supone que los usuarios no tienen que hacer cambios ahí y el panel no necesita .htaccess, así que debería ser seguro (y aumentar la seguidad) dejarlo desactivado.

Para solucionarlo, en vez de añadir la línea
Code:
AddHandler fcgid-script .aspx
en el .htacces, añadela mediante una directiva <Directory> (dentro del IfModule mod_cgi), del estilo:
Code:
<Directory /var/www/ispcp/gui/info>
    AddHandler fcgid-script .aspx
</Directory>

Quote:cual es la diferencia entre: /etc/apache2/sites-enabled/00_master.conf y este archivo /etc/ispcp/apache/00_master.conf ?

Como verás, en /etc/ispcp/apache/00_master.conf aparecen ciertos "tags" (variables entre llaves). Una vez reemplazados por los valores correctos para tu sistema, el resultado es un fichero 00_master.conf correcto, de modo que si el panel debe regenerar la configuración de apache por algún motivo, usaría esa plantilla y sobreescribiría tu fichero /etc/apache2/sites-enabled/00_master.conf con el resultado.
(This post was last modified: 07-22-2009 10:39 PM by kilburn.)
07-22-2009 10:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)