Question

How to solve problems with LAMP Webserver

Posted August 28, 2015 5.1k views
UbuntuApacheGetting StartedLAMP Stack

I have been following the tutorial to setup LAMP on my server: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-14-04
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?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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!

Submit an Answer