Difference between revisions of "Build Guide"

From Jay's Cafe' Wiki
m
m
 
(One intermediate revision by the same user not shown)
Line 24: Line 24:
At this point, all the software we need should be installed, but not correctly configured. So, here we go configuring things.
At this point, all the software we need should be installed, but not correctly configured. So, here we go configuring things.
<p />
<p />
''Adding a Non-Administrator User
'''Adding a Non-Administrator User<p>
We need to add a non-administrative user which we will use to login and drop to an administrative level if we so desire.
We need to add a non-administrative user which we will use to login and drop to an administrative level if we so desire.
<pre>
<pre>
Line 32: Line 32:
Enter a strong password as this will have secure remote access and the ability to destroy everything if the password is guessed.
Enter a strong password as this will have secure remote access and the ability to destroy everything if the password is guessed.
<p />
<p />
''Configure SSH server
'''Configure SSH server<p>
Config ssh server to permit secure remote access with traditional username/password.
Config ssh server to permit secure remote access with traditional username/password.
<pre>
<pre>
Line 38: Line 38:
systemctl restart sshd
systemctl restart sshd
</pre>
</pre>
''Configuring Apache 2 and PHP
'''Configuring Apache 2 and PHP'''<p>
Enable some modules for Apache and PHP
Enable some modules for Apache and PHP
<pre>
<pre>
a2enmod php7.4 xml2enc geoip gd ssl
a2enmod php7.4 xml2enc geoip gd ssl
phpenmod bz2 curl gd mysqli readline xml xmlrpc xmlreader xmlwriter xsl zip
phpenmod bz2 curl mysqli readline xml xmlrpc xmlreader xmlwriter xsl zip
systemctl restart apache2
systemctl restart apache2
</pre>
</pre>
Line 49: Line 49:
rm /var/www/html/index.php
rm /var/www/html/index.php
</pre>
</pre>
Configure Wordpress to access the local database.
'''Configure Wordpress<p>
Accessing the local database.
<pre>
<pre>
cd /var/www/html/
cd /var/www/html/
Line 57: Line 58:
sed -i "s/password_here/<replace with password from above>/g" wp-config.php
sed -i "s/password_here/<replace with password from above>/g" wp-config.php
</pre>
</pre>
Still to do for production server:
*[[Configure hosts file]]
*Install and Configure:
**[[security certificates]]
**[[email]]
**[[phpmysqladmin]]

Latest revision as of 02:58, 26 July 2021

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: