Apache usually will display the default web pages usually index.php or index.html where you had predefine in your configuration files. So how could we display other files easily? The best way to implement is that you create a file which will output all files in the directory. Below is example of how could u implement.
Save the as index.php
<html>
<?php
/**zfm
* Name this file index.php and place in the directory.
*/
//Data Initialization
$counter = 1;
// Define the full path to your folder from root
//$path = "put the full path here";
$path = "./.";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "<font size=5>Directory folder</font><br><br>";
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" )
continue;
echo $counter." <a href=\"$file\">$file</a><br>";
$counter+=1;
}
// Close
closedir($dir_handle);
?>
</html>
Showing posts with label Configuration and Installation. Show all posts
Showing posts with label Configuration and Installation. Show all posts
Wednesday, January 23, 2008
Display Current Directory Files
Labels:
Configuration and Installation
Tuesday, January 22, 2008
Change Apache Listening Port
How to change Apache Listening port?
As default apache port was 80 or 8080. If the port had been use by other program the apache could not be started.
To change the default port to desired port, open the apache configuration file.
By default the file located at:
C:\Program Files\Apache Software Foundation\Apache2.2\conf
Open httpd.conf
Then find "Listen" Change the default number to your prefered number.
Eg: Listen 1000
Labels:
Configuration and Installation
Subscribe to:
Posts (Atom)