Publishing HTML Page

Hi All,
Thanks for reading.
I am not sure if I am asking this in the correct group. But here it goes:

There is a shell script which does some system checks and creates an html file called system_summary.html on my Red Hat machine say in /reports directory every hour.

Now I want to view it in firefox . like a web page .. something like opening a page [http://localhost/system_summary.html]

I am just done with the script. What all do I need to do now?

D

You'll need a webserver to publish it for you. Maybe you got an apache httpd running. You can check this for example with

ps -ef| grep -iE "apache|httpd"

or if any other httpd is serving at port 80 with

$> netstat -an| grep ":80 "
tcp6       0      0 :::80                   :::*                    LISTEN

If there is nothing, it is either not installed or not started. I think on Redhat you use rpm or yum to install packages.

1 Like

Thanks for that .. i m just trying to do some fancy reporting .. havent done anything with the web server stuff ... ill google the rest of the steps

Basically after apache is installed and running, you have to check where it's document root is and place your report there or make a new entry for a directory to be published in httpd.conf or whereever in your distro apache's config are splitted and outsourced to. It often depends on the distro where apache's config files are and how they are activated etc.
Since RedHat has superb documentation, I think it will not be too hard. Anyway if you have a particular question, do not hesitate to ask here.

Another option would be to have the script move your last doc to another folder and then automatically share the current directory with:

python -m SimpleHTTPServer

Then that dir is shared out on port 8000. You can killall python at any point to stop the web server.

On RHEL, the default document root is /var/www/html. The http service is called httpd. To start the httpd service do the following:

service httpd start
chkconfig httpd on

Yep - apache is running and i could see the /var/www/html directory ..
Now all I need to put the html page in that directory ..
thanks guys .. all helpful tips :slight_smile: