Difference between revisions of "Build Guide"
From Jay's Cafe' Wiki
Jayctheriot (talk | contribs) (Created page with "apt update apt full-upgrade -y") |
Jayctheriot (talk | contribs) m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<pre> | |||
sudo -i | |||
apt update | apt update | ||
apt full-upgrade -y | 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 | |||
</pre> | |||
At this point, all the software we need should be installed, but not correctly configured. So, here we go configuring things. | |||
<p /> | |||
'''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. | |||
<pre> | |||
useradd -G root,sudo,admin,netdev,www-data -s /bin/bash -c "Bayou Region Medical Guide" brmg | |||
passwd brmg | |||
</pre> | |||
Enter a strong password as this will have secure remote access and the ability to destroy everything if the password is guessed. | |||
<p /> | |||
'''Configure SSH server<p> | |||
Config ssh server to permit secure remote access with traditional username/password. | |||
<pre> | |||
sed -i "s/PasswordAuthentication\ no/PasswordAuthentication\ yes/g" /etc/ssh/sshd_config | |||
systemctl restart sshd | |||
</pre> | |||
'''Configuring Apache 2 and PHP'''<p> | |||
Enable some modules for Apache and PHP | |||
<pre> | |||
a2enmod php7.4 xml2enc geoip gd ssl | |||
phpenmod bz2 curl mysqli readline xml xmlrpc xmlreader xmlwriter xsl zip | |||
systemctl restart apache2 | |||
</pre> | |||
Remove the default webpage from the server. | |||
<pre> | |||
rm /var/www/html/index.php | |||
</pre> | |||
'''Configure Wordpress<p> | |||
Accessing the local database. | |||
<pre> | |||
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 | |||
</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:
- Configure hosts file
- Install and Configure: