Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Media Wiki Broken Image link

Status
Not open for further replies.

synergywei

IS-IT--Management
Oct 20, 2010
11
US
I'm trying to upload image to the media wiki. the uploading process seems to be working, i can see the file in the image folder and the link to the picture is right. But the picture won't show up on the page. anyone can tell me where i should start trouble shooting the issue? Thank you,.
 
Check error logs and double check folder permissions where the files are uploaded.
 
If you are doing this inside an organization they may have imposed image restrictions on your browser set by group policy or there may be something else restricting it.

Are you getting a box with a red X where the image is supposed to be? If so, and you right click on the box are you given an option to 'download pictures'?

If you are in an organization and you are using Internet explorer try downloading firefox or google chrome and going to the site in there. It is less likely any policy restrictions will affect them displaying images.

If the browser issues are ruled out then have a look at your /etc/httpd.conf file (I think) and see if there is an "addhandler" line that tells apache what to do with whatever image format you are using {JPG, PNG, ect}. These should be enabled by default, but.... :)

It could also be that apache doesn't have read permission on your image directory like the previous person stated. At the very least you should have that directory set to "644" which is rw for owner, r for group, and r for everyone else {rw-r--r--}

Just some ideas to look at....
 
Hi donb01, i think you're right that the problem is how apache is handling the file type.

I got a red x where the picture should be and the option 'save picture as' is greyed out. I don't think it's the group policy issue and all folders and subfolder within images has been set with permission 777.

i have no experience with apache, please take a look at the related section in the httpd.conf file. those are the snippet of code with the keyword 'addhandler'. what do i need to do for apache to handle image files? many thanks.

***********************************************
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

#
# For files that include their own HTTP headers:
#
#AddHandler send-as-is asis

#
# For type maps (negotiated resources):
# (This is enabled by default to allow the Apache "It Worked" page
# to be distributed in multiple languages.)
#
AddHandler type-map var

Alias /error/ "/var/
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/var/ AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback
</Directory>
 
I made the comment about the organizational policy because our organization uses a special DNS or gateway provider that filters anything that fits within certain categories (shopping, social networks, etc) and it will usually completely block access to those sites, but even when you get an E-mail if the message includes images from one of those sites it will block the images and you will just see boxes.

In my system in the /etc/httpd/conf directory there is a file called mime.types - this file defines all of the file extensions it should consider to be images. These are the ones in mine:

image/bmp bmp
image/cgm cgm
image/fits
image/g3fax g3
image/gif gif
image/ief ief
image/jp2
image/jpeg jpeg jpg jpe
image/jpm
image/jpx
image/naplps
image/png png
image/prs.btif btif
image/prs.pti
image/svg+xml svg svgz
image/t38
image/tiff tiff tif
image/tiff-fx
image/vnd.adobe.photoshop psd
image/vnd.cns.inf2
image/vnd.djvu djvu djv
image/vnd.dwg dwg
image/vnd.dxf dxf
image/vnd.fastbidsheet fbs
image/vnd.fpx fpx
image/vnd.fst fst
image/vnd.fujixerox.edmics-mmr mmr
image/vnd.fujixerox.edmics-rlc rlc
image/vnd.globalgraphics.pgb
image/vnd.microsoft.icon
image/vnd.mix
image/vnd.ms-modi mdi
image/vnd.net-fpx npx
image/vnd.sealed.png
image/vnd.sealedmedia.softseal.gif
image/vnd.sealedmedia.softseal.jpg
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff xif
image/x-cmu-raster ras
image/x-cmx cmx
image/x-icon ico
image/x-pcx pcx
image/x-pict pic pct
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd

There are lots of other things in there besides just image definitions, but you get the point.

What happens to these filetypes is usually controlled by the modules that are loaded into apache when it starts. It would be very strange to not have your image and mime type modules loaded, but....

Look in httpd.conf at the "loadmodule' statements and make sure none are commented out that have to deal with mime types or images. If there are, then remove the ## at the beginning of the line, save httpd.conf, and then do service httpd restart. I would strongly recommend making a backup copy of httpd.conf before twiddling.

Here is my loadmodule section so you can compare. Some of these might be different based on what version of Apache you're using....

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_anon_module modules/mod_authn_anon.so
## LoadModule authn_dbd_module modules/mod_authn_dbd.so -> available in the apache-mod_authn_dbd package
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_owner_module modules/mod_authz_owner.so
## LoadModule authnz_ldap_module modules/mod_authnz_ldap.so -> available in the apache-mod_ldap package
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
## LoadModule cache_module modules/mod_cache.so -> available in the apache-mod_cache package
## LoadModule disk_cache_module modules/mod_disk_cache.so -> available in the apache-mod_disk_cache package
## LoadModule mem_cache_module modules/mod_mem_cache.so -> available in the apache-mod_mem_cache package
## LoadModule dbd_module modules/mod_dbd.so -> available in the apache-mod_dbd package
## LoadModule bucketeer_module modules/mod_bucketeer.so <- only used for tests and debugging
## LoadModule dumpio_module modules/mod_dumpio.so <- only used for tests and debugging
#LoadModule echo_module modules/mod_echo.so
#LoadModule example_module modules/mod_example.so
#LoadModule case_filter_module modules/mod_case_filter.so
#LoadModule case_filter_in_module modules/mod_case_filter_in.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
LoadModule substitute_module modules/mod_substitute.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
## LoadModule deflate_module modules/mod_deflate.so -> available in the apache-mod_deflate package
## LoadModule ldap_module modules/mod_ldap.so -> available in the apache-mod_ldap package
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
## LoadModule proxy_module modules/mod_proxy.so -> available in the apache-mod_proxy package
## LoadModule proxy_connect_module modules/mod_proxy_connect.so -> available in the apache-mod_proxy package
## LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -> available in the apache-mod_proxy package
## LoadModule proxy_http_module modules/mod_proxy_http.so -> available in the apache-mod_proxy package
## LoadModule proxy_ajp_module modules/mod_proxy_ajp.so -> available in the apache-mod_proxy_ajp package
## LoadModule proxy_balancer_module modules/mod_proxy_balancer.so -> available in the apache-mod_proxy package
## LoadModule ssl_module modules/mod_ssl.so -> available in the apache-mod_ssl package
## LoadModule optional_hook_export_module modules/mod_optional_hook_export.so <- only used for tests
## LoadModule optional_hook_import_module modules/mod_optional_hook_import.so <- only used for tests
## LoadModule optional_fn_import_module modules/mod_optional_fn_import.so <- only used for tests
## LoadModule optional_fn_export_module modules/mod_optional_fn_export.so <- only used for tests
LoadModule mime_module modules/mod_mime.so
## LoadModule dav_module modules/mod_dav.so -> available in the apache-mod_dav package
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
## LoadModule suexec_module modules/mod_suexec.so -> available in the apache-mod_suexec package
LoadModule cgi_module modules/mod_cgi.so
#LoadModule cgid_module modules/mod_cgid.so <- use this with the worker MPM
## LoadModule dav_fs_module modules/mod_dav_fs.so -> available in the apache-mod_dav package
## LoadModule dav_lock_module modules/mod_dav_lock.so -> available in the apache-mod_dav package
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule actions_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
## LoadModule userdir_module modules/mod_userdir.so -> available in the apache-mod_userdir package
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so


Normally thinks like images are dealt with by default, but in your website configuration or .htaccess files you can make changes to the file handlers or add new ones as needed. Here is a link to some information that give you an overview of what file handlers do...


Normally you don't have to mess with the image ones much, but I have had to add special ones for running cgi scripts, xml files or shtml files on occasion depending on what I'm doing...

Hope there is some useful information here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top