WordPress install apache server for CTF Lab
First, need Ubuntu Server installation guide here WordPress Install Apache
Install apache2 web service and maria database server
1 |
sudo apt install apache2 mariadb-server mariadb-client -y |
Now mysql setup secure login
- Enter current password for root: (your root user password)
- Change the root password: n
- Remove anonymous user: y
- Disallow root login remotely: y
- Remove test database and access to it: y
- Reload privilege tables now: y
Now that MariaDB is installed Create Database for WordPress
1 |
sudo mysql -u root -p |
- create database ‘your-database-name;
- create user ‘your-user-name’@’localhost’ identified by ‘password’;
- grant all on your-database-name.* to ‘your-user-name’@’localhost’ identified by ‘user-password’ with grant option;
- flush privileges;
- exit
Database setup is complete now download WordPress you can download here WordPress latest link
1 |
sudo wget https://wordpress.org/latest.zip |
Now unzip WordPress file to the apache root folder with unzip command -d mean destination
1 |
sudo apt install unzip |
1 |
sudo unzip latest.zip -d /var/www/html/ |
Ownership and permission change WordPress directory
1 |
sudo chown -R www-data:www-data /var/www/html/wordpress/ |
1 |
sudo chmod -R 755 /var/www/html/ |
Install the most important WordPress requrement PHP and PHP-MySQL
1 |
sudo apt install php php-mysql |
1 |
sudo service apache2 restart |
Now Setup WordPress on browser
Now connect your database name and password
- Database Name: (your-data-base-name-hare)
- Username: (your-database-user-name-here)
- Password: (your-database-user-passowrd-here)
- Submit
Run the installation
Now Configure your site name and user name for login WordPress and your email address
- Site Title: (your site title here)
- Username: (your WordPress user name here)
- Password: (your WordPress user password
- Confirm Password: (confirm password
- your Email: (your mail address)
- Install WordPress
After install now login here your WordPress password and username and customize your WordPress site
- your log in url
1 |
http://yourip/wp-admin |
This step is CTF Creator Follow the Step For IP address error change
Now got to your WordPress directory and open any editor wp-config.php file
1 |
cd /var/www/html/wordpress |
1 |
sudo nano wp-config |
and paste the code you can see the image file
1 2 3 |
wordpress: define( 'WP_SITEURL', 'http://' .$_SERVER['HTTP_HOST'].'/wordpress'); define( 'WP_HOME', 'http://' .$_SERVER['HTTP_HOST'].'/wordpress'); |
And restart your apache server