Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: I cannot get apache2 to work in debian7 |
|
Author |
|
itsmemo
Joined: 31 Jul 2015 Posts: 3 Location: Australia
|
Posted: Wed 05 Aug '15 17:21 Post subject: I cannot get apache2 to work in debian7 |
|
|
Can anyone help me with this problem? I cannot make apache2.2 work in Debian 7, all the files are on the same laptop for testing, here are the files used (Debian splits the configuration file into a number of files as you probably know but only one needs to be modified to suit the user):
******root@asus:/etc/apache2/sites-enabled# ls -l
lrwxrwxrwx 1 root root 29 Aug 5 19:26 Peter_73.conf -> ../sites-available/Peter_73.conf
----apache2 only works if this symbolic link exists
******root@asus:/etc/apache2/sites-available# ls -l
-rw-r--r-- 1 Peter_73 users 762 Aug 4 20:51 default
-rw-r--r-- 1 Peter_73 users 7350 Jul 28 22:49 default-ssl
-rwxrwxrwx 1 Peter_73 users 1049 Aug 5 19:26 Peter_73.conf
<VirtualHost *:80>
ServerAdmin webmaster@asus.Peter_73
ServerName asus.Peter_73
ServerAlias www.asus.Peter_73
DirectoryIndex index_en.html
DocumentRoot /var/www/Peter_73
*
ErrorLog /var/www/Peter_73/log/error.log
CustomLog /var/www/Peter_73/log/access.log combined
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/Peter_73/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias "/cgi-bin/" "/usr/local/bin/apache2/cgi-bin/"# was tried first without quotes
<Directory "/usr/local/bin/apache2/cgi-bin"># was tried first without quotes
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
***
</VirtualHost>
root@asus:/var/www/Peter_73/languages/en# apache2ctl configtest
Syntax OK
******The calling html/form scripts
root@asus:/var/www/Peter_73/languages/en# ls -l
-rw-r--r-- 1 Peter_73 users 235 Aug 5 22:16 form_test_pl.htm
-rw-r--r-- 1 Peter_73 users 188 Aug 5 19:31 form_test_yab.htm
----form_test_yab.htm
<html><body><head><title></title></head>
<form method="post" action="/cgi-bin/yabasic.cgi">
<input type="submit" value="Submit"></form></body></html>
----clicking this gives a "file not found" - any extension gives same result
----form_test_yab.htm
<html><body><head><title></title></head>
<form method="post" action="/usr/local/bin/apache2/cgi-bin/yabasic.cgi">
<input type="submit" value="Submit"></form></body></html>
----clicking this prints the content of "yabasic.cgi" - any extension gives same result
----form_test_pl.htm
<html><body><head><title></title></head>
<form method="post" action="/cgi-bin/perl_try.pl">
<input type="submit" value="Submit"></form></body></html>
----clicking this gives a "file not found"
----form_test_pl.htm
<html><body><head><title></title></head>
<form method="post" action="/usr/local/bin/apache2/cgi-bin/perl_try.pl">
<input type="submit" value="Submit">
</form></body></html>
----clicking this, browser asks to open or save - changing owner/extensions makes no difference
The 2 cgi scripts tried in /usr/local/bin/apache2/cgi-bin/:
root@asus:/usr/local/bin/apache2/cgi-bin# ls -l
-rwxr-xr-x 1 Peter_73 users 76 Jul 30 21:26 perl_try.pl
-rwxr-xr-x 1 Peter_73 users 91 Jul 30 22:03 yabasic.cgi
----yabasic.cgi
#!/usr/local/bin/yabasic # (correct path)
print "Content-type: text/html"
print
print
print "It works."
end
----perl_try.pl
#!/usr/bin/perl # (correct path)
print "Content-type: text/html\n\n";
print "Hello, World.";
Peter_73.conf has also been enabled with "a2ensite Peter_73.conf"
apache2 was restarted after each modification of the config file with "apache2ctl restart"
Peter_73 log says:::1 - - [05/Aug/2015:21:23:01 +0800] "GET /server-status HTTP/1.0" 200 1288 "-" "w3m/0.5.3+cvs-1.1055" which I think means it is OK
the logs in /var/log/apache2 never show anything and I have not found anything related to apache in any other log
I have ran out of ideas, there is probably a mistake somewhere but I can't see it.
Thank you for your help. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 05 Aug '15 17:51 Post subject: |
|
|
You defined the logs to be in a different folder
ErrorLog /var/www/Peter_73/log/error.log
CustomLog /var/www/Peter_73/log/access.log combined |
|
Back to top |
|
itsmemo
Joined: 31 Jul 2015 Posts: 3 Location: Australia
|
Posted: Thu 06 Aug '15 16:37 Post subject: |
|
|
After many unsuccessful attempts, I followed instructions from hosting companies that use Debian 7 but the result was the same before I inserted these new lines. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 07 Aug '15 10:46 Post subject: |
|
|
if you call apache2ctl -M you will see all loaded modules. Make sure that the cgi_module is loaded in apache.
If I remeber correctly in default debian there is conf-available/serv-cgi-bin.conf
and
mods-available/actions.conf |
|
Back to top |
|
itsmemo
Joined: 31 Jul 2015 Posts: 3 Location: Australia
|
Posted: Fri 14 Aug '15 9:00 Post subject: |
|
|
My last mistake was to call the cgi script in the wrong way, issuing "http://127.0.0.1/cgi-bin/whatever worked but I am sure I tried that, I must have had a mistake somewhere which I fixed without noticing in the many tries I had lasting a few days.
Thank you for your help. |
|
Back to top |
|
|
|
|
|
|