Accidentally deleted /etc/apache2/ folder, what can I do? - apache

I tried things like "brew install homebrew/apache/httpd24" but nothing seems to retrieve the "/etc/apache2" folder. What can I do?

if you're on Ubuntu 14.04, this worked for me , you can check :
sudo apt-get remove --purge apache2 apache2-utils
sudo apt-get install --reinstall apache2 apache2-utils

Related

Apache2 uninstall issues

I had to recently uninstall Apache2 due to some broken package issues.
However, when I check with
`$ whereis apache2` Iget response `apache2:`
I have used $ sudo -rf /etc/apache2,$ sudo apt-get remove apache2-common
$ sudo apt-get --purge remove apache2 $ sudo apt autoremove but I have still not managed to completely remove all traces of the Apache2 from my Linux Mint 19.3 Cinnamon.
I shall highly appreciate if someone guide me in the right direction.
According to the commands above you completely removed Apache2.
apt remove removes the binaries of a package
apt purge removes everything related to the apache2 package including the configuration files.
In your case whereis is showing that there are no binaries, sources or manual pages of the apache2 package.

Apache config file not being installed

I had apache2 installed on my raspberry pi 4 and was getting some strange behavior so I removed it via apt remove apache2, removed the /etc/apache2 directory and reinstalled by sudo apt-get apache2 -y.
After reinstallation the server would not start, I determine that there was no apache2.conf file in /etc/apache2.
I've tried installing and reinstalling several time to no avail. What am I doing wrong?
try
sudo apt-get purge apache2
If you just want a light-weight http server you might want to try Nginx as a replacement.
sudo apt-get --reinstall install apache2

Apache2 command such as a2enmod and a2ensite no working its showing command not found in Ubuntu

I am deploying Flask application in Apache2 server during this i need to run a command for enabling mod_wsgi by using:
sudo a2enmod wsgi
but its showing:
sudo: a2enmod: command not found
please help
thanks
I had the same problem with using Ubuntu 16.04 in AWS. However, installing apache2 along with libapache2-mod-wsgi and python-dev solved the issue.
Try:
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-wsgi python-dev
Then,
sudo a2enmod wsgi
I share this tips because it append to me :
If you enter into the root account with su, the /usr/sbin folder is not in the path and the a2enmod command is not found...
So you have to use su - instead ;)
This can happen if you switch to root user as su root instead of su - on Debian Buster
Installation debugging
For asking about installation debugging, you have to post (and think) about
Architecture (hardware)
OS with version
Host attibution (server, desktop, other)
Procedure followed for installation
Software (apache) version
Anyway
You could try to reinstall your package. If under Ubuntu, you could try:
sudo apt update &&
sudo apt reinstall apache2 libapache2-mod-wsgi
Then rerun:
sudo a2enmod wsgi

apt-get install apache2 wont' install configuration files

I had some problems with apache2, so I decide to get a fresh start.
sudo apt-get --purge apache2
It won't clear my config files. So I manually rm the /etc/apache2 folder.
Then "sudo apt-get install apache2" won't create /etc/apache2 folder anymore. Tried clear apt/cache, won't help. Tried update/change different source.list, won't help.
Any hint there the problem might be?
Thank a lot.
The configuration files are created on the installation of the package apache2.2-common. The command apt-get install --reinstall apache2.2-common should do the trick.

Apache2 not installing /etc/apache2 ubuntu 12.04

I'm trying to recover from a recent problem upgrading to apache2.4 and php 5.5. I've uninstalled apache2 and deleted the /etc/apache2 folder but when I install apache2.2 it's not creating /etc/apache2 folder so doesn't start.
Do as below:
sudo apt-get update
sudo apt-get remove apache2
sudo apt-get purge apache2
sudo apt-get update
sudo apt-get install apache2
Do as following
sudo apt-get remove --purge apache2 apache2-utils
sudo apt-get install --reinstall apache2 apache2-utils