Difference between revisions of "Creating an AdminSettings.php"

From Organic Design wiki
(code block round bash)
(Change source-code blocks to standard format)
 
Line 10: Line 10:
 
Inside the file [[MW:Manual:AdminSettings.php|AdminSettings.php]], populate the variables with the real mysql passwords for a user that has root privileges;
 
Inside the file [[MW:Manual:AdminSettings.php|AdminSettings.php]], populate the variables with the real mysql passwords for a user that has root privileges;
  
{{code|<PHP>
+
<source lang="PHP">
 
$wgDBadminuser      = 'wikiadmin';
 
$wgDBadminuser      = 'wikiadmin';
 
$wgDBadminpassword  = 'adminpass';
 
$wgDBadminpassword  = 'adminpass';
$domain            = 'organicdesign.co.nz';  
+
$domain            = 'organicdesign.co.nz';
</PHP>
+
</source>
}}
 
  
 
Set ''$domain'' to the domain of the wiki you're running the script on (don't prepend the domain with ''www'' or ''wiki'').
 
Set ''$domain'' to the domain of the wiki you're running the script on (don't prepend the domain with ''www'' or ''wiki'').
  
 
The bash commands to change the file are provided;
 
The bash commands to change the file are provided;
{{code|<bash>
+
<source lang="bash">
 
cd /var/www/mediawiki-[version]
 
cd /var/www/mediawiki-[version]
 
cp AdminSettings.sample AdminSettings.php
 
cp AdminSettings.sample AdminSettings.php
 
nano AdminSettings.php
 
nano AdminSettings.php
 
chmod 700 AdminSettings.php # Changing the permissions of the file
 
chmod 700 AdminSettings.php # Changing the permissions of the file
</bash>}}
+
</source>
  
 
Alternatively, already created [[MW:Manual:AdminSettings.php|AdminSettings.php]] files could be copied to new instances of mediawiki.
 
Alternatively, already created [[MW:Manual:AdminSettings.php|AdminSettings.php]] files could be copied to new instances of mediawiki.

Latest revision as of 18:11, 22 May 2015

Procedure.svg Creating an AdminSettings.php
Organic Design procedure

To be able to run maintenance scripts, a file called AdminSettings.php must be created which contains global variables for the username and password for the database that the instance of mediawiki uses.

The file in OD/Wikia is located in /var/www/mediawiki-[version]. The file AdminSettings.sample in the same directory is an example. Inside the file AdminSettings.php, populate the variables with the real mysql passwords for a user that has root privileges;

$wgDBadminuser      = 'wikiadmin';
$wgDBadminpassword  = 'adminpass';
$domain             = 'organicdesign.co.nz';

Set $domain to the domain of the wiki you're running the script on (don't prepend the domain with www or wiki).

The bash commands to change the file are provided;

cd /var/www/mediawiki-[version]
cp AdminSettings.sample AdminSettings.php
nano AdminSettings.php
chmod 700 AdminSettings.php # Changing the permissions of the file

Alternatively, already created AdminSettings.php files could be copied to new instances of mediawiki.

See also