Diferencia entre revisiones de «Mediawiki»

De TechShareRoom wiki
Línea 13: Línea 13:
Partimos de que tienes acceso con permisos de administrador en un servidor con Ubuntu por ssh.
Partimos de que tienes acceso con permisos de administrador en un servidor con Ubuntu por ssh.


=== Preliminary ===
<syntaxhighlight lang="bash ">
<syntaxhighlight lang="bash ">
#First of all make sudo works
sudo su
sudo su
 
</syntaxhighlight>
#Now in this case our admin name is '''root'''
Now you have to execute the next scripts.
<syntaxhighlight lang="bash ">
#!/bin/bash


#Upgrade system
#Upgrade system
apt update & apt upgrade -y
apt update & apt upgrade -y
#ufw
apt install -y ufw
ufw allow 22
ufw allow 80
ufw allow 443
ufw allow 10000
ufw enable
</syntaxhighlight>
=== Webmin ===
<syntaxhighlight lang="bash ">
#!/bin/bash


apt install -y software-properties-common apt-transport-https


wget https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
chmod +x setup-repos.sh
sh setup-repos.sh
apt install -y --install-recommends webmin
#Configure user login
username="admin"
password="YOURPASSWORD"
echo "${username}:${password}:0" >> /etc/webmin/miniserv.users
/usr/share/webmin/changepass.pl /etc/webmin ${username} ${password}
echo "${username}: acl adsl-client apache at backup-config bacula-backup bandwidth bind8 change-user cluster-copy cluster-cron cluster-passwd cluster-shell cluster-software cluster-useradmin cluster-usermin cluster-webmin cpan cron custom dfsadmin dhcpd dovecot exim exports fail2ban fdisk fetchmail filemin filter firewall firewall6 firewalld fsdump heartbeat htaccess-htpasswd idmapd inetd init inittab ipfilter ipfw ipsec iscsi-client iscsi-server iscsi-target iscsi-tgtd krb5 ldap-client ldap-server ldap-useradmin logrotate logviewer lpadmin lvm mailboxes mailcap man mount mysql net nis openslp package-updates pam pap passwd phpini postfix postgresql ppp-client pptp-client pptp-server proc procmail proftpd qmailadmin quota raid samba sarg sendmail servers shell shorewall shorewall6 smart-status smf software spam squid sshd status stunnel syslog-ng syslog system-status tcpwrappers time tunnel updown useradmin usermin webalizer webmin webmincron webminlog xinetd xterm" >> /etc/webmin/webmin.acl
systemctl restart webmin
systemctl status webmin
</syntaxhighlight>
=== Apache ===
<syntaxhighlight lang="bash ">
#!/bin/bash
apt install -y apache2
## Put YOURAPACHEFILE.conf in /etc/apache2/sites-available and enable with:
#a2ensite YOURAPACHEFILE.conf #enable site conf
#a2dissite 000-default.conf #disable a site conf
#a2enmod rewrite - MUY IMPORTANTE
#systemctl restart apache2
</syntaxhighlight>
=== Cert ===
'''Pending'''
=== MYSQL ===
<syntaxhighlight lang="bash ">
#!/bin/bash


#mysql
apt install -y mysql-server
apt install -y mysql-server
mysqladmin -u root -pYOURPASSWORD
 
#mysql -u root -p
#configure mysql
##way 1
mysql -u root -p #Entering with blank password
sudo mysql
sudo mysql
SELECT user,plugin,host FROM mysql.user WHERE user = 'root';
SELECT user,plugin,host FROM mysql.user WHERE user = 'root';
Línea 33: Línea 85:
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
exit
exit
#Now to enter you can use
#mysql -u root -pYOURPASSWORD
##way 2
mysql_secure_installation
#Now to enter you can use
#mysql -u root -pYOURPASSWORD
</syntaxhighlight>


#php + phpmyadmin
=== php + phpmyadmin ===
<syntaxhighlight lang="bash ">
#!/bin/bash
apt install -y php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath libapache2-mod-php phpmyadmin php-intl
apt install -y php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath libapache2-mod-php phpmyadmin php-intl


#Option YES
#Option YES
#password for "phpmyadmin" -> Left blank.
#password for "phpmyadmin" -> Left blank.
</syntaxhighlight>
#mediawiki
#mediawiki permissions


chown -R www-data:www-data /var/www/html/YOURWIKIFOLDER
chmod -R 755 /var/www/html/YOURWIKIFOLDER


</syntaxhighlight>
</syntaxhighlight>