Mediawiki arbitrary script excecution prevention

Status
Not open for further replies.

fn7

New Member
Messages
3
Reaction score
0
Points
0
I am trying to install mediawiki without using softaculous but I haven't worked out how to do a similar thing to editing the httpd.conf file with cpanel and would like to know how, if possible you can do it.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
You cannot edit the httpd.conf file here, but you sometimes can do things via .htaccess etc.

Exactly what do you want to do?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Well, just create a .htaccess file in the directory in question and add:

Code:
AllowOverride None
 
   # Serve HTML as plaintext, don't execute SHTML
AddType text/plain .html .htm .shtml .php
 
   # Don't run arbitrary PHP code.
php_admin_flag engine off

and that (at least on Chopin) turns off execution of .php files and serves them up as plain text.

Be aware of other pitfalls of allowing uploads. ie, you are 100% responsible for the content on your site. Copyright infringement, adult material, etc. Also, the files must be part of the site, not just uploaded as an online archive.
 
Last edited:

fn7

New Member
Messages
3
Reaction score
0
Points
0
Thank you for that, I will either make the wiki admin edit only or constantly moderate user posts however I didn't beleve that apache would fully allow .htaccess functions like that though seeing that it does thanks :biggrin:!
 
Status
Not open for further replies.
Top