0

I've just rented a virtual server ubuntu 14.04 with apache2 and php running. I know a lot of the *nix world but this is my first virtual server so I'm a bit newbie with it and with all the web/http/domains world.

So, I have an ip, say 1.2.3.4. I have ssh root access to it, I've created an info.php file in /var/www/html directory (apache DocumentRoot is /var/www/html) but if I connect with the browser to http://1.2.3.4/info.php it says Not Found.

If I connect to http://1.2.3.4 is shows a Plesk Web Server's Default Page.

a2query -m php5 says "php5 (enabled by maintainer script)"

What am I missing ?

1

The problem might not be with the PHP.

Upload a static html file or a picture to /var/www/html and try accessing it through the browser - if it shows then it is probable a PHP problem and if it displays another 404 it might be a problem with the apache config... For example the default site that is enabled might reside in another folder.

  • I was hoping in another type of answers, like "of course it cannot work, because..." but, indeed, yours indicates that all should work but it doesn't, it's the worst case. I uploaded a picture and still got a Not found error. Thanks anyway. – marco Jun 5 '15 at 20:34
  • Ok, you were right, thanks again. Checking /var/log/apache2/error.log I've found the problem '[Fri Jun 05 22:39:40.877182 2015] [:error] [pid 7394] [client <...>] script '/var/www/vhosts/default/htdocs/info.php' not found or unable to stat' How and where is this set as default site ? for sure not in /etc/apache2/sites-enabled/ – marco Jun 5 '15 at 20:47
  • Check the other config files in /etc/apache2/ - the default site might be declared there. You can also make a global search in files for the word htdocs (if you don't know how, you can try this link for more info - stackoverflow.com/questions/16956810/… ) – Sledge Hammer Jun 5 '15 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.