LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-11-2005, 10:00 AM   #16
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47

[ka@c83-250-94-135 ka]$ cd /usr/local/apache/
[ka@c83-250-94-135 apache]$ ls

bin/ cgi-bin/ conf/ htdocs/ icons/ include/ libexec/ logs/ man/ proxy/ trial1.php
[ka@c83-250-94-135 apache]$ cd htdocs/


[ka@c83-250-94-135 htdocs]$ ls
apache_pb.gif index.html.en index.html.kr.iso-kr index.html.pt-br index.html.ru.utf8
index.html.ca index.html.es index.html.lb.utf8 index.html.ru.cp-1251 index.html.se
index.html.cz index.html.fr index.html.nl index.html.ru.cp866 index.html.zh-tw.big5
index.html.de index.html.he.iso8859-8 index.html.nn

index.html.ru.iso-ru manual/
index.html.dk

index.html.hu

index.html.no

index.html.ru.koi8-r

trial1.php


index.html.ee index.html.it

index.html.po.iso-pl index.html.ru.ucs2
index.html.el index.html.ja.jis index.html.pt index.html.ru.ucs4
[ka@c83-250-94-135 htdocs]$

---------------------------------------------------------------
[ka@c83-250-94-135 htdocs]$ cat 'trial1.php'

<html>
<head></head>
<body>

Agent: So who do you think you are, anyhow?
<br />

<?php
// print output
echo 'Neo: I am Neo, but my people call me The One.';
?>

</body>
</html>
------------------------------------------------------------------------------------------
The above is the .php file.


As you see there is a file called trial1.php in my htdocs folder. I tried in vain to open it using the firefox browser.
What is the problem?

Last edited by Gins; 09-11-2005 at 10:05 AM.
 
Old 09-11-2005, 10:02 AM   #17
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
What happens when you point your browser to the page?
 
Old 09-11-2005, 10:07 AM   #18
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
I don't know how to point the browser to a page whereas I know how to open a file with the browser.

I guess my .php file is flawed. Please read it.
 
Old 09-11-2005, 10:17 AM   #19
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Well what happens? I can't see anything wrong with your file. Are you getting errors or anything??

Also, you just needed to put "localhost/trial1.php" in the address bar (without the quotes) and press Enter.
 
Old 09-11-2005, 10:27 AM   #20
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Nothing happened.

[ka@c83-250-94-135 ka]$ localhost/trial1.php
bash: localhost/trial1.php: No such file or directory
[ka@c83-250-94-135 ka]$
 
Old 09-11-2005, 10:29 AM   #21
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
In the address bar of your browser..
 
Old 09-11-2005, 10:35 AM   #22
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
It worked.

http://localhost/trial1.php



The following is the output.
-------------------------------------------------------------------------------------
<html>
<head></head>
<body>

Agent: So who do you think you are, anyhow?
<br />

<?php
// print output
echo 'Neo: I am Neo, but my people call me The One.';
?>

</body>
</html>


------------------------------------------------------------------------
 
Old 09-11-2005, 10:37 AM   #23
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Do you have PHP installed?
 
Old 09-11-2005, 10:40 AM   #24
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Yes, I installed it yesterday with the help of some people who contributes this site. You get the details here. http://www.linuxquestions.org/questi...hreadid=361818
 
Old 09-11-2005, 10:48 AM   #25
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Ah ok, it's just that Apache isn't configured for use with PHP yet. Have a look here for instructions.
 
Old 09-11-2005, 11:01 AM   #26
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
I successfully installed the Apache about an hour ago. Read the following message I got at the end.
------------------------------------------------------------------------------------------
You now have successfully built and installed the |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the |
| (initially created or preserved) configuration files |
| |
| /usr/local/apache/conf/httpd.conf
| |
| and then you should be able to immediately fire up |
| Apache the first time by running: |
| |
| /usr/local/apache/bin/apachectl start
| |
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/

-----------------------------------------------------------------------------------------

I checked the 'httpd.cconf' file. It is there.

Aftewards, I ran it by typing ' apachectl start ' . This too worked. So the house is in order.

Do you think something else is missing?
 
Old 09-11-2005, 11:03 AM   #27
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
But is it configured for PHP? Look at the steps from 13 onwards in that link.

Edit: you may need to recompile Apache if you didn't include --enable-module=so as directed.

Last edited by Nylex; 09-11-2005 at 11:05 AM.
 
Old 09-11-2005, 11:35 AM   #28
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
This configuration is a tall oredr for me. It wants me to configur the 'httpd.conf' file.
--------------------------------------------------------------------------------

14. Edit your httpd.conf to load the PHP module. The path on the right hand
side of the LoadModule statement must point to the path of the PHP
module on your system. The make install from above may have already
added this for you, but be sure to check.

For PHP 4:

LoadModule php4_module libexec/libphp4.so

For PHP 5:

LoadModule php5_module libexec/libphp5.so

15. And in the AddModule section of httpd.conf, somewhere under the
ClearModuleList, add this:

For PHP 4:

AddModule mod_php4.c

For PHP 5:

AddModule mod_php5.c
-----------------------------------------------------------------------------------------------------

There is no line called ' LoadModule ' in that file. Shall I post the long file here? It is a long one.

Last edited by Gins; 09-11-2005 at 11:38 AM.
 
Old 09-11-2005, 11:42 AM   #29
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
#
<IfModule mod_mime_magic.c>
MIMEMagicFile /usr/local/apache/conf/magic
</IfModule>

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.



Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory /home/*/public_html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess files from being viewed by
# Web clients. Since .htaccess files often contain authorization
# information, access is disallowed for security reasons. Comment
# these lines out if you want Web visitors to see the contents of


ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

#
# "/usr/local/apache/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

</IfModule>
# End of aliases.

#
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Format: Redirect old-URI new-URL
#

#
# Directives controlling the display of server-generated directory listings.
#
<IfModule mod_autoindex.c>

#
# FancyIndexing is whether you want fancy directory indexing or standard
#
IndexOptions FancyIndexing

#

I have posted a few lines of the 'httpd.conf' file for your information.
 
Old 09-11-2005, 11:42 AM   #30
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I think you're gonna need to recompile Apache because you didn't have "--enable-module=so" when you ran configure, so you won't be able to use the LoadModule lines.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Apache 1.3 cmccully Linux - Software 2 02-03-2005 11:49 PM
Installing apache squirellplaying Linux - Newbie 7 05-19-2004 03:53 PM
installing apache wurzul Linux - Newbie 9 04-20-2004 09:03 AM
Installing Apache Michael2003 Linux - Newbie 7 12-27-2003 12:59 PM
Installing Apache 1.3.26 with Thinkgeekness Linux - Software 1 03-17-2003 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:28 PM.

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
Open Source Consulting | Domain Registration