LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bugzilla3 Error 404 Not Found problem (http://www.linuxquestions.org/questions/linux-newbie-8/bugzilla3-error-404-not-found-problem-753725/)

qhhatman 09-08-2009 10:31 PM

Bugzilla3 Error 404 Not Found problem
 
I'm using the Ubuntu 9.04 (Jaunty jackalope) server and am trying to get bugzilla running for internal use only. It seems that everything loaded properly and mysql was setup properly. But when I try to run bugzilla3 from firefox (I'm just doing http://myipaddress/bugzilla) I get the 404 Not Found error that says "The requested URL /usr/lib/cgi-bin/bugzilla3/index.cgi was not found on this server." That directory does exist and index.cgi is there. I'm new to apache things so I may be missing something there? I found that if I do http://myipaddress/cgi-bin/bugzilla3/index.cgi in firefox then bugzilla runs but without a skin/template (not nice looking at all with no formatting). When that worked I also tried changing /var/www/bugzilla/index.html to reference /cgi-bin/bugzilla3/index.cgi instead of /usr/lib/cgi-bin/bugzilla3/index.cgi as it was initially but that still resulted in the same 404 error mentioned above. Does anybody know what is going on here. I suspect this is just me being a newbie, but I'd appreciate some guidance. I've searched loads of forums and haven't found any solutions yet.

anomie 09-08-2009 11:40 PM

Check the output of:
Code:

# grep '^ *CustomLog' httpd.conf
Tail the file that's specified (preceded by ServerRoot, if it's a relative path), e.g.:
Code:

# tail -f /var/log/httpd-access_log
Then attempt to view the page again. What does the error message in the access log say exactly?

I'm not sure, but it sounds like you may need to set up a ScriptAlias for "bugzilla".

qhhatman 09-09-2009 02:32 AM

Thanks for the help anomie. I don't actually have a httpd.conf file. Ubuntu seems to have changed how they do that. Instead I looked in the sites-available directory (under apache2) and greped on bugzilla3.conf. There is no line with CustomLog in that file. I edited the file looking for variations on that name. There was nothing. So I went to /var/log/apache2 and tailed access.log which showed me my most recent attempt to load the page. The exact line in the log is:
192.168.1.2 - - [09/Sep/2009:15:10:27 +0800] "GET /usr/lib/cgi-bin/bugzilla3/index.cgi HTTP/1.1" 404 283 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"

In my bugzilla3.conf file it does have the following:
<Directory "/usr/lib/cgi-bin/bugzilla3">
AddHandler cgi-script cgi
DirectoryIndex index.cgi
Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I thought that top line is what let me enter http:/serveripaddress/cgi-bin/bugzilla3/index.cgi and have it work (with index.cgi actually under /usr/lib...). But I'm an apache weanie so may be completely wrong about that.

Based on your thoughts I also tried adding a ScriptAlias to the bugzilla3.conf file (and restarting apache) but that didn't seem to do anything. It is certainly possible that I didn't do the ScriptAlias correctly as this was the first time I've learned of this directive.

Any other thoughts you might have on this problem will be appreciated!

anomie 09-09-2009 04:51 PM

Quote:

Originally Posted by qhhatman
I don't actually have a httpd.conf file. Ubuntu seems to have changed how they do that. Instead I looked in the sites-available directory (under apache2) and greped on bugzilla3.conf.

Those crazy Ubuntu devs. (I should have fired up my Ubuntu laptop before suggesting where to look for httpd's config...)

Quote:

Originally Posted by qhhatman
I went to /var/log/apache2 and tailed access.log which showed me my most recent attempt to load the page. The exact line in the log is:
Code:

192.168.1.2 - - [09/Sep/2009:15:10:27 +0800] "GET /usr/lib/cgi-bin/bugzilla3/index.cgi HTTP/1.1" 404 283 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"

Sure enough, that's a HTTP 404. Could you copy and paste the exact path from that log and then run in your terminal:
Code:

$ file /usr/lib/cgi-bin/bugzilla3/index.cgi
You're doubly sure it is there?

What happens if you (temporarily) rename the index.cgi file to index.cgi.foo? Does your browser show you a directory listing? (It should, based on your Directory setup.)

qhhatman 09-10-2009 12:40 AM

Result of the file command:
/usr/lib/cgi-bin/bugzilla3/index.cgi: a /usr/bin/perl -wT script text executable

So it really is at that path despite the log entry.

When I rename index.cgi I get the same result, the 404 error, because then it really isn't there.

Previously I mentioned that if if I do http://myipaddress/cgi-bin/bugzilla3/index.cgi in firefox then bugzilla runs but without a skin/template (not nice looking at all with no formatting). While experimenting with all of this I tried creating an account from there. Nothing appeared on the screen indicating success or failure, but the log, interestingly, indicated that the call to the createaccount.cgi succeeded but no skins could be found. Here's the log entires:

192.168.1.2 - - [09/Sep/2009:15:46:42 +0800] "GET /cgi-bin/bugzilla3/createaccount.cgi HTTP/1.1" 200 1641 "http://192.168.1.30/cgi-bin/bugzilla3/index.cgi" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"
192.168.1.2 - - [09/Sep/2009:15:46:43 +0800] "GET /bugzilla3/skins/custom/global.css HTTP/1.1" 404 283 "http://192.168.1.30/cgi-bin/bugzilla3/createaccount.cgi" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"
192.168.1.2 - - [09/Sep/2009:15:46:43 +0800] "GET /bugzilla3/skins/standard/global.css HTTP/1.1" 404 283 "http://192.168.1.30/cgi-bin/bugzilla3/createaccount.cgi" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"
192.168.1.2 - - [09/Sep/2009:15:46:43 +0800] "GET /bugzilla3/skins/contrib/Dusk/global.css HTTP/1.1" 404 287 "http://192.168.1.30/cgi-bin/bugzilla3/createaccount.cgi" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"

So from this it looks like it found some alias somewhere that didn't add the /usr/lib in front of /cgi-bin. I'm not sure why it happened there but won't do the same from my initial browser entry.

anomie 09-10-2009 10:52 AM

For grins, I would try:
Code:

ScriptAlias /bugzilla "/usr/lib/cgi-bin/bugzilla3"
Reload Apache and then try to visit: http ://your.host/bugzilla

If that doesn't work, let's see your entire Apache configuration.

qhhatman 09-10-2009 08:02 PM

that didn't work either. By the way, I do have other sites that I've successfully run from this server, though none of them are setup to run .cgi's from another directory path like bugzilla does. I really appreciate the continued help anomie! It sure is nice to have knowledgeable people like yourself to help us greenhorns.

Here is my full bugzilla3.conf file:
<VirtualHost *:80>

ScriptAlias /bugzilla "/usr/lib/cgi-bin/bugzilla3"

<Directory "/usr/share/bugzilla3/web">
AllowOverride none
Order allow,deny
Allow from all
</Directory>

<Directory "/usr/lib/cgi-bin/bugzilla3">
AddHandler cgi-script cgi
DirectoryIndex index.cgi
Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/var/lib/bugzilla3/data">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/usr/lib/cgi-bin/bugzilla3">
AddHandler cgi-script cgi
DirectoryIndex index.cgi
Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/var/lib/bugzilla3/data">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

anomie 09-11-2009 03:59 PM

Quote:

Originally Posted by qhhatman
It sure is nice to have knowledgeable people like yourself to help us greenhorns.

Well, don't get too far ahead of yourself. I haven't actually helped fix anything yet. ;)

Quote:

Originally Posted by qhhatman
Code:

        <Directory "/usr/lib/cgi-bin/bugzilla3">
                AddHandler cgi-script cgi
                DirectoryIndex index.cgi
                Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from all
        </Directory>


That section got my attention. Is it possible /usr/lib/cgi-bin/bugzilla3 is a symlink (or some of its files are symlinks)?

Try:
Code:

$ ls -ld /usr/lib/cgi-bin/bugzilla3
(do not use a trailing slash)

Symlinks have a 'l' in the file type (i.e. first byte) position of a long listing. They also visually look different than the real file. Example:
Code:

lrwxrwxrwx. 1 mrbig mrbig 5 2009-09-11 15:54 home2 -> /home
If you find this to be the case with /usr/lib/cgi-bin/bugzilla3 or any of its parents - /usr, /usr/lib, /usr/lib/cgi-bin - then I would remove +SymLinksIfOwnerMatch from your Options directive and try again. It may be that ownership is messed up, and this would be a quick way to test that.

-------

I'd add that it would be very helpful if you added a -
Code:

LogLevel info
- directive to your Apache configuration. Then, check Apache's error log after attempting to view the page again. That may yield some useful clues.

-------

One more thing: remember that you need to restart (gracefully or otherwise) Apache web server after making configuration changes for them to take effect.

qhhatman 09-13-2009 09:45 PM

Success!
I'm not sure why it didn't work last Friday given the changes. But today I added the LogLevel info command (after checking that the directory's were not links, which they are not) and restarted apache. I had done a graceful restart last Friday but today I just did an "/usr/sbin/apache2ctl -k restart". I also cleared the cache on FF before loading bugzilla. Whatever happened today it worked and I think the AliasScript you advised me about is what did it. Now I just have to get the skins to work. I see from the page source it is looking for the css files in /bugzilla3/skins/standard/*.css, so hopefully I can just add an alias in my bugzilla3.conf file and get the skins to work properly.

Thanks for your help anomie, I appreciate it!


All times are GMT -5. The time now is 08:35 PM.