4

I am trying to install amp on ubuntu using this tutorial. How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04

On the apache part of the tutorial it says the following: Set Global ServerName to Suppress Syntax Warnings Next, we will add a single line to the /etc/apache2/apache2.conf file to suppress a warning message. I can't find such a directory on the system. I have installed apache, but can't find any file of the sort.

Thanks for reading.

  • Please check if apache is installed properly. Run below command to check if that installed. dpkg -l | grep apache – sahil kataria Jul 19 '17 at 11:34
  • Here is a picture of it imgur.com/a/Jg9Fa I tried formatting it but it didn't show correctly. Sorry – Morgoth Jul 19 '17 at 11:44
  • 1
    Generally if it does not exist your create the file. – Rinzwind Jul 19 '17 at 12:20
  • 1
    Here you are the default content of /etc/apache2/apache2.conf from Ubuntu 16.04. To suppress the above warning message, you need to add the directive ServerName localhost at the bottom of the file (or change localhost with some concrete FDQN). Just type sudo nano /etc/apache2/apache2.conf, paste the conten of the above link by shift+insert, save and exit by ctrl+o/ctrl+x. Then restart Apache: sudo systemctl restart apache2.service. Could you edit your question with the output of ls -l /etc/apache2/? – pa4080 Jul 20 '17 at 7:25
0

I had this happen yesterday to a friend's laptop.

If you had installed apache or related software using any unsupported PPAs, remove them using ppa-purge:

sudo apt install ppa-purge
sudo ppa-purge ppa:whatever/ppa

Remove apache2 and unused dependencies:

sudo apt autoremove apache2

Remove residual configuration files:

dpkg -l | grep '^rc' | awk '{print $2}' | xargs sudo apt-get purge

(Source: https://askubuntu.com/a/376281)

Now install apache again:

sudo apt install apache2

This worked in bionic.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.