Solved

Configure apache2 to run with cgi

Posted on 2007-11-23
4
2,517 Views
Last Modified: 2013-12-25
I have install Ubuntu and apache2 at home for the first time, and I'm getting crazy to configure the apache2 to run in the port 9999 (or other bigger them 1024).

I have commented everything at ports.conf and I'm trying to set the httpd.conf as



AddHandler cgi-script .cgi .pl
Listen 3000
NameVirtualHost *:3000
<VirtualHost *:3000>
   ServerName oleber.myserver.com
   ServerAdmin my_user@mail.pt
   DocumentRoot /servers/my_path/html
   ErrorLog /servers/my_path/logs/error_log.txt
   TransferLog /servers/my_path/logs/access_log.txt
</VirtualHost>


with the previews configuration I'd be expecting to have already a static webpage server.

But I'm needing to have a cgi directory to

static webpages: /servers/my_path/html
cgi webpages: /servers/my_path/html

Thanks for the help
0
Comment
Question by:oleber
  • 2
  • 2
4 Comments
 
LVL 10

Author Comment

by:oleber
Comment Utility
Output of: clear; sudo /etc/init.d/apache2 restart

 * Restarting web server apache2                                                                                            apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Nov 23 14:09:04 2007] [error] VirtualHost *:3000 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Fri Nov 23 14:09:04 2007] [warn] NameVirtualHost *:3000 has no VirtualHosts
httpd (no pid file) not running
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Fri Nov 23 14:09:14 2007] [error] VirtualHost *:3000 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Fri Nov 23 14:09:14 2007] [warn] NameVirtualHost *:3000 has no VirtualHosts
0
 
LVL 28

Expert Comment

by:Jan Springer
Comment Utility
1) Specify the cgi-bin path
    ScriptAlias /cgi-bin/ "/path/to/cgi-bin/"

2) Comment this out thusly
   # NameVirtualHost *:3000

3) Recommend specifying an FQDN for the ServerName directive in the global config
0
 
LVL 10

Author Comment

by:oleber
Comment Utility


More for documentation for others:

1º I copyed the file /etc/apache2/sites-available/default to /etc/apache2/sites-available/my_site

2º I alter it to my directories in the file /etc/apache2/sites-available/my_site

3º I created a soft link in the directory /etc/apache2/sites-enabled to the file /etc/apache2/sites-available/my_site

4º I added more 'Listen 3000' to the file ports.conf

5º I set a port to the file /etc/apache2/sites-available/default



The only problem for now seems to be a warning message when I'm starting the servers:

 * Restarting web server apache2                                                                                            apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

What thus this means?
0
 
LVL 28

Accepted Solution

by:
Jan Springer earned 125 total points
Comment Utility
In your global configuration, there is a directory called 'ServerName'.  If this server has a name, i.e., "my.server.com", set it there.

If the apache config does not have this specified, it means that it will use 127.0.1.1 address as the server name.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now