Solved

Configure apache2 to run with cgi

Posted on 2007-11-23
4
2,522 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
ID: 20338824
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
ID: 20339199
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
ID: 20339676


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
ID: 20339851
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

786 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