Mediawiki/Installing

From r00tedvw.com wiki
(Difference between revisions)
Jump to: navigation, search
(configure apache)
(discover httpd user name)
Line 122: Line 122:
 
  apache:x:48:48:Apache:/var/www:/sbin/nologin
 
  apache:x:48:48:Apache:/var/www:/sbin/nologin
 
  mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
 
  mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
 +
the user we want is
 +
apache:x:48:48:Apache:/var/www:/sbin/nologin

Revision as of 15:17, 28 April 2014

All instructions done on Oracle Linux 6.5

Contents

install apache2

find the package name and install

~$ sudo yum search apache
Loaded plugins: security
...
httpd.x86_64 : Apache HTTP Server

~$ sudo yum install httpd.x86_64

install php & mysql

~$ sudo yum install php php-mysql php-gd mysql-server php-xml mysql

setup mysql

make sure mysql is started

~$ sudo service mysqld status
or
~$ sudo service mysqld start

setup the basics

~$ sudo mysql_secure_installation
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
 Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

login to db

~$ mysql -u root -p

Create mysql wiki user

~$ mysql> CREATE USER 'wiki'@'localhost' IDENTIFIED BY 'THISpasswordSHOULDbeCHANGED';
~$ mysql> exit

login as new user to verify account works

~$ mysql -u wiki -p
~$ mysql> exit

create DB

~$ mysql -u root -p
~$ mysql> CREATE DATABASE sewikidatabase;

verify DB creation

~$ mysql> SHOW DATABASES;

assign rights to wiki user for new database created

~$ mysql> GRANT ALL PRIVILEGES ON sewikidatabase.* TO 'wiki'@'localhost' IDENTIFIED BY 'wikiuserpassword' WITH GRANT OPTION;
~$ mysql> exit

verify permissions have been granted

~$ mysql -u wiki -p
~$ mysql> SHOW GRANTS;
+---------------------------------------------------------------------------------------------------------------+
| Grants for wiki@localhost                                                                                   |
+---------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'wiki'@'localhost' IDENTIFIED BY PASSWORD '*2K21458K438UYE85A38B9Y7Y78DAEBF4T8689YK4' |
| GRANT ALL PRIVILEGES ON `sewikidatabase`.* TO 'wiki'@'localhost' WITH GRANT OPTION                          |
+---------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

set apache and mysql to start on boot

~$ chkconfig httpd on
~$ chkconfig mysqld on

download mediawiki and verify

http://www.mediawiki.org/wiki/Download
http://da44en.wordpress.com/2004/08/16/practical-gnupg/
mediawiki

~$ wget http://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.6.tar.gz

gpg signature

~$ wget http://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.6.tar.gz.sig

gpg keys

~$ wget wget https://www.mediawiki.org/keys/keys.txt

import keys

~$ gpg --import keys.txt

verify file with detached sig

~$ gpg --verify mediawiki-1.22.6.tar.gz.sig mediawiki-1.22.6.tar.gz
gpg: Signature made Thu 24 Apr 2014 07:42:22 PM EDT using RSA key ID 7F901A30
gpg: Good signature from "Mark A. Hershberger <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 3CEF 8262 806D 3F0B 6BA1  DBDD 7956 EE47 7F90 1A30

This means the file was verified successfully

gpg: Good signature from "Mark A. Hershberger <[email protected]>"

create dir/export tar contents

~$ sudo mkdir /var/www/html/sitename.com
~$ tar -C /var/www/html/sitename.com -zxf mediawiki-1.22.6.tar.gz

configure apache

make a backup of the default httpd.conf

~$ sudo cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.default

edit httpd.conf

~$ sudo vi /etc/httpd/conf/httpd.conf
at the bottom of the file add:
<VirtualHost *:80>
       ServerName servername.com
       ServerAdmin [email protected]
       DocumentRoot /var/www/html/servername/mediawiki-1.22.g/
       TransferLog logs/servername-access_log
       ErrorLog logs/servername-error_log
</VirtualHost>

discover httpd user name

~$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
saslauth:x:499:76:"Saslauthd user":/var/empty/saslauth:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
abrt:x:173:173::/etc/abrt:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
tcpdump:x:72:72::/:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
adminuser:x:500:500::/home/adminuser:/bin/bash
apache:x:48:48:Apache:/var/www:/sbin/nologin
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash

the user we want is

apache:x:48:48:Apache:/var/www:/sbin/nologin
Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Open Source Products
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
MagicMirror
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
2020 Election
Volkswagen
Covid
NCDMV
Toolbox