Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-26-2006, 05:50 AM
|
#1
|
LQ Newbie
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11
Rep:
|
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.
|
|
|
07-26-2006, 01:58 PM
|
#2
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
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?
|
|
|
07-26-2006, 02:20 PM
|
#3
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
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?
|
|
|
07-26-2006, 03:05 PM
|
#4
|
LQ Newbie
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11
Original Poster
Rep:
|
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.
|
|
|
07-26-2006, 03:23 PM
|
#5
|
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098
Rep:
|
okay, so are you placing your test.php under /var/www/htdocs?
|
|
|
07-26-2006, 03:34 PM
|
#6
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Do you have a folder named "test" with the "test.php" script in it?
|
|
|
07-26-2006, 03:38 PM
|
#7
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep:
|
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.
|
|
|
07-26-2006, 03:44 PM
|
#8
|
Member
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795
Rep:
|
Wow, good call!
|
|
|
07-26-2006, 03:48 PM
|
#9
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep:
|
I may have had a similar problem with my own setup in the past!
|
|
|
07-26-2006, 04:07 PM
|
#10
|
LQ Newbie
Registered: Sep 2005
Distribution: Slackware 10.2 & 11
Posts: 11
Original Poster
Rep:
|
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.
|
|
|
07-26-2006, 05:14 PM
|
#11
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep:
|
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/
|
|
|
All times are GMT -5. The time now is 12:27 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|