Jump to content

Another "Apache Vhosts woes" thread


javaguy
 Share

Recommended Posts

Okay, I've Googled this to death, read through all these forums, posted on various ones. Finally I gave up a number of weeks ago, but now I'm back at it with a vengence and am going to hammer at it until I get it working.

 

I'm running Mandrake 9.2 and trying to run Apache 2. I have three domains that I want to run on my box, but for the moment I just want to get one working before I move the other two from their current stable environment.

 

I'm using ZoneEdit. Now everyone says, and all the documentation says, that in my Vhosts.conf I should use an asterisk with each host declaration:

 

NameVirtualHost *

<VirtualHost *:80>
 ServerName www.benjaminalexandermckee.com
 ServerAlias benjaminalexandermckee.com
 DocumentRoot /home/javaguy/www/prod/benjaminalexandermckee
</VirtualHost>

 

But when I do that and try to connect to http://benjaminalexandermckee.com I get a message that says my browser is speaking plain HTTP to an SSL-enabled server port, which should not be the case.

 

When I change the vhost to say...

 

<VirtualHost 24.209.107.57:80>
...

 

...then I get a message saying I don't have permission to access / on this server.

 

Now before everybody asks, the directory given by DocumentRoot is readable and executable to Others, and everything inside of it is readable to Others.

 

Inside my commonhttpd.conf file I have an entry that looks like this:

 

<Directory /home/javaguy/www/prod/benjaminalexandermckee>
 Options Indexes FollowSymLinks MultiViews
 AllowOverRide All
 Order allow,deny
 Allow from all
</Directory>

 

I'm utterly mystified by this. And I don't want to have to hard-code the IP address in the VirtualHost directive. I want to be able to use an asterisk so that I can use ZoneEdit. I'd also like to have a *:80 and *:443 version of each virtual host so that I can use SSL when I want. Has anybody gotten this to work? All the forum posts I've read talk about how it's theoretically possible, but the person actually doing it always says he got it to work by dropping the asterisk and hard-coding the IP address, which isn't an option for me.

 

Thanks in advance,

Sam

Link to comment
Share on other sites

Will look at it some more later when i have time.

BUT, whats hits me straight away is you have commented out (#) your document root.

You can server docs from whatever dir you like, but you must have a document root. This is normally /var/www/html but if for some reason you want some other directory, then set that to be your root directory. example:

DocumentRoot /home/someplace/

Link to comment
Share on other sites

Yes, I have sudoers entry and an alias for it:

alias bounce='sudo /etc/rc.d/init.d/httpd restart'

 

 

and I get

[javaguy@dhcp024-209-107-057 javaguy]$ bounce
Shutting down httpd2:                                           [  OK  ]
Starting httpd2:                                                [  OK  ]
[javaguy@dhcp024-209-107-057 javaguy]$

Link to comment
Share on other sites

Put the commonhttpd.conf file back to the default, you should be altering the httpd.conf file instead, not this one. In case you can't remember what the default looks like:

### Common server configuration
#
User apache
Group apache

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin root@localhost

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
# DO NOT MODIFY THIS ONE, USE httpd.conf and httpd-perl.conf
DocumentRoot /var/www/html


#
# 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 
# permissions.  
#
# Also, for security, we disable indexes globally
#
<Directory />
   Options  -Indexes FollowSymLinks MultiViews
  AllowOverride All
</Directory>

#Restricted set of options 
<Directory />
 Options All
 AllowOverride All
 <IfModule mod_access.c>
   Order deny,allow
   Allow from all
 </IfModule>
</Directory>

Link to comment
Share on other sites

Okay done (and updated the copy in my link). Still no luck, but now what do I need to look at?

You don't have a link to your httpd.conf file above, that is the file you should be editing.

That file is in /etc/httpd/conf/httpd.conf

Link to comment
Share on other sites

It's the install that Mandrake 9.2 did when I installed the OS, and it worked as far as showing the default "It works" web site until I started messing with virtual hosts and apparently screwed it up myself. ;)

 

I don't recall seeing an httpd.conf file--in fact I recall thinking it a little odd that there was an httpd2.conf. I figured it just had something to do with the fact I'm running Apache2. Anyway, I uninstalled the rpm and reinstalled it, but still no httpd.conf.

 

If I really need this file, can somebody post one?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...