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/ipgw

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

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.