Operating System - HP-UX
1823920 Members
3198 Online
109667 Solutions
New Discussion юеВ

How to setup a default page

 
MANISH PATEL_2
Frequent Advisor

How to setup a default page

hi guys,

Merry christmas and have a happy new year.

I am new for the web server setup. Web server sw is already installed in new server and also httpd and apache is started.

I want to setup a url,like when user type http://: they will directly get the default path e.g(/appl/ftp).

Can you please let me know the steps.How can i define port,default directory,url etc. In which files i need to modify.

Thanks
MP
3 REPLIES 3
David Bellamy
Respected Contributor

Re: How to setup a default page

if you have apache edit the http.conf file,it in the conf directory of your apache installation directory
Matti_Kurkela
Honored Contributor

Re: How to setup a default page

You seem to specify "web server software", "httpd" and "apache" as separate entities. Apache is one (very widely used) web server software; when it's running, it can be identified as one or more processes named "httpd".

Normally, the users won't bother to type the port number unless someone has explicitly told them it's required. In this case, the standard port numbers are used. For http:// URLs, the standard port is 80; for https:// URLs, it's 443.

Your users will be happier if you use these standard ports unless you have a specific reason to do otherwise.

But if you wish to modify the port number your server uses, that is certainly possible in your web server configuration. If your web server is Apache, look for "Listen" and/or "Port" directives in the Apache configuration files. One Apache web server can serve one or more ports, optionally allowing to serve different pages according to what server hostname the client is using in its request (hostname-based virtual hosting).

The main configuration file is usually named "httpd.conf": its location depends on how your Apache is installed. However, this file can refer to other configuration files by using the "Include " directive, so you really should examine your default httpd.conf thoroughly before using it.

In fact, the default httpd.conf is usually *full* of comments. After you've learned the fundamentals of Apache, I'd recommend you to write a completely new, minimalist Apache configuration file that contains only the things you'll need. It can be much cleaner and shorter than the default version, so it will be easier to maintain.

The "default directory" is known as DocumentRoot in Apache web server terminology. If you set DocumentRoot to "/appl/ftp" and your user types http://server.example: (or just http://server.example if the default port is used), the user's browser connects to the indicated port of server.example and makes a HTTP request for URI "/".

By default, Apache will append the URI path to the configured DocumentRoot and look for a file named "index.html" in that directory, i.e. /appl/ftp/index.html. If this file does not exist, Apache might be configured to look for other "default documents" like index.htm, index.php or default.htm (this list is fully configurable).

If none of these exist, Apache will automatically display the directory listing of the DocumentRoot directory (in this example, /appl/ftp/) *if* it's allowed to do so. This feature is in the AutoIndex module of Apache, and it's fully configurable.

If the user types "http://server.example/foo",
Apache first checks if a file or directory named "foo" exists under the configured DocumentRoot, i.e. /appl/ftp/foo in our example.

In short, the DocumentRoot of an Apache web server works much like a "chroot" setting of a FTP server. (Note: usually this is *not* an actual OS-level chroot set-up, but just a simple filename/path mapping.)

You can also use "Alias" directives in the Apache configuration file to allow access to files *outside* the DocumentRoot directory hierarchy.

For a silly example, maybe your Head Office provides you with a set of officially approved company logos and requires that they be stored on a read-only media so that an intruder cannot deface them even if your server is compromised. You can simply mount the media to some suitable location, for example: /cdrom.

If you specify

Alias /logos /cdrom/Official_Logos_for_Web

in Apache configuration, then an URL like
http://server.example/logos/400x100.png
will get mapped to /cdrom/Official_Logos_for_Web/400x100.png.

(Using a CDROM for storing pictures that are probably used on all your web pages makes your page load slower, but at least the Head Office's requirement has been fulfilled... right?)

Apache's documentation is available on the web, and it's fairly good:
http://httpd.apache.org

MK
MK
MANISH PATEL_2
Frequent Advisor

Re: How to setup a default page

I got the idea from this forum how to setup a default page.