Operating System - Linux
1821187 Members
3200 Online
109631 Solutions
New Discussion юеВ

Apache Web Server Question.

 
Admin32
Advisor

Apache Web Server Question.

Hi everyone,

I wanted to find out if there is anyone out there who knows if its possible to configure Apache to create dynamic pages, but using html instead of php !


7 REPLIES 7
Vincent Stedema
Esteemed Contributor

Re: Apache Web Server Question.

Hi,

Could you pls explain what you mean by creating dynamic pages with html?

Regards,

Vincent
Stuart Browne
Honored Contributor

Re: Apache Web Server Question.

If you mean you want HTML pages to be parsed (executed) like PHP pages are, then you need to change the PHP binding in /etc/httpd/conf/httpd.conf from:


AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps


AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps


AddType application/x-httpd-php .phtml


To something like this:


AddType application/x-httpd-php .php .php4 .php3 .phtml .html
AddType application/x-httpd-php-source .phps


AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps


AddType application/x-httpd-php .phtml .html


Note however that this will impact system performance as it will mean that *EVERY* page that is retrieved that ends in '.html' will be parsed by the PHP module.

There's more details on this on the PHP web site (http://www.php.net/manual/en/install.apache.php).

Hope this helps you.
One long-haired git at your service...
Admin32
Advisor

Re: Apache Web Server Question.

Stuart,

Thank for your answer. Its something which I never thought about, but sounds like a very interesting way to get the job done.

While the solution you proposed dosen't exactly fullfil my requirements, its definitely a good one !

I'm not sure is there is another way of generating dynamic html pages, but Im sure there is, as I have seen it on other Apache webservers which generate html pages dynamicaly.

If you come up with any other idea, please let me know !

Cheers,
Bill Thorsteinson
Honored Contributor

Re: Apache Web Server Question.

Look at server-side includes. The functionality is not as powerful as PHP. If server-side includes don't work, you could look at the various options for CGI scripting. Perl is one of the tools of choise. You could look at Mason which helps partition the code from the html.
Admin32
Advisor

Re: Apache Web Server Question.

If anyone can point a good site which shows how to create Dynamic html pages using ssi, it would be appreciated !

Thanks
Mark Bainter
Advisor

Re: Apache Web Server Question.

Stuart Browne
Honored Contributor

Re: Apache Web Server Question.

Oops, I'm sorry. I didn't read your request properly.

SSI is one method. Others include things like 'mod_perl' and 'mod_python'. These use perl/python respectivly type code within the HTML page in order to get dynamic content. I've not used either of them (given I know and like PHP), but they are very powerful from all I've read about them.

They also run quicker than "
One long-haired git at your service...