Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't get apache to work wth my vhosts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
smpolymen
n00b
n00b


Joined: 27 Apr 2007
Posts: 4

PostPosted: Wed Jun 06, 2007 7:18 am    Post subject: Can't get apache to work wth my vhosts Reply with quote

Well, I merged apache a while ago but am just now trying to actually do something with it. I'm pretty sure it's almost exactly as I merged it with very little config changes, I think just userdirs. Everything seems to work fine, I have a /var/www/localhost that acts as the default vhost, but when I add a host, everthing seems to fall apart. when I type http://localhost, it gives me a Could not connect to host localhost. And the vhost I'm trying to setup (mydomain.com) gives me a connection timed out. At first i tried to set up a dynamic vhost because that's more what I want, but failing that, I tried just a plain vhost and it still doesn't work.
Here is my /etc/apache2/vhosts.d/10_dynamic_vhosts.conf, I commented out the dynamic stuff but can anyone see some obvious error or misunderstandng? I'm kind of new at this and it's 3AM for me so maybe I'm just missing something?
Code:

#<IfDefine DYNAMIC_VHOSTS>
        UseCanonicalName Off
        LogFormat "%V %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"" dynamic_vhosts
        CustomLog logs/access_log dynamic_vhosts
        <VirtualHost *:80>
                ServerName mydomain.com
                ServerAlias *.mydomain.com
                DocumentRoot /var/www/mydomain.com/htdocs


                <Directory "/var/www/mydomain.com">
                        Options -Indexes +FollowSymLinks +MultiViews
                        AllowOverride All
                        Order allow,deny
                        Allow from all
                </Directory>

#               <IfModule mod_vhost_alias.c>
#                       # example.com              -->  /var/www/vhosts/example.com/htdocs
#                       # www.example.com          -->  /var/www/vhosts/www.example.com/htdocs
#                       # a.www.example.com        -->  /var/www/vhosts/a.www.example.com/htdocs
#                       # www.example.com/cgi-bin  -->  /var/www/vhosts/www.example.com/cgi-bin
#                       VirtualDocumentRoot /var/www/%0/htdocs
#                       VirtualScriptAlias /var/www/%0/cgi-bin
#
#                       # CGI Directives
#                       <DirectoryMatch "^/var/www/[^/]+/cgi-bin">
#                               AllowOverride None
#                               Options ExecCGI
#                               <IfModule mod_access.c>
#                                       Order allow,deny
#                                       Allow from all
#                               </IfModule>
#                       </DirectoryMatch>
#               </IfModule>
        </VirtualHost>
#</IfDefine>
Back to top
View user's profile Send private message
mudrii
l33t
l33t


Joined: 26 Jun 2003
Posts: 789
Location: Singapore

PostPosted: Wed Jun 06, 2007 7:46 am    Post subject: Reply with quote

try to uncomment
#<IfDefine DYNAMIC_VHOSTS>
#</IfDefine>
_________________
www.gentoo.ro
Back to top
View user's profile Send private message
smpolymen
n00b
n00b


Joined: 27 Apr 2007
Posts: 4

PostPosted: Wed Jun 06, 2007 3:37 pm    Post subject: Reply with quote

I can't get to that pc for a while, but I have -D DYNAMIC_VHOSTS in /etc/conf.d/apache2 and I had that uncommented when I tried the "dynamic solution." With the dynamic solution, all the lines were uncommented and it didn't have ServerAlias and DocumentRoot I also tried it without ServerName to no avail. Without /etc/apache2/vhosts.d/10_dynamic_vhosts.conf , I get the default apache page (the stuff in /var/www/localhost) when i type in localhost or mydomain.com. I feel better after some sleep though and ready to approach this problem with a clear head. I just won't be able to actually check anything untill maybe 4PM EST so I'll try it then.
Back to top
View user's profile Send private message
smpolymen
n00b
n00b


Joined: 27 Apr 2007
Posts: 4

PostPosted: Wed Jun 06, 2007 8:06 pm    Post subject: Reply with quote

Ok... I figured it out. I had copy/pasted the CustomLog line without checking if that place (ServerRoot/logs/access_log) was correct.

tail /var/log/apache2/error_log:

[Wed Jun 06 03:01:48 2007] [error] (2)No such file or directory: could not open transfer log file /usr/lib64/apache2/logs/access_log.
Unable to open logs

Changed the Customlog to point to the right place (/var/log/apache2...) and everything works fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum