How do I revert to original installation of Apache2 - apache

Okay so a long time ago I was recklessly changing stuff in my Apache2 folder and now I don't know what's wrong and I don't want to take the time to figure it out. I just want to delete folder and then reinstall it with the factory defaults. Is there a way I can do that without doing a complete backup and then reinstalling OSX?

Completely remove all Apache2 packages with purge option.
apt-get remove --purge apache2 apache2-utils
Then install again
apt-get install apache2

I decide to just backup my hard drive and do a clean install of OSX

Related

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

Terminal command in fedora

What does the yum and -y means
yum install httpd -y
new to fedora. please guide me.
the above code will install Apache server in fedora
yum is a software package manager that installs, updates, and removes packages on RPM-based systems. It automatically computes dependencies and figures out what things should occur to install packages. yum makes it easier to maintain groups of machines without having to manually update each one using rpm.
-y means that we did't want to gave yes to install any package (here httpd)
httpd installs apache web server
Thanks for Support and advice

Facing error while installing Apache2 in Ubuntu 14.04 'has no installation candidate'

I don't know what I did but I'm not able to install apache2 in my Ubuntu 14.04.
When I use sudo apt-get install apache2 I face this error.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libapache2-mpm-itk:i386 libapache2-mpm-itk
E: Package 'apache2' has no installation candidate
First make sure that your proxy is disabled as that can cause a problem sometimes.
Then run the following.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2
If that doesn't work you can always compile your own apache2. A tutorial for that is located here: https://www.virgohacks.net/install-apache-2-4-mysql-5-6-php-5-5-source-ubuntu-14-04/
Good luck

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.

Apache automated installation

Is it possible to install Apache with a script/batch file?
Sure is...
apt-get install apache2
right inside the ol' batch file, depending on your package manager.
If you wanted to install from source, just
wget linktoapachesource.com
and put all the steps you would normally take inside a bash script.