How to solve problems with LAMP Webserver

August 28, 2015 714 views
Apache Getting Started LAMP Stack Ubuntu

I have been following the tutorial to setup LAMP on my server:
I have also setup my domain with DigitalOcean nameservers, A record & CNAME record.

When I visit my public IP address or my domain name I always get "This page can't be displayed" - I never managed to get any kind of Apache "It Works" page, or to access any php pages I created at /var/www/html/index.php

Is there any way I can find out what's gone wrong?

2 Answers

Hello dominicduffin,

You could start with reading logs and checking configurations. What does the apache log give you for output when this happens? /var/log/apache2/

What kind of virtualhost did you setup? What did you put inside the php file, try to use a simple .htmlfile instead and check if that works.

  • In /var/log/apache2/error.log I have:

    [mpm_prefork:notice] [pid 1148] AH00169: caught SIGTERM shutting down
    [mpm_prefork:notice] [pid 2894] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations
    [core:notice] [pid 2894] AH00094: Command line: '/usr/sbin/apache2'

    I did not setup a virtualhost - do I need to do this before anything will work? Should I be able to access something by navigating to my public IP without setting up a virtualhost?

    The /var/www/html/index.html is the Ubuntu 'It works' file

    I have tried the /etc/apache2/mods-enabled/dir.conf file with both index.html & index.php in first priority, but I can't get either the index.html or index.php files.

I have found that the firewall was causing the problem - fixed now!

Have another answer? Share your knowledge.