LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-08-2005, 04:54 AM   #1
b:z
Member
 
Registered: Mar 2005
Posts: 146

Rep: Reputation: 15
Apache - How can i make own special default page -- Please help me


Example i have the link as " http://www.abc.com/index.html ", it's rather simple and even i don't need to put the suffix "/index.html" because it's default page. However the matter is i don't want type index.html, i only want type " http://www.abc.com/index.cool " instead of "index.html" or any page with ".html"
How can i make with Apache? Which configuration that i have to edit? Or you can show me where can i find out the document to do this.
Thanks so much.
 
Old 04-08-2005, 05:00 AM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
The directive of DirectoryIndex is what makes apache look for certain document types, Add the index.cool to that list in your httpd.conf. Mine looks like this:
Code:
<IfModule mod_dir.c>
      DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi
</IfModule>
 
Old 04-08-2005, 05:15 AM   #3
b:z
Member
 
Registered: Mar 2005
Posts: 146

Original Poster
Rep: Reputation: 15
Quote:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.htm

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
this is only that i can find out which you have depended, i can't find:

Quote:
<IfModule mod_dir.c>
DirectoryIndex index.htm index.html index.php index.php3 default.html index.cgi
</IfModule>
When i edit " DirectoryIndex index.cool", nothing happens, do i have something wrong?

Can you help me? Thank you very much.
 
Old 04-08-2005, 08:53 AM   #4
Tenox
LQ Newbie
 
Registered: Apr 2005
Location: Atlanta
Distribution: 2016: RH9 || 2024: Fedora 39 + Linux Mint
Posts: 9

Rep: Reputation: 0
Lightbulb DirectoryIndex + .htaccess + AllowOverride

You can use DirectoryIndex directive in a per-directory .htaccess file.
Create the file, as a normal text file in the directory you wish to individually control.
Add this directive and save the file.

Make sure file-permissions allow the user Apache is seen as to read the file.
All subdirectories from this directory inherit from this .htaccess unless they have a .htaccess
file of their own that specifically overrides the parent's file.


You should also consider the configuration directive "AllowOverride" If this is set to "none" in your
main config file it may prevent per-directory(and subs) configuration overrides.
From the manual,

"When the server finds an .htaccess file (as specified by AccessFileName) it needs to know
which directives declared in that file can override earlier access information.

When this directive is set to None, then .htaccess files are completely ignored. In this case,
the server will not even attempt to read .htaccess files in the filesystem.

When this directive is set to All, then any directive which has the .htaccess Context is allowed in .htaccess files."

There is more. RTFM!

/..
 
Old 04-10-2005, 12:04 AM   #5
b:z
Member
 
Registered: Mar 2005
Posts: 146

Original Poster
Rep: Reputation: 15
Quote:
[Sun Apr 10 11:54:25 2005] [notice] caught SIGTERM, shutting down
[Sun Apr 10 11:54:25 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Apr 10 11:54:26 2005] [notice] Digest: generating secret for digest authentication ...
[Sun Apr 10 11:54:26 2005] [notice] Digest: done
[Sun Apr 10 11:54:26 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Sun Apr 10 11:54:26 2005] [notice] LDAP: SSL support unavailable
[Sun Apr 10 11:54:26 2005] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Sun Apr 10 11:54:26 2005] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations
[Sun Apr 10 11:54:32 2005] [crit] [client 192.168.16.1] (13)Permission denied: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Apr 10 12:00:18 2005] [crit] [client 192.168.16.1] (13)Permission denied: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Apr 10 12:00:18 2005] [crit] [client 192.168.16.1] (13)Permission denied: /var/www/html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
This is the Apache error log when i try to run default page. Is there something wrong in my configuration?
I also #chmod 644 /var/www/html/.htaccess
and: #chmod +r /var/www/html/.htaccess

Please help me solve this problem and thank you very much for your help.
 
Old 04-10-2005, 12:29 AM   #6
b:z
Member
 
Registered: Mar 2005
Posts: 146

Original Poster
Rep: Reputation: 15
Oh, i can solve own my problem. Now, i didn't meet this problem "Permission denied", however the next problem is:
- My default page is put in "/var/www/html/index.cool"
- .htaccess file, having "DirectoryIndex index.cool"
- When i access to my website: "http://www.abc.com", it can't display right All is only code of my "index.cool" page instead of my text and picture.

Can you help me solve the problem. Thanks you very much.
 
Old 04-10-2005, 09:03 PM   #7
Tenox
LQ Newbie
 
Registered: Apr 2005
Location: Atlanta
Distribution: 2016: RH9 || 2024: Fedora 39 + Linux Mint
Posts: 9

Rep: Reputation: 0
Ok, you need to look this up: you can tell Apache how to handle files based on certain parts of their names.
In this case, you want to tell Apache to handle files ending in .cool as HTML files, rather than serving them as
text files.

The part of the filename you're interested in identifying as part of your config-modification is *.cool ; then
you can have any file called something.cool served as HTML (in the server headers sent to the requesting
client,) and the client will then handle it as a web-page.

I can't look it up for you now, but have set this myself and it works great; it should not be very hard to find
in the manual, especially as you know what you are looking for now. It's in the section on Runtime Directives.
I believe its context includes .htaccess, but at least it's available as a server-level-config directive so you might
find it by studying the comments in the http.conf file


Best of luck,

/..
 
Old 04-10-2005, 09:37 PM   #8
b:z
Member
 
Registered: Mar 2005
Posts: 146

Original Poster
Rep: Reputation: 15
Quote:
Ok, you need to look this up: you can tell Apache how to handle files based on certain parts of their names.
In this case, you want to tell Apache to handle files ending in .cool as HTML files, rather than serving them as
text files.

The part of the filename you're interested in identifying as part of your config-modification is *.cool ; then
you can have any file called something.cool served as HTML (in the server headers sent to the requesting
client,) and the client will then handle it as a web-page.

I can't look it up for you now, but have set this myself and it works great; it should not be very hard to find
in the manual, especially as you know what you are looking for now. It's in the section on Runtime Directives.
I believe its context includes .htaccess, but at least it's available as a server-level-config directive so you might
find it by studying the comments in the http.conf file
Thanks for your help. I can do it as i want
And the problem due to encrypt page. Apache can work with the pages are encrypted with HTML Protector. However when i use original file, it can work fine. I think this is the problem.

Thanks again.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Apache 2 Page linutzy Linux - Newbie 7 08-02-2005 07:18 PM
Apache default page dienerk Linux - General 4 10-22-2004 01:02 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 12:35 PM
Apache default page?? andy18 Linux - General 6 07-16-2003 02:57 AM
apache default page davee Linux - Newbie 6 02-17-2003 09:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:54 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
Open Source Consulting | Domain Registration