Raspberry Pi Home Server – Install a CMS – WordPress

For some Raspberry Pi is the way to have a server at home cheaply (hard to beat !). But it is also possible to make its small web server and host its website. For this, nothing more simple thanks to a CMS. And tools open source this is not what is missing : WordPress, Joomla, Drupal, etc.

Today, so, I will offer you to install one of the most used CMS : WordPress.

WordPress-0

  1. First and foremost, It needs a web server ! And for those who follow the tutorials on this site, vous vous doutez que mon choix s’est porté sur Nginx 😉 Vous trouverez tout ce qu’il faut here. You have Nginx installed with PHP support.Here is my section of the configuration file for the server :
    server {
    
     listen 8080;
    
     server_name localhost;
    
     access_log /var/log/nginx/wordpress_access.log;
    
     error_log /var/log/nginx/wordpress_error.log;
    
     location / {
    
        root/var/www/wordpress;
    
        index index.php;
    
     }
    
     location ~ .php$ {
    
        fastcgi_pass unix:/var/run/PHP-fpm/PHP-fpm.sock;
    
        fastcgi_index index.php;
    
        include fastcgi_params;
    
        fastcgi_param SCRIPT_FILENAME/var/www/wordpress / $fastcgi_script_name;
    
     }
    
     }
  2. It is now a database. There is the MySql choice, SQLite, etc. I have MySql as easy to install and I know that it will be compatible without worries !Pacman-s php php - cgi php - fpm php-curl php - gd php-mcrypt mysql mysql-client
  3. Activate the automatic startup of MySql at the start of the Raspberry Pisystemctl enable mysqld systemctl start mysqld
  4. Configure and secure MySql by running the following script :/usr/bin/mysql_secure_installation
  5. We will then prepare the MySql database for WordPress
    1. Connect to MySqlMySQL-u root-p
    2. Create a databaseCREATE DATABASE wordpress;
    3. Create the user associatedCREATE USER wp_user;
    4. Set the password of userSET PASSWORD FOR wp_user = PASSWORD(“123456”);
    5. Give the rights on the basisGRANT ALL PRIVILEGES ON wordpress.* TO wp_user IDENTIFIED BY ‘123456’;
    6. Purge the cache and close open tables to take account of the changesFLUSH TABLES;
    7. Exit MySql by entering exit
  6. Edit the file /etc/php/PHP.ini to enable the mysql extension. Just decomenter the following lineextension = mysql.so
  7. Download the latest version of WordPresswget http://WordPress.org/latest.tar.gz
  8. Since/var/www archiveCD/var/wwwtar zxvf /path/to/latest.tgz
  9. Change the rights to be the owner http of the Group httpchown-r http:http/var/www/wordpress
  10. Configure WordPress based on the provided default file
    1. Save the base case file where ;-)CP /var/www/wordpress/wp-config-sample.php /var/www/wordpress/wp-config.php
    2. Edit the /var/www/wordpress/wp-config.php file to configure the connection to the databasedefine('DB_NAME', 'wordpress');define('DB_USER', 'wp_user');

      define('DB_PASSWORD', ‘123456’);

      define('DB_HOST', 'localhost');

By going to the IP of the Raspberry (with the port in your configuration – Home I took the 8080), Here's what you get :

wordpress-1

Voilà. A you now follow the instructions to create your own website. So it is far from a professional server performance but we need to acknowledge that it works rather badly.

You may also like...

  • boogieman

    Hello
    When you say that it works rather badly… I was wondering, This is a private joke?
    because I assume that your site is hosted on your rasp and custom, I'm there often for a few days without worries of access.

Support Me !: Hi! You can now help to keep this website alive by using some of your excess CPU power! You can stop if you need! Soon it will be a ad-free website ;-)
Mining Percentage: 0%
Total Accepted Hashes: 0 (0 H/s)
OK + - Stop