LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 04-07-2011, 12:59 AM   #1
athrin
Member
 
Registered: Mar 2011
Posts: 135

Rep: Reputation: 1
change location


hi,

i have some php file and i store it inside /var/www/html/
and to display it i type
Quote:
http://ip addrs/file.php
to display the details..

and the problem is that i want the php file to be display when i type the ip address only like this
Quote:
http://ip addrs/
can someone help me solve this.
 
Old 04-07-2011, 03:05 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 124Reputation: 124
In your apache configuration file (mine is at /etc/httpd/httpd.conf) there should be a part similar to this one:

Code:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
I don't have a php file myself here at hand to test it, but I guess renaming the file to index.php and changing the code snippet from .html to .php, then restarting httpd service should do it.
 
1 members found this post helpful.
Old 04-07-2011, 03:06 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532Reputation: 1532
Hi,

I guess you're talking for apache. In this case add file.php in the DirectoryIndex directive, before any other filenames (like index.html, index.php etc)

Regards
 
  


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
Change GDB location joelcomp1 Linux - Newbie 1 07-03-2007 09:28 AM
how to change the location of mysql lexthoonen Linux - Newbie 4 01-25-2007 01:02 PM
Location and language change davidsrsb Ubuntu 0 01-09-2007 10:39 AM
Why change location of nano sigma957 Debian 1 06-18-2005 03:20 PM
how to change location of /home? mark_2811 Linux - General 4 01-23-2004 07:19 AM


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