# Apache mod_vhost gone?!

## shinobSS

Hiya

I've been banging my head over this one. Whenever I start up apache, I'm getting the error:

NameVirtualHost [internal ip]:80 has no VirtualHosts

After tracking a bit in Google, I think I found my problem: I dont have mod_vhost in my apache.conf, as a matter of fact, I dont have a mod_vhost at all..just a mod_vhost_alias.

Are those two the one and the same? Or do I need to do something specian to get mod_vhost in?

As well..something funky is up with my apache.conf...take a look:

```

### Dynamic Shared Object (DSO) Support

### 

###

LoadModule mmap_static_module modules/mod_mmap_static.so

LoadModule env_module         modules/mod_env.so

LoadModule config_log_module  modules/mod_log_config.so

LoadModule agent_log_module   modules/mod_log_agent.so

LoadModule referer_log_module modules/mod_log_referer.so

LoadModule mime_magic_module  modules/mod_mime_magic.so

LoadModule mime_module        modules/mod_mime.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule status_module      modules/mod_status.so

LoadModule info_module        modules/mod_info.so

LoadModule includes_module    modules/mod_include.so

LoadModule autoindex_module   modules/mod_autoindex.so

LoadModule dir_module         modules/mod_dir.so

LoadModule cgi_module         modules/mod_cgi.so

LoadModule asis_module        modules/mod_asis.so

LoadModule imap_module        modules/mod_imap.so

LoadModule action_module      modules/mod_actions.so

LoadModule speling_module     modules/mod_speling.so

LoadModule userdir_module     modules/mod_userdir.so

LoadModule proxy_module       modules/libproxy.so

LoadModule alias_module       modules/mod_alias.so

LoadModule rewrite_module     modules/mod_rewrite.so

LoadModule access_module      modules/mod_access.so

LoadModule auth_module        modules/mod_auth.so

LoadModule anon_auth_module   modules/mod_auth_anon.so

LoadModule dbm_auth_module    modules/mod_auth_dbm.so

LoadModule db_auth_module     modules/mod_auth_db.so

LoadModule digest_module      modules/mod_digest.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 example_module     modules/mod_example.so

LoadModule unique_id_module   modules/mod_unique_id.so

LoadModule setenvif_module    modules/mod_setenvif.so

#  Reconstruction of the complete module list from all available modules

#  (static and shared ones) to achieve correct module execution order.

#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]

```

nothing is underneath that..is that sposed to be that way??

Thanks for any help   :Smile: 

----------

## shinobSS

 *Quote:*   

> nothing is underneath that..is that sposed to be that way??

 

Sorry, realized how that can be taken wrong..

What I mean is that it specifically states that if you change anything, change it there as well..so, shouldnt there be a replica of that exact list underneath it??

Thanks again

----------

## rac

 *shinobSS wrote:*   

> After tracking a bit in Google, I think I found my problem: I dont have mod_vhost in my apache.conf

 

I don't think you need to do anything with modules to do virtual hosting, and I can't see any documentation for mod_vhost on http://httpd.apache.org.  mod_vhost_alias seems to have some directives that make some types of virtual hosting setups easier, but even it shouldn't be necessary.  VirtualHost and NameVirtualHost are in the Apache core.

 *Quote:*   

> As well..something funky is up with my apache.conf...take a look:
> 
> ```
> 
> #  Reconstruction of the complete module list from all available modules
> ...

 

No, and I think this is really where the problem lies.  There should be lots more good stuff under there.  Do you have a backup of your apache.conf you can use to restore it?  If not, you could try to save what you can, delete it and reemerge Apache to get a default one as a starting point.

----------

## shinobSS

?! It came back with the same config file..

And, just to be sure, I purged all of my apache directories and files (except when it came to webmin) and re-emerged..same file.

Any ideas?

----------

## rac

Sorry, I must have been researching my post when your second one came in.  I interpreted your first post to mean that the end of your quote was the end of the file.

What I have underneath that quote is ClearModuleList, followed by several AddModule directives that seem to mirror the LoadModules of the previous section.  Do you have this now?

I'm assuming you didn't have any errors emerging apache?  What version of the apache ebuild are you using?  I guess while we're at it, compiler version and CFLAGS might potentially be useful, too.

----------

## shinobSS

Apparently I missed something during my first nuking, because I went through and nuked everything again. This time I got a fresh apache.conf to work with, which interestingly enough, had the mod_vhost_alias built into it already...guess I must have fubarred my apache.conf alot more than i thought I did while going left with webmin  :Wink: 

I'll post once everything's in, see if I have the same problems..

----------

## shinobSS

Excellent..

After about 30 mins of building mod_ssl and mod_php, editing apache.conf and commonapache.conf, shinobi.mine.nu is back up.

Just one more step, and I'm done..and that's setting up another vhost for my IP.

Just out of curiosity, Rac, do you use vhosts? If so, how do you have it set up? 

Thanks =D

----------

## rac

 *shinobSS wrote:*   

> Just out of curiosity, Rac, do you use vhosts? If so, how do you have it set up? 

 

Yes, but not on Gentoo yet.  The virtual host apache installations I have set up run on Debian, and the basic idea is to specify NameVirtualHost *:portnum, where 80 is probably most common, but most of my vhosts use 443 for HTTPS.  Then I have several <VirtualHost> directives, with ServerName set to the name of the virtual host, and separate DocumentRoot, ErrorLog and TransferLog definitions.

I have the advantage of being able to request changes to the authoritative DNS records for the domain where these servers lie.

I have always found the Apache Virtual Hosting Documentation to be useful.

----------

