DeveloperSide.NET Forums
July 13, 2020, 04:42:02 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Still stuck with cofiguring vhosts "PLEASE HELP"  (Read 9487 times)
0 Members and 1 Guest are viewing this topic.
Wilz
Member
*
Posts: 26


View Profile
« on: August 20, 2007, 05:10:45 AM »

Hello can someone please help me with this damn vhost configuration. I read the post that admin had started about vhost configurations. I have set up my vhos conf file that way admin had in his post,

<VirtualHost *:80>
    ServerName gamesgalore.servegame.org
    ServerAdmin admin@gamesgalore.servegame.org
    DocumentRoot D:/www/vhost/gamesgalore.servegame.org
    ErrorLog logs/gamesgalore.servegame.org-access_log
    CustomLog logs/gamesgalore.servegame.org-access_log common
 
    <Directory "D:/www/vhost/gamesgalore.servegame.org">
         DirectoryIndex D:/www/vhost/gamesgalore.servegame.org
         Options +FollowSymlinks
         AllowOverride All
         Order allow,deny
         Allow from all


               AddType text/html .php .phps
      AddHandler application/x-httpd-php .php
      AddHandler application/x-httpd-php-source .phps

    </Directory>
</VirtualHost>
AccessFileName .htaccess

<Files ~ "^\.htaccess$">
   order allow,deny
   deny from all
</Files>



<VirtualHost *:80>
    ServerName co-resources.servebbs.net
    ServerAdmin admin@co-resources.servebbs.net
    DocumentRoot D:/www/vhost/co
    ErrorLog logs/co-error_log
    CustomLog logs/co-access_log common
    <Directory "D:/www/vhost/co">
         DirectoryIndex D:/www/vhost/co
         Options All
         AllowOverride None
         Order allow, deny
         Allow from all
    </Directory>
</VirtualHost>

This is my httpd config file,


ThreadsPerChild 250
MaxRequestsPerChild  0

Listen 80

ServerRoot "D:/www/Apache22"
DocumentRoot "D:/www/webroot"

ServerName localhost:80
ServerAdmin admin@localhost

ErrorLog logs/error.log
LogLevel error

###
# Note that the following LoadModule lines only represent the minimum 'Web-Developer' Suite configuration.
#
# Also note that some of the following LoadModule lines, which are commented out, are still loaded under...
# conf\Suite-extra\*.conf
# conf\extra\*.conf
# ...configuration files -- for modular reasons.
#
# For example:
# mod_deflate is loaded under conf\Suite-extra\mod_deflate_logio.conf and NOT under httpd.conf
# status_module is loaded under conf\extra\httpd-info.conf and NOT under httpd.conf
#
# Check last part of httpd.conf for the Apache base and 'Web-Developer' *.conf files that are included.
###

#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_anon_module modules/mod_authn_anon.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 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_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.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 log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.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_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.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 vhost_alias_module modules/mod_vhost_alias.so
<IfDefine SSL>
   LoadModule ssl_module modules/mod_ssl.so
</IfDefine>


DefaultType text/plain

<IfModule dir_module>
    DirectoryIndex index.php index.html index.htm index.aspx
</IfModule>

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

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Satisfy all
</Directory>

<Directory "/www/webroot">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>


# Apache base configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server.

# 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


# DeveloperSide.NET Server-Suite Configuration
#
# The configuration files in the conf/Suite-extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server.
#
# The specifics are loaded under components.conf...

Include conf/Suite-extra/components.conf


# Security check -- if no php module is loaded, Apache should return 'permissions denied' on php(4,5) all URL requests
<IfModule !php5_module>
<IfModule !php4_module>
   <Location />
      <FilesMatch "\.php[45]?$">
         Order allow,deny
         Deny from all
      </FilesMatch>
   </Location>
</IfModule>
</IfModule>


<IfModule ssl_module>
   Include conf/extra/httpd-ssl.conf
   SSLRandomSeed startup builtin
   SSLRandomSeed connect builtin
</IfModule>

If I didn't add the D:\ drive letter before the ServerRoot path, then I would get an error in the dos box saying, error line 14 blah blah blah. So I added the drive letter now it's reads the vhost ok.

I also configured the host file in /windows/system32/drivers/etc folder like caseyB had posted aswell. What has happened is that I can't get to my domains from within the local network or from outside the local network, I just keep getting the directory listing of the document root folder, in other words, my URL only points to default document root D/www/webroot, and not the vhost folder, any suggestions.

However if I configure my vhost to /www/webroot folder and put subfolders into that, my URL will continue to point to the directory listings of all subfolders under the webroot folder, then my url would have to be like this in order for the right directory to appear with the url is typed into the browser, http://gamesgalore.servegame.org/arcade. What I would like to happen is type in the url, http://gamesgalore.servegame.org and it will just go to the right directory  without having to add, /arcade after the URL.

Sheesh I hope I've worded this properly and you's can understand what I'm saying.
 
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: August 20, 2007, 12:19:32 PM »

What does 'httpd -S' return when run from the command prompt?

What are the contents of the hosts file?

What are the full contents of the httpd-vhosts.conf file.

Make sure you are editing *.conf and not *.conf.default files.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Wilz
Member
*
Posts: 26


View Profile
« Reply #2 on: August 20, 2007, 03:58:48 PM »

The command prompt just says,
VirtualHost Configuration:
Syntax ok.
 It doesn't show any config information like-

C:\Documents and Settings\owner>httpd -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server localhost (D:/www/Apache22/conf/extra/httpd-vhosts.conf:44)
         port 80 namevhost localhost (D:/www/Apache22/conf/extra/httpd-vhosts.conf:44)
         port 80 namevhost bango (D:/www/Apache22/conf/extra/httpd-vhosts.conf:48)
         port 80 namevhost bingo (D:/www/Apache22/conf/extra/httpd-vhosts.conf:52)
Syntax OK

The contents of the host file is,

# Copyright 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a "#" symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
#
127.0.0.1 localhost
127.0.0.1 co
127.0.0.1 arcade

My vhost file is -

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot D:/www/webroot
    ServerName localhost
</VirtualHost>


<VirtualHost *:80>
    ServerName gamesgalore.servegame.org
    ServerAlias www.gamesgalore.servegame.org
    ServerAdmin admin@gamesgalore.servegame.org
    DocumentRoot D:/www/vhost/arcade
    ErrorLog logs/arcade-access_log
    CustomLog logs/arcade-access_log common
 
    <Directory "D:/www/vhost/arcade">
         DirectoryIndex D:/www/vhost/arcade
         Options +FollowSymlinks
         AllowOverride All
         Order allow,deny
         Allow from all


               AddType text/html .php .phps
      AddHandler application/x-httpd-php .php
      AddHandler application/x-httpd-php-source .phps

    </Directory>
</VirtualHost>
AccessFileName .htaccess

<Files ~ "^\.htaccess$">
   order allow,deny
   deny from all
</Files>



<VirtualHost *:80>
    ServerName co-resources.servebbs.net
    ServerAdmin admin@co-resources.servebbs.net
    DocumentRoot D:/www/vhost/co
    ErrorLog logs/co-error_log
    CustomLog logs/co-access_log common
    <Directory "D:/www/vhost/co">
         DirectoryIndex D:/www/vhost/co
         Options All
         AllowOverride None
         Order allow, deny
         Allow from all
    </Directory>
</VirtualHost>


<VirtualHost *:80>
    ServerAdmin admin@rotorua.mine.nu
    DocumentRoot /www/webroot/template
    ServerName rotorua.mine.nu
    ErrorLog logs/template-error_log
    CustomLog logs/template-access_log common
    <Directory "/www/webroot/template">
         Options Indexes FollowSymLinks
         AllowOverride None
         Order allow, deny
         Allow from all
    </Directory>
</VirtualHost>
Logged
Wilz
Member
*
Posts: 26


View Profile
« Reply #3 on: August 20, 2007, 04:05:24 PM »

Oh and if I edit the default .config file, the apache controller won't start because it runs an error.
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #4 on: August 20, 2007, 05:00:26 PM »

1) If httpd -S is not returning anything, then Apache has not loaded any virtual host information. Sounds to me like you are not editing conf/extra/httpd-vhosts.conf but rather something else: like the conf/extra/httpd-vhosts.conf.default file.

2) If you want your domains to resolve locally, and for apache to pick up those hosts, this is what goes into the hosts file...
127.0.0.1 gamesgalore.servegame.org

AND NOT...
127.0.0.1 arcade

3) Check your last vhost, it has no D: in path.

4) Run httpd -t for a syntax check and check error.log for more information.
« Last Edit: August 20, 2007, 05:03:44 PM by admin » Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Wilz
Member
*
Posts: 26


View Profile
« Reply #5 on: August 20, 2007, 05:26:29 PM »

I did a syntax check using the command, httpd -t, and an error came up saying,

C:\Documents and Settings\Owner>httpd -t
Syntax error on line 92 of D:/www/Apache22/conf/extra/htpd-vhosts.conf:
order takes one argument, 'allow,deny, 'deny,allow, or mutual-failure'

This is the block the error refers to,

<VirtualHost *:80>
    ServerName co-resources.servebbs.net
    ServerAdmin admin@co-resources.servebbs.net
    DocumentRoot D:/www/vhost/co
    ErrorLog logs/co-error_log
    CustomLog logs/co-access_log common
    <Directory "D:/www/vhost/co">
         Options All
         AllowOverride None
         Order allow, deny
         Allow from all
    </Directory>
</VirtualHost>

Other then that, I've made to required changes to the host file. And yes I was editing the default vhost config file and also changed that.
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #6 on: August 20, 2007, 05:46:44 PM »

1) Remove all references to DirectoryIndex ... under your VHs. They make no sense the way you are using them.

2) Remove the space after the ',' in "Order allow, deny"
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Wilz
Member
*
Posts: 26


View Profile
« Reply #7 on: August 21, 2007, 12:29:31 AM »

"THANK YOU" "ADMIN" Those last bits of information were the vital solutions to my problems. It works all good now from the local network typing in the URL, http://gamesgalore.blah blah instead of http://localhost/blah blah, and from outside the local network. The directory listings don't come up any more, so cheers and Merry Christmas LOL.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!