Apache2 not installing /etc/apache2 ubuntu 12.04 - apache

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

Related

Ubuntu apache failed to start permission denied

Im new in ubuntu
I got an error when I start the apache2
What I did first was uninstalling the apache2
sudo apt-get purge apache2
then I removed the /usr/sbin/apache2 with sudo rm -rf /usr/sbin/apache2
then install again the apache2
sudo apt-get install apache2
After that I tried to start the apache2 but it was failed to start
this is the error

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

Provision a vagrant box with PHP 7.0

I am trying to provision an ubuntu/trusty64 vagrant box with Apache 2.4 and PHP 7.0 but have not succeeded.
This is my provisions.sh script:
#!/usr/bin/env bash
# Vagrant instance provision script
# Php 7.0
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install php7.0 -y
# Apache 2.4
sudo add-apt-repository ppa:ondrej/apache2 -y
sudo apt-get update
sudo apt-get install apache2 -y
if ! [ -L /var/www ]; then
rm -rf /var/www/html
ln -fs /vagrant /var/www/html
fi
When I vagrant up, apache works fine but PHP does not. However, if I remove the PHP installation line,
sudo apt-get install php7.0 -y
and execute it from the command line after the VM is running, PHP works fine.
Any ideas why this is or how to fix the provisioning of the box so that PHP works from the start?
The initial question already contains the answer. It is the order in which the commands are being executed. If PHP gets installed before Apache is installed, then certain configuration files will not automatically be configured. This can be done manually, but requires certain know-how. I yet have to come across easy tutorials or manuals.
#!/usr/bin/env bash
# Vagrant instance provision script
# Php 7.0
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
# Apache 2.4
sudo add-apt-repository ppa:ondrej/apache2 -y
sudo apt-get update
sudo apt-get install apache2 -y
if ! [ -L /var/www ]; then
rm -rf /var/www/html
ln -fs /vagrant /var/www/html
fi
# Changed this line
sudo apt-get install php7.0 -y
I too have been facing this issue. So hopefully with this answer I provide some help to others.

How to run Rebol on Freya

Been trying to run rebol-view-278-4-2 on Elementary OS "Freya" (a variant of Ubuntu 14.04 LTS).
I keep getting this error:
error while loading shared libraries: libXaw.so.7: cannot open shared object file: No such file or directory
I went ahead and tried to install the missing library but to no avail.
These are the steps I took to get R2 core and view working on Ubuntu 14.04 LTS "Trusty," so I would imagine that this would also work on Freya:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get update
sudo apt-get install libx11-6:i386
sudo apt-get install libxext6:i386
sudo apt-get install libxaw7:i386
sudo apt-get install libfreetype6:i386
sudo apt-get install xfonts-100dpi xfonts-75dpi
(I prefer to keep the package install steps separate in case one of them fails.)

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

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