Error while doing wget - APACHE

webserver

(Tejas) #1

Hi,
I am unable to wget a http link from the same server on which apache is configured.
Following is the error message.
Resolving ***** (alliances.)… 52.34.178.189
Connecting to
**
(****)|ip|:80… connected.
HTTP request sent, awaiting response… 403 Forbidden
2018-02-26 11:52:32 ERROR 403: Forbidden.

Error LOG :-

AH01276: Cannot serve directory /home/tenders/html/services/viewdata/comtex/: No matching DirectoryIndex (index.html,index.php,index.php) found, and server-generated directory index forbidden by Options directive


(Michael Träumner) #2

Please have a look here:

It is an explanation why your error occurs. If you still have problems don’t be shy to ask again.


(Tejas) #3

Thanks for your quick reply.
But I tried all the above steps, but still getting the same error.


(Michael Träumner) #4

Ok, can you give us some infos about the permissions of the directory please? Do you have an index-file at the directory?


(Tejas) #5

APACHE CONFIG FILE ENTRY:-

ServerAdmin *****
DocumentRoot *****
CustomLog access_log combined env=!StaticContent
ServerName *****


    SetOutputFilter DEFLATE

    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png|zip)$ no-gzip dont-vary

    DeflateFilterNote Input input_info
    DeflateFilterNote Output output_info
    DeflateFilterNote Ratio ratio_info
    LogFormat '"%r" %{output_info}n/%{input_info}n (%{ratio_info}n%%)' deflate

<Directory*****>
    AllowOverride All
    Require all granted
</Directory>

=====================================
Permission for that file (Document Root) :-

drwxr-xr-x

Also I have index.php inside document root
Permission for the file index.php is :- -rw-rw-r–

Permission of file which I am unable to wget is -rw-r–r-- and name of that file is date.php


(Michael Träumner) #6

Could you have a look at your httpd.conf please. There should be the following lines:

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

If so, please change to:

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

Get it from this site:


(Tejas) #7

The entry is already present in the configuration file.

DirectoryIndex index.html index.php


(Michael Träumner) #8

@mrmarkuz Do you have another idea?


(Markus Neuberger) #9

No, sorry but I’ll have a deeper look at it in the evening…


(Tejas) #10

To clarify further,
Its an AWS server on which I want to do wget.
The script which i want to wget, downloads and update some entry in db. Also if I run that script from firefox browser , i am able to run the script.I am getting error only when I run it from my AWS server.


(Markus Neuberger) #11

Could you please post the full wget command you used? As far as I understood only wget is not working, Firefox works. Does it work on another client with wget?


(James Shawn) #12

i remember i had this problem with steroids for sale myself. a friend of mine greatly helped me. will ask him and might come back with updates


(Jeroen Visser) #13

Is this not due to forced Options directives, that can not be overruled ? Have you tried adding date.php to the DirectoryIndex ? (not too well versed in AWS)


(Tejas) #14

@mrmarkuz
Full wget command:-

wget http://alliances.tendersinfo.com/comtex/datewise_feed.php?tender_type=projects

Although i am able to wget all other links on the server. I am facing problem with the links which are located under /home//html/services/viewdata path only.

@planet_jeroen
Tried your idea also but no luck.


(Marc) #15

Try with curl -L, it might show additional error information


(Michael Träumner) #16

Please try with:

wget -U mozilla http://alliances.tendersinfo.com/comtex/datewise_feed.php?tender_type=projects


(Tejas) #17

@m.traeumner - Tried that also but getting same error.

@dnutan - Please find the output of curl command :-
Command - curl -L (http…)
Output -

Forbidden

You don’t have permission to access /orientswiss/on this server.


(Michael Träumner) #18

Could you please compare the permissions of the folders and files which work for you with the permissions which don’t work.


(Tejas) #19

@m.traeumner Permission is same in both the files which i am trying to wget.


(Michael Träumner) #20

Sorry, I don’t have an other idea at the moment.