Setting up a ubuntu for my development enviroment
So I'm experimenting with a new development environment - this one is a ubuntu 20.04 running inside of Oracle VM Virtual Box. The initial installation was done following the cookbook from Abhishek Prakash.
Initial VM setup
- Download and install VirtualBox
- Download the ISO for Ubuntu
- Start Virtual Box and create a new VM - I specified 4GB memory, 4 processor and approx 60GB Hard Disc
- Start the VM using the ISO image and complete the Ubuntu installation
Development Environment Setup
- Install fossil using
sudo apt install fossil
- Install ant using
sudo apt install ant
- Install npm using
sudo apt install npm
- Install php 7.4 using
sudo apt install php7.4
- Create directory for the website development
mkdir website
- Clone the website fossil and open it:
fossil clone http://david:password@virtual.internal:7780/website website.fossil
cd website
fossil open ../website.fossil
- Install prereq npm packages:
sudo npm -g install jshint@2.11
sudo npm -g install qunit@2.10
sudo npm -g install ajv-cli@4.0
- Test the build by
cd build
ant rebuild-all
WordPress setup
- Install prereqs by
sudo apt install apache2 mysql-server libapache2-mod-php php-mysql
- Configure and enable apache2 by
sudo systemctl start apache2
sudo systemctl enable apache2
sudo ufw allow in "Apache Full"
- Configure mysql and setup a database for wordpress by
sudo mysql_secure_installation
-
sudo mysql -u root -p
and enter these commands:CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER wordpress IDENTIFIED WITH mysql_native_password BY '12345';
GRANT ALL ON wordpress.* TO 'wordpress'@'%';
quit
- Install php extensions used by wordpress using
sudo apt install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
- Restart apache2 using
sudo systemctl restart apache2
- Install curl using
sudo apt install curl
- Download wordpress using
curl -O https://wordpress.org/latest.tar.gz
- Extract the archive and move under apache:
tar -xzvf latest.tar.gz
sudo mv wordpress /var/www/html
sudo chown -R www-data:www-data /var/www/html/wordpress
sudo chmod -R 775 /var/www/html/wordpress
- Setup the wordpress config:
cd /var/www/html/wordpress
sudo mv wp-config-sample.php wp-config.php
- Edit wp-config.php to setup the credentials for the database
- Setup the apache2 config for wordpress:
sudo nano /etc/apache2/sites-available/wordpress.conf
- Make the contents to these lines:
<Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> <VirtualHost *:80> ServerName wordpress ServerAdmin webmaster@localhost DocumentRoot /var/www/html/wordpress ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
- Check the config via:
apache2ctl -t
- Enable it with
sudo a2ensite wordpress
- Disable the default site with
sudo a2dissite 000-default
- Activate the new apache2 configuration with
sudo systemctl restart apache2
- Complete the wordpress install by browsing the image's website
phpMyAdmin installation
- Install phpmyadmin via
sudo apt install phpmyadmin
- You may need to enable the apache2 conf via:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo systemctl reload apache2
Added the Directory section to the wordpress.conf configuration file for wordpress (needed to get the permalink structure to work!)