LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-26-2004, 10:55 AM   #1
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Rep: Reputation: 30
apache2, virtual host problems


Hi Im trying to use 2 domains from the same ip, i added this to etc/httpd/conf/vhosts/Vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
ServerName ww.topone.com
ServerAlias topone.com *.toponecom
DocumentRoot /var/www/html/websites/topone
ErrorLog logs/topone.com-error_log
TransferLog logs/topone.com-access_log
</VirtualHost>

<VirtualHost *:80>
ServerName ww.bottom.net
ServerAlias bottom.net *.bottom.net
DocumentRoot /var/www/html/
ErrorLog logs/bottom.com-error_log
TransferLog logs/bottom.com-access_log
</VirtualHost>


I also added
VirtualDocumentRoot /etc/httpd/conf/vhosts/Vhosts.conf

to httpd.conf

For some reason topone does not work. It doesnt seem like its using the virtual hosts at all. i checked the apache 2 documentation and that is what it said to do. im obviously missing something, any help is appreciated, thanks. 2 w's bc it wouldnt let me post urls.

r
 
Old 04-26-2004, 01:08 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Any errors in your access logs?

Does the domain resolve to the right IP when you dig it?
 
Old 04-26-2004, 10:04 PM   #3
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
yea thanks for the reply, both of them go to the same place, /var/html/www. didnt see anything in the error logs, i think becuase there arent any errors. the dig results in both of them having an ip from the nameserver.

I dont know how to make one go somewhere else. Any ideas?
thanks again.

r
 
Old 04-26-2004, 11:24 PM   #4
gwroy20
Member
 
Registered: Mar 2003
Location: New York City
Distribution: Slackware 9.1, FreeBSD 5.2.1, OpenBSD 3.3
Posts: 89

Rep: Reputation: 15
Does this problem occur on a local network, or does it only not work on the Internet?
 
Old 04-27-2004, 06:35 AM   #5
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
both. I feel like i am missing something simple here. Is there something i can do to make sure apache is using the Vhosts.conf file? there is an include file in the httpd.conf, but according to the apache documentation it should be working i think. there is an example one on the server and i do not have it exactly like that:

NameVirtualHost 111.222.33.44
#<VirtualHost 111.222.33.44>
#ServerName www.domain.tld
#ServerPath /domain
#DocumentRoot /web/domain
#</VirtualHost>



Thanks for the help,
r
 
Old 04-27-2004, 06:36 AM   #6
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
oops, the top line is commented out. #NameVirtualHost 111.222.33.44
 
Old 04-27-2004, 03:58 PM   #7
Matt Collier
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 80

Rep: Reputation: 15
you only need the VirtualDocumentRoot directive for mod_vhost_alias, to dynamically add or remove vhosts without having to reload apache

all you need to do is
Include /etc/httpd/conf/vhosts/Vhosts.conf

in your main httpd.conf

as long as each virtualhost belongs to a NameVirtualHost directive, and it has it's own ServerName and DocumentRoot, it should be fine
 
Old 04-28-2004, 07:10 AM   #8
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
thanks a lot for the help, i finally got it working. still not sure what the problem was, i cleaned up the httpd.conf file and i thnk that helped.

r
 
Old 05-19-2004, 09:29 AM   #9
Tiago Cruz
Member
 
Registered: Jan 2003
Location: Brasil - São Paulo
Distribution: RHEL, SuSE, *BSD, Debian
Posts: 36

Rep: Reputation: 15
Hei Friend!!!

I have the some problem, in Mandrake 9.1 with Apache 2.x

How you resolved this? Cleaning ALL inside httpd2.conf?

Thanks a lot!!!
 
Old 05-21-2004, 07:28 PM   #10
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
yea i got it resolved, lemme know if you want to see my the file i am using now.
 
Old 05-21-2004, 07:38 PM   #11
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
well actually i rewrote it, but somehow it had added some crap bc i was using webmin, stuff it added wasnt right i dont think.
 
Old 05-24-2004, 09:38 AM   #12
Tiago Cruz
Member
 
Registered: Jan 2003
Location: Brasil - São Paulo
Distribution: RHEL, SuSE, *BSD, Debian
Posts: 36

Rep: Reputation: 15
Thaks to reply!

It's complicade

[root@terra var]# tail -f /var/log/httpd/onec/error_log
[Wed May 19 11:39:08 2004] [error] [client 200.207.125.206] client denied by server configuration: /var/www/onec/
[Wed May 19 11:41:19 2004] [error] [client 200.207.125.206] client denied by server configuration: /var/www/onec/

What's this now?
The server _have_ permission on directory (chmod 777 -R)

[root@terra var]# cat /etc/httpd/conf/vhosts/Vhosts.conf
NameVirtualHost 200.207.125.206

<VirtualHost 200.207.125.206>
ServerAdmin tiagocruz@linuxdicas.com.br
DocumentRoot /var/www/radio
ServerName www.radionumber1.com.br
ErrorLog /var/log/httpd/radionumber1/error_log
TransferLog /var/log/httpd/radionumber1/access_log
<Directory "/var/www/radio">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


<VirtualHost 200.207.125.206>
#User apache
#Group apache
ServerAdmin tiagocruz@linuxdicas.com.br
DocumentRoot /var/www/onec
ServerName www.onec.org.br
ErrorLog /var/log/httpd/onec/error_log
TransferLog /var/log/httpd/onec/access_log
ScriptAlias /cgi-bin/ /var/www/onec/cgi-bin/
<Directory "/var/www/onec">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

===================

The apache config:

[root@terra var]# cat /etc/httpd/conf/httpd2.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/radio"


### 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...)

AddType audio/x-mpegurl .m3u

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 include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.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 proxy_module modules/mod_proxy.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 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

##New Modules for 2.0 (some are experimental)
##LoadModule file_cache_module modules/mod_file_cache.so
##LoadModule echo_module modules/mod_echo.so
##LoadModule charset_lite_module modules/mod_charset_lite.so
##LoadModule cache_module modules/mod_cache.so
##LoadModule disk_cache_module modules/mod_disk_cache.so
##LoadModule mem_cache_module modules/mod_mem_cache.so
##LoadModule ext_filter_module modules/mod_ext_filter.so
##LoadModule case_filter_module modules/mod_case_filter.so
##LoadModule case_filter_in_module modules/mod_case_filter_in.so
##LoadModule deflate_module modules/mod_deflate.so
##LoadModule optional_hook_export_module modules/mod_optional_hook_export.so
##LoadModule optional_hook_import_module modules/mod_optional_hook_import.so
##LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
##LoadModule optional_fn_export_module modules/mod_optional_fn_export.so
##LoadModule bucketeer_module modules/mod_bucketeer.so
##LoadModule logio_module modules/mod_logio.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
# Listen 81
</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>


===================


You (s) see some problem?




Tiago Cruz
Thanks in Advance!
 
Old 05-25-2004, 08:11 PM   #13
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
havent had time to look over yours throughly, sry. lemme post my virtual hosts and ill give it a look.


NameVirtualHost *:80

<VirtualHost *:80>
ServerName thorne.zoast.com
ServerAlias t.zoast.com *t.zoast.com
DocumentRoot /home/t/www
ErrorLog logs/t.zoast.com-error_log
TransferLog logs/t.zoast.com-access_log
</VirtualHost>

<VirtualHost *:80>
ServerName c.zoast.com
ServerAlias c.zoast.net *.c.zoast.net
DocumentRoot /home/r/www
ErrorLog logs/c.zoast.com-error_log
TransferLog logs/c.zoast.com-access_log
</VirtualHost>

<VirtualHost *:80>
ServerName www.zoast.com
ServerAlias zoast.com *.zoast.com
DocumentRoot /var/www/html
ErrorLog logs/zoast.com-error_log
TransferLog logs/zoast.com-access_log
</VirtualHost>

<VirtualHost *:80>
ServerName www.d.com
ServerAlias d.com *.d.com
DocumentRoot /home/d/www
ErrorLog logs/d.com-error_log
TransferLog logs/d.com-access_log
</VirtualHost>

<VirtualHost *:80>
ServerName www.actonexploration.com
ServerAlias actonexploration.com *.actonexploration.com
DocumentRoot /var/www/html/actonexploration
ErrorLog logs/actonexploration.com-error_log
TransferLog logs/actonexploration.com-access_log
</VirtualHost>

some of the sites arent really active atm , so i removed them. and there is the include file like you have yours included.

Include conf/vhosts/Vhosts.conf

lemme look yours over, dunno if i can help though.
 
Old 05-25-2004, 08:16 PM   #14
rjcrews
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 193

Original Poster
Rep: Reputation: 30
hrm i dont know a whole lot, here are some things i have a little different you might try:

<IfDefine !APACHEPROXIED>
Port 80
Listen 80
</IfDefine>

and


NameVirtualHost 192.168.1.101


again im not sure how you have things set up and how you are on network etc.. good luck with it though. looks like from your error you may have some permissions problems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 virtual host. hgb Linux - Networking 10 01-24-2009 02:05 AM
Apache2 Virtual Host SSI problems superscrappy Linux - Software 1 08-30-2005 05:04 PM
Apache2 virtual host cgi 403 Forbidden / mossy Linux - Software 15 07-27-2005 04:56 PM
apache2 help -Virtual Host- Fredstar *BSD 4 06-06-2005 01:09 PM
Can't do Apache2 virtual host different ports SK_pt Linux - Software 3 01-30-2005 07:04 PM


All times are GMT -5. The time now is 10:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration