# [Solved] What do I need to do to remove Apache totally?

## CurtE

I need to start from scratch with Apache.  I've made too many changes (too long ago) to remember what I did.  I can emerge --unmerge apache but that doesn't remove the config files and such (or is there an option I don't know).

I just want to make sure I'm not leaving leftovers.Last edited by CurtE on Sun Feb 06, 2011 3:17 am; edited 1 time in total

----------

## gerdesj

 *CurtE wrote:*   

> I need to start from scratch with Apache.  I've made too many changes (too long ago) to remember what I did.  I can emerge --unmerge apache but that doesn't remove the config files and such (or is there an option I don't know).
> 
> I just want to make sure I'm not leaving leftovers.

 

```

#rm -Rvf /etc/apache2

#rm /etc/conf.d/apache

#rm -Rvf /var/www

```

The last one will remove all content - are you sure!

Apache is a bit of a game:

Decide whether you want to USE +vhosts  (probably not to start with)

Set the modules you want in /etc/make.conf:

APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd \

                 authn_dbm authn_default authn_file authnz_ldap authz_dbm \

                 authz_default authz_groupfile authz_host authz_owner \ 

                 authz_user autoindex cache cgi cgid dav dav_fs dav_lock \

                 dbd deflate dir disk_cache doc env expires ext_filter file_cache \

                 filter headers ident imagemap include info ldap log_config \

                 logio mem_cache mime mime_magic negotiation proxy proxy_ajp \

                 proxy_balancer proxy_connect proxy_http rewrite setenvif so \

                 speling ssl status suexec unique_id userdir usertrack vhost_alias"

emerge it

Enable stuff in /etc/conf.d/apache with -D options (look in /etc/apache2/modules.d/ files for what -D options to use)

emerge the webapps

Cheers

Jon

----------

## CurtE

Thanks.  :Smile: 

----------

## gerdesj

One other thing.  Once you've got the hang of getting things running in /var/www/localhost look into virtual hosts:

Set the vhost USE flag

Add additional IP addresses to your machine (not 100% necessary unless you use SSL)

Add external DNS entries for them if you can or set up your own internal DNS - its a good mental exercise!

Create a skeletal /etc/www/vhost.example.co.uk directory for each one

Add a new entry in /etc/apache2/vhosts.d

Use webapp-config to install and maintain each webapp

When you emerge an app with USE=+vhosts it will give you instructions on what to do

Gentoo is absolutely excellent for this sort of thing, especially now that the old weird layout has been binned.  Also note that most apps can be enabled using the modules.d stuff enabled with a -D option in /etc/conf.d/apache2, rather than figuring out what to put in yourself - the devs have done the hard work for you translating all that /usr/local stuff you see in install docs to the "proper" distro integrated layout.

Cheers

Jon

----------

