LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-24-2004, 03:01 AM   #16
x_menno_x
LQ Newbie
 
Registered: Jun 2004
Posts: 14

Original Poster
Rep: Reputation: 0

Yes, I have tried changing my Servername to my IP address, but that doesn't work. I also have the </VirtualHost> at the end of my http yes. Forgot to mention that, sorry.

But now I have discovered I did something very wrong! You've asked earlier in this thread what the content of my resolv.conf was. I said this was the IP address: 212.52.1.10, but I've discovered that's my DNS! I had it all the time!

So, here is the correct information:

my IP address: 10.21.100.152
my DNS: 212.52.1.10

So, do I have to change my resolv.conf like this?:

**********************************

*search localdomain* (delete this right?)
127.0.0.1
10.21.100.152
*blank line*

(where do I have to put my DNS?)

**********************************


And where in the http.conf file do I have to fill in my DNS address? In the ServerName of NameVirtualHost?

Oh yes, I think that the 10.21.11.152 is inrelevant for me, because I don't need a connection with internet, because the server is for the local network here in the company (intranet).

Thanks very much!

Last edited by x_menno_x; 06-24-2004 at 03:13 AM.
 
Old 06-24-2004, 06:43 AM   #17
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Your resolv.conf file should look like this...

Code:
nameserver 212.52.1.10
<blank line>
It's important to have the word "nameserver" at the beginning right before the IP address. And yes, you want to try deleting the "localdomain" line. Of course, my suggestion was to simply comment this line by putting a # symbol at the beginning of the line until you're sure you don't need it.

You don't actually define the DNS anywhere in the httpd.conf file. It looks at resolv.conf automatically when it needs to lookup a name in DNS and convert it to an IP address.
 
Old 06-24-2004, 06:54 AM   #18
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
By the way... I was looking back at your first post, and I noticed something odd. You said that everything was working fine in internet explorer except for one PHP script. Is this still true? Are you able to browse sites in your browser that are being served from apache?

Also, you said...

Quote:
(it writes the PHP file locally on the server but not when you view it with an connection from outside)
So it's not entirely for your LAN... it will also need outside access for this PHP script, right? Just making sure I understand everything correctly.
 
Old 06-24-2004, 08:35 AM   #19
x_menno_x
LQ Newbie
 
Registered: Jun 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Yes indeed. That's why I made this thread in the first place, because of that PHP write problem.

I can still browse through my hosted files on internet explorer on any computer here in the company, except it doesn't write that specific PHP file. It does, however, write the PHP locally on my Linux server.


I have changed the resolv.conf like you said, but still... when I restart httpd I still get the same error (*Failed to resolve server name to 10.21.100.152 (Check DNS) or specify an explicite server name*).
 
Old 06-24-2004, 08:52 AM   #20
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
What about putting "ServerName localhost".
 
Old 06-25-2004, 06:37 AM   #21
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,500

Rep: Reputation: 91
Hi

Sounds like the user you are running PHP as on your system has write privileges to the relevant directory, but everybody else (i. e. ppl surfing the site from "outside") do not.

Let me explain like this how I fixed such a problem on my Apache installation:

I had a directory called /htdocs/php/pgsi/company

inside of which I wanted PHP to copy / delete files. It absolutely refused to work until I did (as root):

chmod a=rwx /usr/local/apache2/htdocs/php/pgsi/company

which gives all users the permission to write in that directory.

Note - this is not the ideal solution - this is a potential BIG security whole since anybody can now also delete files in the particular directory, and ruin your website (I think...)

But in the short term your PHP scripts should now not have any problems writing into the directory chmod'ed like I showed above.

Regards,
 
Old 06-28-2004, 02:00 AM   #22
x_menno_x
LQ Newbie
 
Registered: Jun 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Donboy: Thanks again! It doesn't work, unfortunately....

Rylan: Thanks for the information! However, when I put that commando on my /var/www/html/tijlsite/prikbord, it doesn't work... The php file still doesn't write....
 
Old 06-28-2004, 06:43 AM   #23
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Not enough info!! What does the error log say about this? There should be errors written to the error log everytime something fails.
 
Old 06-29-2004, 01:57 AM   #24
x_menno_x
LQ Newbie
 
Registered: Jun 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Oh sorry! Yes, I got something interesting in my /var/log/httpd/access_log:

******

10.21.11.27 - - [28/Jun/2004:08:48:45 +0200] "GET /tijlsite/prikbord/toevoegen.php HTTP/1.1" 200 4346 "http://10.21.100.152/tijlsite/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
10.21.11.27 - - [28/Jun/2004:08:49:07 +0200] "GET /tijlsite/prikbord/guestbook.php?name=me&email=me@me.nl&message=this+is+an+entry&submitButtonName=Verstuur HTTP/1.1" 200 1638 "http://10.21.100.152/tijlsite/prikbord/toevoegen.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"

******

Notice that the above is the entry I put in the guestbook. Can you see something interesting?

I got nothing special in my error_log, except this:

**********************************************

Apache/2.0.40 (Red Hat Linux) configured - resuming normal operations

**********************************************
 
Old 06-29-2004, 06:41 AM   #25
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
It looks to me like it's actually working. Better look around and see where the output may be going. Perhaps you're writing to a mysql database? Maybe to a text file somewhere? The messages in your logs are showing a return code of 200, which is success.

Hard for me to advise any better because I have no idea what the script looks like or what its doing, but from the apache side it looks like everything is working as it should be.

Maybe you should create a very very simple PHP script like "Hello world" and be sure that works. When you're done, start adding functionality, like maybe have it write a simple file on your server into a directory you can find easily and you know it's got the right permissions. Make the path to the file (in your script) hard coded so there are no mistakes about the path it's writing to or the file it's writing to.
 
Old 06-29-2004, 08:36 AM   #26
x_menno_x
LQ Newbie
 
Registered: Jun 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Yes, you're right. It's writing data to a txt file. But there's nothing in the txt file.

Oh, by the way, I asked the person who wrote the php file if it writes to a mysql database. This is not the case. But he said something else: there's another PHP file who controls the visitor counter. This is working properly!

So, you can ask yourself: if apache is working, what can it be? A fault in the code? Can't imagine because it works on another server (Apache on Windows NT).

Last edited by x_menno_x; 06-29-2004 at 08:44 AM.
 
Old 06-29-2004, 09:03 AM   #27
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Hmmm, well, like I said, without seeing the script, I really have no idea. Maybe it's something about the difference between unix and windows. Maybe it's a permissions thing. Maybe you need write permission on the file and all directories that lead up to it. Maybe you want to post this question in a PHP forum so it can have the attention of the PHP gurus.

I would like to be able to say that we've totally ruled out all apache problems, but I can't really say that without sitting at your machine myself and looking around. I keep getting this feeling like maybe it's writing to a different error log that you haven't been checking.

Like I said, if you're getting no errors in apache logs, then it means the PHP script returned true and succeeded in everything it tried to do. That would mean there are no apache errors and all of the problem lies within your script.
 
Old 06-29-2004, 04:44 PM   #28
x_menno_x
LQ Newbie
 
Registered: Jun 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Yes, well... today was my last day at my company (I had my work placement there, which has now ended). They won't be doing anything with the Red Hat server anymore. Thank you very very much for the help anyway!

I will set up my own Red Hat server at home one day, and will see if I get the same probleme with another PHP file. Anyway, I know what to do by then. THANKS!
 
  


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
Does anyone know how to write a date server in C for Red Hat linux? jcchenz Linux - Networking 1 10-26-2005 03:49 PM
php script can not write text file lemotion Linux - Newbie 5 04-20-2004 10:14 PM
PHP - What to add to Apache httpd.conf file? maktos Linux - Software 9 04-17-2004 08:18 PM
Red Hat 9 HTTPD Server Fonke0412 Linux - Newbie 6 08-09-2003 12:08 PM
Modifying Red Hat 7.3 Grub conf. file nixdisciple Linux - General 4 06-02-2002 10:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration