You are on page 1of 2

Install all Dependencies: Install php, php modules, apache2,mysql

sudo apt update;


sudo apt install apache2;
sudo apt install ghostscript;
sudo apt install libapache2-mod-php
sudo apt install mysql-server
sudo apt install php
sudo apt install php-bcmath
sudo apt install php-curl
sudo apt install php-imagick
sudo apt install php-intl
sudo apt install php-json
sudo apt install php-mbstring
sudo apt install php-mysql
sudo apt install php-xml
sudo apt install php-zip

modify your virtual host directory to point to /var/www/html/regno


sudo mkdir -p /var/www/html/2012280
sudo chown www-data: /var/www/html/2012280
//Install WordPress: install wordpress on directory specified in your virtual host
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C
/var/www/html/2012280

Configure Apache for WordPress: start apache2 service


sudo nano /etc/apache2/sites-available/wordpress.conf
write within nano:
<VirtualHost *:80>
DocumentRoot /var/www/html/2012280/wordpress
<Directory /var/www/html/2012280/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /var/www/html/2012280/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
</VirtualHost>
ctrl+o and ctrl+x

Enable the site with:


sudo a2ensite wordpress

Enable URL rewriting with:


sudo a2enmod rewrite

Disable the default “It Works” site with:


sudo a2dissite 000-default

Reloading apache2 applies all these changes


Reload Apache2 Service
sudo service apache2 reload

Create Database:
sudo mysql -u root
CREATE DATABASE wordpress;
CREATE USER wordpress@localhost IDENTIFIED BY '<word111>';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO
wordpress@localhost;
FLUSH PRIVILEGES;
quit

Activate Firewall Only Allow Http, Https,Ftp,Ssh Connections


sudo apt-get install ufw
sudo ufw allow http
sudo ufw allow https
sudo ufw allow ftp
sudo ufw allow ssh
sudo ufw enable
sudo ufw status

Both Group Partners Should Have Both Websites Running On Each Server
Static ip

WordPress Credentials Setup


sudo -u www-data cp /var/www/html/2012280/wordpress/wp-config-sample.php
/var/www/html/2012280/wordpress/wp-config.php
sudo -u www-data sed -i 's/database_name_here/wordpress/'
/var/www/html/2012280/wordpress/wp-config.php
sudo -u www-data sed -i 's/username_here/wordpress/'
/var/www/html/2012280/wordpress/wp-config.php
sudo -u www-data sed -i 's/password_here/<word111>/'
/var/www/html/2012280/wordpress/wp-config.php

You might also like