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!

folder permission issue 1

Status
Not open for further replies.

synergywei

IS-IT--Management
Oct 20, 2010
11
US
I'm having issue with media wiki image upload folder permission. I'm not sure if this is the right place to post the question, but hopefully some linux guru can help me out on this.

I'm running:
media wiki 1.15
mysql Ver 14.14 Distrib 5.1.48
Apache/2.2.16 (Unix)
php version 5.3.3 OS: F
Linux 2.6.34.6-54.fc13.i686.PAE

I got error message "The upload directory (public) is not writable by the webserver."
I'd like to know
1. which folder is the image uploader tries write to? Is it the 'images' folder located in /var/ ? /var/ is my default web folder.
2. I have already set the folder and sub folder permission for 'images' to 777, but i still can't upload anything. the folder is owned by root but 777 should allow anyone to write anything to it?
3. which user is actually running the apache process? can i assume it's apache? do i need to set the folder ownership and group all to 'apache'?

many thanks.
 
1. That's correct. You'll find a README file in that directory that confirms your suspicion. As you've noticed, it actually creates subdirectories under there to store the images. Unless, of course, the location has been changed by modifying $wgUploadPath in your LocalSettings.php.

2. Perhaps one of the parent directories (/var, /var/www, or /var/www/html) has some more restrictive permissions that are preventing... although, nah, ignore that, or else it wouldn't even be able to display your wiki. :) See below.

3. Type ps -fC httpd and look at the first column to see which user your Apache server is running under.

When you have the answer to 3, try su-ing to that user and creating a file and/or directory in that location and let us know how you go.

Annihilannic.
 
It may be worth moving this to the Apache forum
if you have 777 permisions & still cant wright to the directory it sounds like something is missing in the Apache settup (Web_dav support?) but I am not experienced enough to advise further.


I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
try chown apache.apache <directoryname>

That makes the owner and group of the directory apache, and unless there are more restrictive permissions above it might help. (if you look in your /etc/httpd/httpd.conf file it should tell you who apache is running as. - that file location may vary, but locate httpd.conf should find it - )

 
thanks guys for the reply..

I've confirmed both methods that apache server is running as apache of group apache. i've changed ownership of the folder 'images' to apache and folder permission to 777 starting from /var/ --> wiki --> images, but still not working.

there is no variable $wgUploadPath in Localsettings.php, I added in with the path /var/ still not working.

I created a password for user apache and 'su' as apache. I got this error message:

[luw@southpole images]$ su apache
Password:
This account is currently not available.

Could this be the root of the problem? how do i fix it?

many thanks.

Lu
 
User "apache" is probably set for "nologin" in its profile. Usually the system accounts are not set up to be logged into.

Just for fun, change the owner of the "wiki" directory to apache for testing.

Also go into both your wiki and images directory and do an ls -la to list everything. Look for files called .htaccess and if they are present temporarily rename them --> mv .htaccess .htaccess-saved. If that fixes your problem there are restrictive access restrictions in one of those files.

Just a few more ideas I would try for testing....
 
still not working... I have set owner, group to apache, permission 777.

would you please take a look at the LocalSettings.php file, if you see anything wrong with it? many thanks.

***********************

<?php

# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
#
# If you customize your file layout, set $IP to the directory that contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined( 'MW_INSTALL_PATH' ) ) {
$IP = MW_INSTALL_PATH;
} else {
$IP = '/usr/share/mediawiki';
}

$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );

require_once( "$IP/includes/DefaultSettings.php" );

# If PHP's memory limit is very low, some operations may fail.
# ini_set( 'memory_limit', '20M' );

if ( $wgCommandLineMode ) {
if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
die( "This script must be run from the command line\n" );
}
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

$wgSitename = "NetDoc";

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs please see:
## $wgScriptPath = "/wiki";
$wgScriptExtension = ".php";

## UPO means: this is also a user preference option

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "**********";
$wgPasswordSender = "************";

$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "wikidb";
$wgDBuser = "wikiuser";
$wgDBpassword = "************";

# MySQL specific settings
$wgDBprefix = "";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

# Experimental charset support for MySQL 4.1/5.0.
$wgDBmysql5 = true;

## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "en_US.utf8";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
# $wgHashedUploadDirectory = true;

## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
$wgUseTeX = false;

$wgLocalInterwiki = strtolower( $wgSitename );

$wgLanguageCode = "en";

$wgSecretKey = "69abc77f98951cba888dd6df9dcedbd6e18e3a3cb2771642643ceabf0fa31072";

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
$wgDefaultSkin = 'monobook';

## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
# $wgEnableCreativeCommonsRdf = true;
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
# $wgRightsCode = ""; # Not yet used

$wgDiff3 = "/usr/bin/diff3";

# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );

# Logo for CAR NETDOC
$wgLogo = "{$wgScriptPath}/CAR_logo.JPG";

#Define admin user for Wiki
$wgDBadminuser = 'wikiadmin';
$wgDBadminpassword = '**************';
$wgUploadPath = '/var/
 
problem solved. SE LINUX is blocking http to access the folder
once I set SE linux to permissive or blocked, then upload is working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top