Configure WordPress

Posted on

Enable WordPress Site in Apache

Each site should have its own root directory (example /var/www/ and /var/www/ for its domain.
Use mkdir to create folder then set permissions and change ownership to www-data

sudo mkdir /var/www/ && sudo mkdir /var/www/{public_html, logs}
chmod -R 755 /var/www/ 
chown -R www-data:www-data /var/www/

Copy the extracted worpress folder in

sudo mv wordpress/* /var/www/ 

Activate and disable websites in apache

Copy the default configuration file for each site

cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/

Edit the Config File for Each Site

sudo nano /etc/apache2/sites-available/
<Directory /var/www/>
   Require all granted
<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog /var/www/html/
    CustomLog /var/www/html/ combined

Save and Close then enable the config file

sudo a2ensite

Disable any unused sites

 sudo a2dissite 000-default.conf

Restart Apache webservices

sudo systemctl restart apache2

The WordPress website should now be running. In a web browser enter http://localhost this should open the setup-config.php webpage. Select language to proceed to the welcome screen. Read the webpage information that will be needed to setup WordPress. If all the information is available click the Lets’ go! button.

Database Name:      wordpress
User Name:          root
Password:           [password]
Database Host:
Table Prefix:       wp_

Click Submit to Proceed and then click Run the install button. The next Screen will ask about Title, username, and password for WordPress. Click the Install WordPress button then the WordPress credentials can be used to login. Open a browser and enter the web address http://localhost/wp-admin
To start customizing the WordPress site the files in the wp-content folder will need to be configured.
To get documentation on setting up and using WordPress go to