Google Plus

How to Reinstall apache2 properly in linux

Written by Mel Kham on . Posted in Linux tutorials

If you have issues with apache2 and you want to reinstall it but you are getting errors,then here it isthe solution for you.

 

For example, me i had an issue with apache, when i tried to start it i got this error message  :

 

root@pirat9-desktop:/etc/apache2# /etc/init.d/apache2   start
.: 45: Can't open /etc/apache2/envvars

Now i want to reinstall apache, but first i need to remove it completely  (If you currently have it removed improperly, reinstall it by “sudo apt-get install apache2″ before to use the command bellow). To do that i will use this command :

 sudo apt-get remove --purge apache2 apache2-utils

This command will completely remove all apache2 configuration files and directories.
- Reinstall again apache using the normal command

sudo apt-get install apache2


Now your config files and directories in /etc/apache2 all be back and at their defaults as well as the “apache2-utils previously removed.


root@pirat9-desktop:/etc/apache2# /etc/init.d/apache2   start
 * Starting web server apache2                                 
using 127.0.0.1 for ServerName
httpd (pid 7235) already running   [ OK ]

For any question please don`t hesitate to ask us.

{loadposition user9}

Related Articles By Tags:

{loadposition user1}

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • Dema

    ok! Спасибо за подсказку, сутки не мог переустановить. :D

  • http://www.yusufpolat.com.tr Yusuef

    Thank you. :wink: :wink: :wink: :wink:

  • Zinovsky

    You are welcome

  • http://goodusers.blogspot.com sinatria

    Thank’s for information, so helping :)

  • ck

    thanks a lot.
    I install phpmyadmin and then I can’t reinstall apache2. Now everything is alright…

  • http://www.bestfinance-blog.com MortonAUDREY31

    Don’t you know that this is high time to get the loan, which would make your dreams come true.

  • Maxime

    My fu**ing god ! Thanks you so much ! :) Good job ! Thanks man !

  • Lizardzk

    thanks for your tutorial,,
    this very help me,,,,,

  • faboulaws

    thanks a lot.tried to set up SSL and my apache stopped working properly.you article helped me reset my apache on Ubuntu 12

  • http://www.facebook.com/Bryan.D.Headrick Bryan Headrick

    I did this, and I’m still getting the same error.

  • Gingelly Oil

    PERFECT! :D

  • zman360

    Thanks – helped update my localhost server. However, I notice that I have to use sudo with almost every command in the terminal window now, which is changed from previous. Is my newer apache2 version more secure? Any way to fix this so I can execute the same java programs as before? Thanks.

  • Pingback: Setting up the Apache Server | Garden GNOMEing

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Edson Carlos

|

In debian no found. I need link download install in linux debian

jacky can

|

You can actually unzip your secret archive by leaving out the -t option, instead using:

unzip newPhoto.jpg

DragonFartOutLoud

|

it went to china.

DragonFartOutLoud

|

great review! i’ve been using it as my main OS since Beta 1 release. its been a awesome ride so far :)

jet li

|

i try the method, and i unzip the image contain zip secret, i dont find the file that i was hide, where it go? and how to open it? :s

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .