Apache - How can i make own special default page -- Please help me
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
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.
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:
#
# 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:
Distribution: 2016: RH9 || 2024: Fedora 39 + Linux Mint
Posts: 9
Rep:
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."
[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.
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.
Distribution: 2016: RH9 || 2024: Fedora 39 + Linux Mint
Posts: 9
Rep:
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.