System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Access HP-UX server through http

SOLVED
Go to solution
Lukit
Occasional Visitor

Access HP-UX server through http

Hi Guys,
I need to access my server throuh http(in local intranet) like

http://x.x.x.x/dir

When i will put this into my browser the the contents of dir should be shown and accessible.
i am using HP-UX 11iv3.
Please guide me what should i need to do.

Thanx in advance.


12 REPLIES
Horia Chirculescu
Honored Contributor

Re: Access HP-UX server through http

Are you saying that you want to access (browse) the content of one directory from the local machine (called dir, can be anywhere like in /opt/dir or /home/user1/dir)?

Best regards
Horia.

Best regards from Romania,
Horia.
Lukit
Occasional Visitor

Re: Access HP-UX server through http

Thanx Horia.

Yes i exactly want what u have mentioned.

Regards,
Lukit.
Horia Chirculescu
Honored Contributor

Re: Access HP-UX server through http

First of all you would need a web server.

HP-UX uses, as most of the UNIXes around there do, APACHE server.


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

You can use HP-UX Webmin as an Administration GUI for the system.

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

Re: Access HP-UX server through http

As usual do not forget to:

Read the docs!

Read the requirements!

Best regards,
Horia.
Best regards from Romania,
Horia.
Lukit
Occasional Visitor

Re: Access HP-UX server through http

Thanx for yiur replay.

I had checked apache is alredy installed and some processes are also running.

root /#swlist|grep -i apache
hpuxwsApache B.2.0.59.02 HPUX Apache Web Server

root /#ps -ef|grep -i apache
root 2853 1 0 Feb 20 ? 3:02 /opt/hpws/apache/bin/httpd -k start -DSSL -f /opt/hpsmh/conf/smhpd.conf
hpsmh 2963 2853 0 Feb 20 ? 0:24 /opt/hpws/apache/bin/httpd -k start -DSSL -f /opt/hpsmh/conf/smhpd.conf


It requires any additional configuration?
Should i need to put port number in browser with ip?


Regards,
Lukit

Horia Chirculescu
Honored Contributor

Re: Access HP-UX server through http

You can point your browser to the default port used by smh (2301):

http://server_ip_address:2301

If it is not working read the configuration file (maybe your setup does not use the default port)

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

Re: Access HP-UX server through http

Relevant documentation (for smh) here:

http://docs.hp.com/en/381372-004/381372-004.pdf

Horia.
Best regards from Romania,
Horia.
Lukit
Occasional Visitor

Re: Access HP-UX server through http

Yes i am able to acces smh.

But my initial query is not resolved.

Can i access (browse) the content of one directory from the local machine called dir?

Regards,
Lukit



Horia Chirculescu
Honored Contributor

Re: Access HP-UX server through http

The configured port no. should be listed in the configuration file:

/opt/hpsmh/conf/smhpd.conf

Horia.
Best regards from Romania,
Horia.
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.