Operating System - HP-UX
1753406 Members
7232 Online
108793 Solutions
New Discussion юеВ

Re: Access HP-UX server through http

 
SOLVED
Go to solution
Matti_Kurkela
Honored Contributor

Re: Access HP-UX server through http

The Apache httpd processes you're currently seeing are related to HP System Management Homepage. It's an instance of Apache, but it's completely dedicated to running SMH. You should not try to change its configuration.

Instead, install the Apache webserver software package to your HP-UX:

https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSATW312

This provides a "general-purpose" Apache webserver which you can configure as much as you like.

Then read Apache documentation to understand what you're doing.

http://httpd.apache.org/docs/2.2/

There are many ways to configure which parts of your HP-UX filesystem will be accessible as URLs:
http://httpd.apache.org/docs/2.2/urlmapping.html

For example, if you want to make /opt/webdata/dir visible as http://x.x.x.x/dir, you would configure:

Alias /dir /opt/webdata/dir

Another way to achieve the same thing would be to set DocumentRoot to /opt/webdata. (Setting DocumentRoot to / is definitely not recommended!)

To allow displaying of directory listing instead of pre-prepared index.html (or similar), you must add these lines to Apache configuration to activate the Indexes option for your directory:


Options +Indexes


See:
http://httpd.apache.org/docs/2.2/mod/core.html#options

There are various other configuration directives you can use to change the style of the directory listing:
http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html

By default, Apache allows only reading the files (HEAD and GET methods). Furthermore, Apache typically reads files using a special unprivileged user (typically named "httpd" or "apache"): if the directory or file permissions don't allow this user to read the file or directory, Apache cannot send it to the client.

If you want to allow write access through HTTP/HTTPS, you use an Apache module that supports WebDAV or HTTP PUT method. For example, Apache's WebDAV module is called mod_dav:

http://httpd.apache.org/docs/2.2/mod/mod_dav.html

By default, this module is disabled. You should definitely read the documentation and understand your Apache configuration before allowing write access, be it through mod_dav or otherwise.

MK
MK
Horia Chirculescu
Honored Contributor

Re: Access HP-UX server through http

As smhpd.conf can not be modified (http://docs.hp.com/en/466303-004/ch03s01.html)
you would need to start another instance of httpd (in addition to the one started by smh).

Use the default httpd.conf provided and modify the DocumentRoot to point to somwhere let's say /home/apache

DocumentRoot /home/apache

Then enable following the symbolic links in that directory:


Options Indexes FollowSymLinks


Then cd to /home/apache and make the links to the desired directory/directories.

cd /home/apache
ln -sf /some_volume_some_path/dir dir1
{...}

Then make a script that will start the new apache instance and run it. You should enable running this script at boot.

This is only a "regular" apache installation. You can not acces files from the dir directory except if those are owned by the same user used to run the httpd daemon. Even if the httpd daemon was start by root, the current apache implementation would suid the httpd childs that will actually serve HTTP data to clients.


Best regards,
Horia.
Best regards from Romania,
Horia.
Horia Chirculescu
Honored Contributor

Re: Access HP-UX server through http

There is not an easy way to do that (full directory access through HTTP).

Horia.
Best regards from Romania,
Horia.