Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure apache in Fedora to execute cgi program

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install and configure apache in Fedora to make it execute cgi programs. I hope you will get something after reading this article. Let's discuss it together.

1, install Fedora apache

First, go to the home page of Fedora apache to download the * * version of Fedora apache http server, the address is http://httpd.apache.org/. This article was written on April 29, 2006 and Apache version is 2.2.0. If you want to use this version, please click: http://mirror.vmmatrix.net/apache/httpd/httpd-2.2.0.tar.gz

Install Fedora apache: change to the directory where httpd-2.2.0.tar.gz is located, and then: # tar xvzf httpd-2.2.0.tar.gz at this time there is a folder httpd-2.2.0 in this directory, change to this folder: # cd. / httpd-2.2.0 I don't know which folder you want to install apache to, let's assume that you want to install it under / usr/local/apache2/, enter the following command:

#. / configure-- prefix= / usr/local/apache2 # make # make install

After executing these three commands, Fedora apache will be installed in your / usr/local/apache2 directory. Switch to this directory and see what happens;)

# cd. / usr/local/apache2

# ls

You can see that there are / bin, / conf, / htdocs, / cgi-bin and other directories inside. Fedora apache has not been started at this time. We start it through the tool apachectl in the / bin directory. First, change to the / bin directory: # cd. / bin and then start: #. / apachectl start

At this time, type http://localhost/ in the address bar to see if there is any successful information. (what the author sees is "It works!") The information, of course, varies from version to version, depending on the index.html content under your / htdocs.

Just replace / usr/local/apache2/htdocs/index.html with your page file. At this point, we assume that your Fedora apache server has been successfully installed. If you have any more questions, please search the Internet or contact me: lonestep AT gmail D. T com

2. Configure Fedora apache to execute the cgi program

By default, cgi programs must be placed in the cgi-bin directory. Let's first configure so that the cgi programs under cgi-bin can be executed correctly. Later, we will describe how to let apache execute cgi programs placed in other directories.

1) as a result, we have installed apache into the / usr/local/apache2 directory and changed to the / usr/local/apache2/conf directory, where there is a httpd.conf file. Edit this file:

# cd / usr/local/apache2/conf# vi httpd.conf (assuming your text editor is vi, if you use other editors such as emacs, gedit, kedit, etc., replace vi with their commands) look for lines such as:

# ScriptAlias / cgi-bin/ "/ usr/local/apache2/cgi-bin/" remove the'#'in front of the line and restart apache:

# cd. / bin (or cd / usr/local/apache2/bin)

#. / apachectl restart

Ok, if you put a cgi program 'test.cgi' to cgi-bin, type http://localhost/cgi-bin/test.cgi in the address bar to see if it can be executed >? If not, please email me:)

2), if you want to change the directory where cgi is executed (instead of the default cgi-bin directory), change the ScriptAlias / cgi-bin/ "/ usr/local/apache2/cgi-bin/" to: ScriptAlias / SomeOtherDirectory/ "/ usr/local/apache2/cgi-bin/" and restart Fedora apache.

After reading this article, I believe you have a certain understanding of "how to install and configure apache in Fedora to execute cgi programs". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report