Build Guide

From Jay's Cafe' Wiki
sudo -i
apt update
apt full-upgrade -y
apt install vim-nox vim-scripts vim-youcompleteme exuberant-ctags build-essential bash-completion\
     vim-nox vim-scripts vim-youcompleteme exuberant-ctags bash-completion git apache2\
     libapache2-mod-geoip  mysql-client postfix mailutils mailutils-mh lynx-common tre-agrep\
     exuberant-ctags imagemagick php inkscape php openssh-server php-bz2 php-curl php-gd php-mysql\
     php-readline  php-x* php-zip libapache2-mod-php libapache2-mod-geoip -y

wget http://wordpress.org/latest.tar.gz
cd /var/www/
tar xvzf /root/latest.tar.gz
cd html
mv /var/www/wordpress/* .
cd ..
chown -R www-data. html
chmod -R g+w html
cd /root
wget https://downloads.sourceforge.net/project/webadmin/webmin/1.979/webmin_1.979_all.deb
dpkg -i webmin*
apt install -f

At this point, all the software we need should be installed, but not correctly configured. So, here we go configuring things.

Adding a Non-Administrator User

We need to add a non-administrative user which we will use to login and drop to an administrative level if we so desire.

useradd -G root,sudo,admin,netdev,www-data -s /bin/bash -c "Bayou Region Medical Guide" brmg
passwd brmg

Enter a strong password as this will have secure remote access and the ability to destroy everything if the password is guessed.

Configure SSH server

Config ssh server to permit secure remote access with traditional username/password.

sed -i "s/PasswordAuthentication\ no/PasswordAuthentication\ yes/g" /etc/ssh/sshd_config
systemctl restart sshd

Configuring Apache 2 and PHP

Enable some modules for Apache and PHP

a2enmod php7.4 xml2enc geoip gd ssl
phpenmod bz2 curl mysqli readline xml xmlrpc xmlreader xmlwriter xsl zip
systemctl restart apache2

Remove the default webpage from the server.

rm /var/www/html/index.php

Configure Wordpress

Accessing the local database.

cd /var/www/html/
cp wp-config-sample.php wp-config.php
sed -i "s/database_name_here/wp-brmg/g" wp-config.php
sed -i "s/username_here/wp-brmg/g" wp-config.php
sed -i "s/password_here/<replace with password from above>/g" wp-config.php

Still to do for production server: