use apache2 as default server

February 4, 2015 699 views

I was setting up fail2ban and using nginx to send email to me on an ip is banned.

However, I was running LAMP stack, now when I visit my site, nginx default page is shown. How do I roll back to use Apache2 as my default server?

Im on Ubuntu 14.04

  • My first thought is you could set up virtualhosts in Apache for your domain:

    which tells Apache to handle that domain(s)

    I have not tested that, but in theory it could work.

    by Justin Ellingwood
    The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
  • I am a bit confused by your question as neither apache or nginx have the ability to send emails. While scripts running on your web server can call an SMTP server or sendmail instance on your droplet the choice of web server should not affect your ability to send messages.

    To completely remove nginx you can use the command:

    sudo apt-get purge nginx

    Be aware this will delete both nginx and all it's configuration files.

    Then to install apache2 you can run

    sudo apt-get update
    sudo apt-get install apache2
  • Its okay now i have solved it. I originally created my droplet with LAMP stack, now I switch completely to nginx(LEMP) for my web server. @ryanpq sorry about confusing you, i'm using nginx mail.

    thanks for helping

Be the first one to answer this question.