Foros del Web » Administración de Sistemas » Apache »

Creando un Virtual host

Estas en el tema de Creando un Virtual host en el foro de Apache en Foros del Web. Hola buenos dias , acabo de comenzar y tengo el siguiente dilema, he seguido un par de manuale el quick star de zend y el ...
  #1 (permalink)  
Antiguo 20/02/2010, 16:43
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Creando un Virtual host

Hola buenos dias , acabo de comenzar y tengo el siguiente dilema, he seguido un par de manuale el quick star de zend y el de esta pagian , pues bien mi carpeta htdocs esta formada de la siguiente estructura:

Proyecto1;
quickstart;

he creado un virtual host llamado www.quickstart.com , cuando lo ejecuto, sale mi pagina creada con zend framework, hasta hay todo bien , pero si ejecuto
http://localhost/
o http://localhost/Proyecto1.
Sale la misma pagina del quickstar , como puedo hacer para que solo salga esa pagina bien cuando pomgo
www.quickstart.com o pongo http://localhost/quickstart y no el resto, para poder ver mis distintos trabajos,

Seguro que es tema de configuracion pero no se donde tengo que configurar.

Y otra duda, es la siguiente , cuando uso zf enable layout da el siguiente error:

htdocs>zf enable layout
An Error Has Occurred
Action 'enable' is not a valid action.

Porque pasa esto , como se soluciona, uso la version 1.9.5

Gracias a todos.
  #2 (permalink)  
Antiguo 20/02/2010, 16:54
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Dudas zend framework

Esa es configuración más que nada de tu servidor Web, mueve la carpeta de tu proyecto a otro lugar fuera del document root para que solo pueda ser leido por la dirección que le indas en tu virtualhost.

Saludos.
  #3 (permalink)  
Antiguo 20/02/2010, 18:33
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Dudas zend framework

He hecho lo siguiente,he creado una carpeta en htdoc , llamada Zend , y despues he configurado mi virtual host asi:

<VirtualHost *:80>
ServerName www.quickstart.com
DocumentRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/Zend/quickstart/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs/Zend/quickstart/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Pero si pongo http://localhost/, se redirecciona al index de mi virtual host www.quickstart.com

que hago mal , soy nuevo en Zend, y creo q la configuracion de cualquier programa al principio puede ser un poco complicada pero imprenscindible
  #4 (permalink)  
Antiguo 20/02/2010, 18:41
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Dudas zend framework

Lo que pasa es que ya de por si tu carpeta htdocs es el document root de tu servidor localhost, lo que tienes que hacer es poner las carpetas de tu aplicación fuera de esa carpeta htdocs.

Saludos.
  #5 (permalink)  
Antiguo 20/02/2010, 18:50
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Dudas zend framework

Sigue sin funcionar :tengo el virtual host asi ahora:
<VirtualHost *:80>
ServerName www.quickstart.com
DocumentRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/Zend/quickstart/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/Zend/quickstart/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
y he puesto la carpeta en la ruta del virtual host y no funciona , sigue saliendo lo mismo , y he reinciado el apache.
  #6 (permalink)  
Antiguo 21/02/2010, 09:59
Avatar de xbx
xbx
 
Fecha de Ingreso: mayo-2008
Ubicación: /home/xbx
Mensajes: 301
Antigüedad: 16 años
Puntos: 11
Respuesta: Dudas zend framework

Cita:
Iniciado por niewpendejo Ver Mensaje
Sigue sin funcionar :tengo el virtual host asi ahora:
<VirtualHost *:80>
ServerName www.quickstart.com
DocumentRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/Zend/quickstart/public"
SetEnv APPLICATION_ENV "development"
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/Zend/quickstart/public">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
y he puesto la carpeta en la ruta del virtual host y no funciona , sigue saliendo lo mismo , y he reinciado el apache.
Hola,
Copiaste o moviste el directorio?

Saludos,
  #7 (permalink)  
Antiguo 21/02/2010, 10:05
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Dudas zend framework

Lo movi...
la estructura es esta.

/Apache2.2/Zend
/Apache2.2/htdoc/Proyecto1( q no es nada de framework solo php y html).

Q puede estar pasando.
  #8 (permalink)  
Antiguo 21/02/2010, 10:49
Avatar de xbx
xbx
 
Fecha de Ingreso: mayo-2008
Ubicación: /home/xbx
Mensajes: 301
Antigüedad: 16 años
Puntos: 11
Respuesta: Dudas zend framework

Qué otros ServerName y DocumentRoot tienes?
Qué ves específicamente en http://localhost ?

Saludos
  #9 (permalink)  
Antiguo 21/02/2010, 10:56
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
En htdocs solo tengo el phpinfo.php y la carptea del wordpress, y no hay archivos ocultos.

en el httpd del apache tengo esto:

ServerName 127.0.0.1:80

ServerRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/"

Última edición por GatorV; 21/02/2010 a las 13:37
  #10 (permalink)  
Antiguo 21/02/2010, 13:38
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Dudas zend framework

Quitaste el # de la linea que dice NameVirtualHost 127.0.0.1 para activar los virtualhosts?

Tu problema es más de configuración que del Zend framework como tal, te muevo al foro correcto.

Saludos.
  #11 (permalink)  
Antiguo 21/02/2010, 13:54
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Creando un Virtual host

Pego mi httpd.conf, a ver que puede estar mal de la configuracion
No tengo nada que ponga: NameVirtualHost 127.0.0.1

donde tiene que ir, no he pegado todo el documento por extenso.
Código:
#

#
ServerRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/"
#Listen 12.34.56.78:80
Listen 80

# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule authn_alias_module modules/mod_authn_alias.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule disk_cache_module modules/mod_disk_cache.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule php5_module C:/Php/php5apache2.dll


<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.  
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon

</IfModule>
</IfModule>

# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

ServerAdmin [email protected]

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 127.0.0.1:80

DocumentRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php index.php3 index.php4 index.phtml index.html.var
	AddType application/x-httpd-php .php .php3 .php4 .phtml
	AddType application/x-httpd-php-source .phps
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "logs/error.log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

</IfModule>

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

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

# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

<VirtualHost *:80>
	ServerName www.quickstart.com
	DocumentRoot "C:/Archivos de programa/Apache Software Foundation/Apache2.2/Zend/quickstart/public"
	SetEnv APPLICATION_ENV "development"
	<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/Zend/quickstart/public">
		DirectoryIndex index.php
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</VirtualHost>

Última edición por niewpendejo; 21/02/2010 a las 14:39 Razón: añadir documentacion
  #12 (permalink)  
Antiguo 21/02/2010, 15:39
 
Fecha de Ingreso: agosto-2009
Mensajes: 138
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Creando un Virtual host

Ok ya podeis cerrar el post, el problema era, que no habia configurado un virtual host para localhost, pense que no haci falta, que directamente lo hacia apache por defecto.
Muchas gracias
  #13 (permalink)  
Antiguo 01/03/2011, 22:22
 
Fecha de Ingreso: marzo-2011
Mensajes: 1
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Creando un Virtual host

podrías poner como te quedó tu solución? creo que es lo único que me falta para tener mi Virtual Host bien al 100%. Gracias!

Etiquetas: virtual, hosts
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:35.