LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-26-2006, 05:50 AM   #1
PCPbSlack
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11

Rep: Reputation: 0
Slackware Apache [MySQL] PHP Issue


SAMP - Slackware/Apache/MySQL/PHP

Hello,

My issue actually is about Apache and PHP running on a Slackware machine.

Everything seems to work fine, but I noticed that if I create a file in my Apache root directory, lets say test.php, and in this file I put some code, lets say
PHP Code:
<?php echo "Hello, world!"?>
I can access this file using 2 methods: http://localhost/test.php and http://localhost/test, and this is not a normal behavior in my opinion.

Can somebody please enlight me why is this happening?

PS: The /etc/apache/httpd.conf is modified only in the section where Apache should use /home/*/public_html folder and obviously mod_php is enabled.

Sorry for my English

Thank you.

Later edit:
The same behaiviour is with HTML files also. It is like on the server is a .htaccess file with RewriteEngine on that does the redirection.
Please some body, give me an explanation...

Last edited by PCPbSlack; 07-26-2006 at 12:51 PM.
 
Old 07-26-2006, 01:58 PM   #2
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
What would you like it to do? Do you want to access it via a domain name? IP? Are you trying to have the test.php script come up automatically?
 
Old 07-26-2006, 02:20 PM   #3
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Can you post where your DocumentRoot and <Directory " "> Point too. For the <directory> you will see it notated that this should point to the same place as DocumentRoot. When you find this make sure those files are placed their. When you say apache root I am assuming you mean install directory. Can you be more specific as in where exactly you are placing these files?
 
Old 07-26-2006, 03:05 PM   #4
PCPbSlack
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11

Original Poster
Rep: Reputation: 0
Ok, finally some signs of life.

In my apache httpd.conf I have the following configuration:

Code:
[...]

DocumentRoot "/var/www/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/htdocs">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

[...]
I don't have any domain, it is a local testing server where I develop my php scripts.

All I want to do is an explanation why when I access http://localhost/test I get the same result as accessing http://localhost/test.php. In my DocumentRoot directory I don't have any directory called test, only a file called test.php. I don't have any .htaccess files.

I hope I made myself understood.
 
Old 07-26-2006, 03:23 PM   #5
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
okay, so are you placing your test.php under /var/www/htdocs?
 
Old 07-26-2006, 03:34 PM   #6
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Do you have a folder named "test" with the "test.php" script in it?
 
Old 07-26-2006, 03:38 PM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It's the MultiViews option causing this. From the version 2.0 info at http://httpd.apache.org/docs/2.0/con...gotiation.html:
Code:
The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo,
if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the
directory looking for files named foo.*, and effectively fakes up a type map which names all those
files, assigning them the same media types and content-encodings it would have if the client had
asked for one of them by name. It then chooses the best match to the client's requirements.
 
Old 07-26-2006, 03:44 PM   #8
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Wow, good call!
 
Old 07-26-2006, 03:48 PM   #9
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
I may have had a similar problem with my own setup in the past!
 
Old 07-26-2006, 04:07 PM   #10
PCPbSlack
LQ Newbie
 
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks a lot gilead!!!!!



I always wandered why right after a fresh install on my test server the localhost displayed that nice screen with Hey, it worked !. Now, all I have is the directory index.

I really need to read more about Apache.
 
Old 07-26-2006, 05:14 PM   #11
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
No problem - I'm glad it's doing what you wanted. On my setup, I usually leave the Apache docs installed, but I put them in their own virtualhost with their own domain. I make sure that my DNS has an entry for that domain so I can see the Apache docs offline without cluttering up my web-site.

Or, just spend time at http://httpd.apache.org/docs/
 
  


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
IPv6 issue/dhclient issue ap0ll0 Linux - Wireless Networking 10 01-27-2006 05:58 PM
Slack 10.1 -- Mouse issue / X11 issue Pozican Linux - General 4 04-19-2005 04:44 AM
webmin issue, poss security issue bejiita Slackware 3 11-03-2004 07:07 AM
DNS issue or caching issue? AZDAVE Linux - Networking 7 10-02-2004 01:28 AM
Having Issue w/ Truetype fonts - Mozilla Issue clove Linux - Software 4 02-18-2004 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:27 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