Reinstall Apache2, after remove on Ubuntu 16.04

12,407

Solution 1

It happened to me as well and I fixed it by:

  1. uninstalling the package
  2. $ whereis apache2
  3. manually remove anything related to it
  4. fresh package reinstall

Solution 2

Finally, it works! :)

After install php, i typed in terminal:

gksu gedit /etc/apache2/apache2.conf

Then add the following line to the end of the file.

Include /etc/phpmyadmin/apache.conf

Then restart apache

/etc/init.d/apache2 restart

Thanks for help @Hellas and i hope this command helps somebody!

Share:
12,407

Related videos on Youtube

Diaconu Eduard
Author by

Diaconu Eduard

Updated on September 18, 2022

Comments

  • Diaconu Eduard
    Diaconu Eduard almost 2 years

    I have few errors with mysql-server, and after i tried more command in terminal, i don't find a proper way to resolve.

    I decided to remove all (phpmyadmin, mysql, apache2). Mysql and phpmyadmin, remove successfully, but i have problem with apache2..

    For Apache2, i use this command in terminal:

    sudo apt-get autoremove
    udo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
    

    After that, i try install again apache2.

    sudo apt-get update
    sudo apt-get install apache2
    

    But, localhost refused to connect.

    In etc/hosts.conf is empty, what is necessary to add there? Maybe, is possible to exist another problem?

    Thank you for help!

  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    Thanks for your reply and help! :) Can you offer more details about 4 step? (what command to use in terminal).
  • Hellas
    Hellas almost 8 years
    sudo apt-get install apache2 --- installs apache2; if you need more info I need more info myself on what do you what to use it for, in order for me to know how to help you
  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    Thank you again! I use apache2 for website host. I try your command in terminal, but i recive this error: E:Unable to locate package apache2---installs .
  • Hellas
    Hellas almost 8 years
    sudo apt-get install apache2 ( --- installs apache2 was only the description of what it does, meaning it only installs the service)
  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    Oh, sorry for mistake. It works, thank you so much! I want to use apache for website host. Now i try install phpmyadmin and mysql service .
  • Hellas
    Hellas almost 8 years
    Good. No problem. PS: Bafta in continuare :D
  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    Uh, multumesc tare mult :)) Now, when i try to install libapache2-mod-auth-mysql and php-mysql phpmyadmin, i recive: Unable to locate package libapache2-mod-auth-mysql and php7-mysql. Do you have idea what can i do for solve this...?
  • Hellas
    Hellas almost 8 years
    Please write the full command line you have entered preceded by $ (example: $ sudo apt-get install apache2 )
  • Hellas
    Hellas almost 8 years
    you might've tried to install outdated packages; some new ones are out there and include the old ones; try $ sudo apt-get install php5-mysql phpmyadmin
  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    First time, i try to use sudo apt-get install libapache2-mod-auth-mysql php7-mysql phpmyadmin . I typed your command, but i revice: E: Package 'php5-mysql' haso no installation candidate . (Multumesc tare mult de ajutor, de azi dimineata tot ma chinui. Am programele functionale pe windows, dar sunt nevoit sa fac switch-ul pe Ubuntu, cu care din pacate nu am mai avut tangente si ma lovesc de tot felul de erori)
  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    Actually, now i find a command to install php, and works. :) But, still have problems with phpmyadmin, when i try to install i receive: Errors were encountered while porcessing: javascript-common libapache2-mod-php7.0 E: SUb-process /usr/bin/dpkg returned an error code(1) and for that, i don't find a solution to solve.
  • Hellas
    Hellas almost 8 years
    I will try to get back at you tomorrow, as I have to respect the fact that is a Saturday night incoming :) Catch you tomorrow!
  • Diaconu Eduard
    Diaconu Eduard almost 8 years
    Oh, thank you so much and enjoy the Saturday! :)