Installing wordpress on Debian 8

Installation guide

Start by see if there is a connection to your server by ping it from your machine by its hostname. In this case this server has the hostname ‘wordpress’. And it is just a name to define its purpose.

ping wordpress.kirk.local

<< need a picture here >>

if is a succeeds it tells you that you now a able to access your server with your hostname and use it with accessing it though a browser. In my case it would be something like http://wordpress/index.php

If you do not have a working dns on your network you might have to edit the hosts file.

echo “127.0.0.1    <hostname>.<domain> >> /etc/hosts”

This will append a line to the file a it will reponse to the hostname locally.

e.g echo “127.0.0.1     wordpress.kirk.local”

now we will install all the packages need for our wordpress installation.

apt-get install apache2 apache2-utils php5 php5-mysql mysql-client mysql-server

Mysql prompts for a password under the installation.

This is install with root and all commands from now on will.

WordPress needs a local database backend to run on.

Creating the database

mysql -u root -p

CREATE DATABASE wordpress;

Creating a user with password. This is the user you will use together with wordpress.

CREATE USER ‘wpadmin’@’localhost’ IDENTIFIED BY “<your-password “;

User privileges

GRANT ALL PRIVILEGES ON wordpress.* TO ‘wpadmin’@’localhost’

FLUSH PRIVILEGES;

exit

Now that the database backend is configured we can run a script that will help us  secure our database.

mysql_secure_installation

For root pass change – no
Remove anonymous users – yes
Disallow root remotely login – yes
remove test database and access to it – yes

This is my answers

We need to create a Vhost for our wordpress site. Edit following file or create it and add the config
nano /etc/apache2/sites-available/wordpress.conf

<VirtualHost *:80>
    ServerName <your_server_name>
    ServerAdmin webmaster@<your_domain>
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combind
</VirtualHost>

enable the site
a2ensite wordpress.conf

Reload the conf
/etc/init.d/apache2 restart

Download the latest wordpress installation

wget http://wordpress.org/latest.tar.gz

Unzip it
tar xzvf latest.tar.gz

Copy the wordpress folder to the documentRoot we set before

cp -r wordpress/* /var/www/html

Grant ownship to the files to the systemuser running the webserver

chown -R www-data /var/www/html

Restart apache2 and mysql

/etc/init.d/apache restart
/etc/init.d/mysql restart

You should now be able to continue configuring your new site though the browser.

So use your IP or hostname and access the configuration page in wordpress.

<IP>/index.php or <hostname>/index.php

Leave a Reply

Your email address will not be published.

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