Install WordPress on Apache (Debian)

So, the following we run the commands to set up apache for wordpress.

Download and unzip the WordPress package from:

# wget https://wordpress.org/latest.tar.gz


Then extract the package to the apache root directory:

# tar -xzvf latest.tar.gz --directory /var/www/kdoozle

Activate Mod Rewrite.

# sudo a2enmod rewrite

Create vhosts.

<VirtualHost *:80>
    ServerName ipgw.io
    ServerAlias www.ipgw.io
    ServerAdmin webmaster@ipgw.io
    DocumentRoot /var/www/ipgw
 
    <Directory /var/www/ipgw>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>
 
    ErrorLog ${APACHE_LOG_DIR}/ipgw.io-error.log
    CustomLog ${APACHE_LOG_DIR}/ipgw.io-access.log combined
</VirtualHost>
 
<VirtualHost *:443>
    ServerAdmin rogerp@local
    ServerName www.ipgw.io
    ServerAlias ipgw.io
    DocumentRoot /var/www/ipgw
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ipgw.io.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/ipgw.io.key
</VirtualHost>
 
<VirtualHost *:443>
    ServerAdmin rogerp@local
    ServerName www.ipgw,io
    ServerAlias ipgw.io
 
    DocumentRoot /var/www/ipgw
 
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ipgw.io.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/ipgw.io.key
</VirtualHost>


After installing it, you will need to restart Apache services with the command:

service apache2 restart

If needed, you will need to edit the config file and find the directive:

AllowOverride None


Change it to:

AllowOverride All
Order allow,deny
Allow from all

Create the Database

MariaDB [(none)]> CREATE database kdoozle;
Query OK, 1 row affected (0.001 sec)

Add user and set up permissions.

MariaDB [(none)]> CREATE USER 'kdoozle'@'localhost' IDENTIFIED BY 'sdsrg54yhs';
Query OK, 0 rows affected (0.032 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON kdoozle.* to 'kdoozle'@'localhost' IDENTIFIED BY 'sdsrg54yhs';
Query OK, 0 rows affected (0.017 sec)

Next, run the installer by loading the website in the browser.

Leave a Comment