LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-11-2010, 02:58 PM   #1
kaos_king
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Rep: Reputation: 0
LAMP/Apache problem - Could not reliably determine the server's fully qualified D/N


Hi all,

Firstly i want to say that the forum is great and answered many questions I have had in the past as im a linux n00b, but now ive got a question I couldnt find the answer for and I think its because im a n00b.

So, i installed LAMP following this guide - Clicky - and all went well.

After changing the permissions to "/var/www" I tested it and it seemed to be working fine according to the guide, however some of my pages just display blank. I can get some html files to display, but it seems to be php ones that arnt working.

I thought id restart apache to see if that was the problem and it fails to giving the result:

Code:
 * Restarting web server apache2                                                apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
So, all the other solutions i found to this was to add ServerName to "/etc/apache2/httpd.conf" but my httpd.conf is empty (im sure that cant be right) but i added the ServerName anyway putting:

Code:
ServerName localhost
but that produces the same results.

If anyone would be able to give me any help on this it would be massively appreciated.

- I dont know why my httpd.conf is empty
- Im not sure if the apache not restarting and the displaying blank pages are related

Cheers guys....
 
Old 06-11-2010, 04:32 PM   #2
dafydd2277
Member
 
Registered: Mar 2010
Posts: 58

Rep: Reputation: 5
httpd.conf being empty is the more worrisome thing. Fixing that should solve the FQDN problem.

My inclination would be to do a standalone installation of apache, and see if you get a good httpd.conf out of that.

dafydd
 
Old 06-11-2010, 04:41 PM   #3
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,298

Rep: Reputation: 123Reputation: 123
OK, so you are a bit confused here
1) That about the "Could not reliably determine the server's fully qualified domain name" is because you don't have a FQDN (fully qualified domain name). This is not a real problem unless you're running an internetserver & have a public domain.

2) The problem with some pages not displaying, you probably don't have php correctly installed.
I don't know what distro you're running so cant' give exact info but check your installer (be it yast, apt-get, synaptic or whatever) for php.
Edit: These packages I've found are often needed:
php-pear php5 php5-gd php5-mysql (the last one of course only if you use MySQL)

3) httpd.conf is normally empty today.
You'll find the config in apache2.conf instead - however, httpd.conf is read in so it's quite okay to put things there.

Last edited by pingu; 06-11-2010 at 04:49 PM. Reason: Adding php fileinfo
 
Old 06-11-2010, 05:06 PM   #4
kaos_king
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks, i'll start with reinstalling php and apache, however as i installed "lamp-server^" i dont know what the individual package names are for them. I checked for installed files in synaptic with the filter to see all the packages I had for "php" and "apache". Which ones should I reinstall?

Here's screenshots of synaptic manager with each filter:

PHP List
Apache List
 
Old 06-11-2010, 05:13 PM   #5
kaos_king
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Just seen your edit pingu. I didnt have php-pear installed and so i added that, and also reinstalled php-gd & php-mysql.

Retried a page and its still blank? Any ideas?
 
Old 06-11-2010, 05:18 PM   #6
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,298

Rep: Reputation: 123Reputation: 123
OK so you have php installed.
You need to check if it's enabled, this should be in apache2.conf :
Code:
LoadModule php5_module        modules/libphp5.so
AddHandler php5-script php 

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html       php
Don't forget to restart apache if you edit the config-files (#sudo apache2ctl restart)
 
Old 06-11-2010, 05:51 PM   #7
kaos_king
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Ok, i added your block of code into my apache2.conf as it was not there.

I restarted apache at which it said:

Code:
[Fri Jun 11 22:49:18 2010] [warn] module php5_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Retried a php page and its still blank?
 
Old 06-11-2010, 06:07 PM   #8
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,298

Rep: Reputation: 123Reputation: 123
Weird...
Code:
module php5_module is already loaded
So php is installed & enabled - and has been all the time.
Let's get back to the beginning:
Quote:
I can get some html files to display, but it seems to be php ones that arnt working.
We need to find out the exact cause of the problem, it might not be php-related at all.
"..some html files.." you say, and "...it seems to be php..."
Have you tested php?
If not, do that:

Create a PHP file. Name it test.php. The entire contents of the file are:
Code:
<?php
echo("<h1>Yay! PHP and Apache Work!</h1>");
?>
Copy this file to the document directory (/var/www)
Load this page in your browser by using the following URL: http://localhost/test.php

If that works (and I think it will), check permissions for the files you can't access.
Check the directories as well! remember permission "x" is needed on a directory to view files in it!

If that gives nothing... hmmm have to think now.
Unfortunately it's past midnight here in my part of the world, got to get some sleep.
Rest of the world is awake though so keep posting!
If noone else has a clue I'll be back tomorrow!
 
Old 06-12-2010, 05:31 AM   #9
kaos_king
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
My html files work whether they be in the root of "/var/www" or in a subdirectory in there. It is PHP thats not working (blank page).

I am using mysqldumper as a test (Clicky, freeware 656Kb).

I changed the owner of www to my username and that still made no difference.

So as i write this, i went off to grab a screenshot of the permissions and i noticed a button "Apply Permissions to Enclosed Files" at the bottom, pressed that and it all works now!

But my question now is, if i changed the owner using "sudo chown -R kaos www" shouldnt the "-R" have applied it to all subfolders and files inside of www?

* Edit * - Also, thanks for your help pingu

Last edited by kaos_king; 06-12-2010 at 06:15 AM.
 
Old 06-12-2010, 06:36 AM   #10
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,298

Rep: Reputation: 123Reputation: 123
Quote:
Originally Posted by kaos_king View Post
I changed the owner of www to my username and that still made no difference.

But my question now is, if i changed the owner using "sudo chown -R kaos www" shouldnt the "-R" have applied it to all subfolders and files inside of www?
Yes it should, strange.
One thing with Ubuntu & other "userfriendly" distros is that they sometimes don't allow you to do things outside the supplied gui tools. Maybe that's why it didn't work - but that's just a guess!

But you should not set your user as owner, standard webpages are better owned by apaches user.
 
Old 06-12-2010, 08:15 AM   #11
kaos_king
LQ Newbie
 
Registered: Jun 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Yeah its ubuntu im on. Anyway at least its working now, i'll change the owner to the apache user also.

Cheers for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache giving the error :Could not determine the server's fully qualified domain name bcf2 Linux - Server 46 10-15-2013 04:45 AM
"Could not reliably determine the server's fully qualified domain name, using 127.0. amritpalpathak Linux - Software 2 03-20-2010 03:36 PM
apache2 error :: server's fully qualified domain name sureka Linux - Server 2 06-14-2008 02:18 AM
problem with fully qualified domain name and apache nephish Linux - Server 2 04-09-2008 01:26 AM
Apache: httpd: Could not determine the server's fully qualified domain name.. shirtboy Linux - Software 1 11-20-2003 04:47 AM


All times are GMT -5. The time now is 12:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration