# Install wordpress

**URL:** <https://discuss.freedombox.org/t/install-wordpress/519>\
**Category:** Uncategorized\
**Created:** [November 21, 2019, 8:08am UTC](https://discuss.freedombox.org/t/install-wordpress/519 "2019-11-21T08:08:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibibricodeur](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/b/58f4c7/32.png) [@bibibricodeur](https://discuss.freedombox.org/u/bibibricodeur)\
**Post date:** [November 21, 2019, 8:08am UTC](https://discuss.freedombox.org/t/install-wordpress/519/1 "2019-11-21T08:08:23Z")

</div>

Hello I’m french and I installed wordpress on my freedombox this way because I already know a little and there are a lot of tutorials. If there is a problem because dangerous, I delete the post.  
**prepare apache2**  
`sudo apt install php libapache2-mod-php mariadb-server php-mysql`  
restart  
`sudo systemctl restart apache2`  
**prepare mariadb**  
`sudo mysql_secure_installation`

- enter **Enter**
- enter **Yes**
- enter **NEW PASSWORD**
- confirm **NEW PASSWORD**
- enter **Yes**
- enter **Yes**
- enter **Yes**
- enter **Yes**

**create database wordpress**  
`sudo mysql`  
`CREATE DATABASE wordpress;`  
`GRANT ALL PRIVILEGES ON wordpress.* TO 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';`  
adapt USER and PASSWORD  
`FLUSH PRIVILEGES;`  
`QUIT;`  
**prepare wordpress**  
`sudo apt install unzip`  
`wget https://fr.wordpress.org/wordpress-latest.zip`  
`sudo unzip wordpress-latest.zip -d /var/www/html`  
`sudo chown www-data:www-data /var/www/html/wordpress -R`  
`sudo chmod -R -wx,u+rwX,g+rX,o+rX /var/www/html/wordpress`  
**set up apache2**  
`sudo nano /etc/apache2/sites-available/010-wordpress.conf`

```
<VirtualHost *:80>

        ServerName wordpress
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/wordpress
        <Directory /var/www/html/wordpress>
            Options FollowSymLinks
            AllowOverride all
            Require all granted
        </Directory>

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

```

`sudo nano /etc/apache2/apache2.conf`

add at the end

```
<Directory /var/www/html/wordpress>
       AllowOverride All 
</Directory>

```

`sudo a2dissite 000-default.conf`  
`sudo a2ensite 010-wordpress.conf`  
`sudo systemctl reload apache2`

cordially

---

<div class="post-metadata">

**Author:** ![asdfi](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@asdfi](https://discuss.freedombox.org/u/asdfi)\
**Post date:** [July 5, 2020, 12:02pm UTC](https://discuss.freedombox.org/t/install-wordpress/519/2 "2020-07-05T12:02:37Z")

</div>

Hallo, I followed your instructions but I apache2 gives an error message

 ![Screenshot from 2020-07-05 13-57-06](https://discuss.freedombox.org/uploads/default/original/1X/800bd9e47f9f0d0d96164a5036d9fd9dea7845dc.png)

Debian Buster, PHP 7.4.7, MariaDB 10.5, WP 5.4.2

I guess error is related to file permissions but I am not sure.

---

<div class="post-metadata">

**Author:** ![NickA](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@NickA](https://discuss.freedombox.org/u/NickA)\
**Post date:** [July 5, 2020, 6:41pm UTC](https://discuss.freedombox.org/t/install-wordpress/519/3 "2020-07-05T18:41:18Z")

</div>

> [@bibibricodeur](#):
>
> If there is a problem because dangerous

Only exposing the output of a static site generator should be much more secure for a freedombox that contains user data and is located in the local network (e.g. [website: Static website generator (#1323) · Issues · FreedomBox / FreedomBox · GitLab](https://salsa.debian.org/freedombox-team/freedombox/-/issues/1323)). Wasn’t wordpress sending out too much of user data to “spam” checkin services anyway?

---

<div class="post-metadata">

**Author:** ![tonyj](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/tonyj/32/423_2.png) [@tonyj](https://discuss.freedombox.org/u/tonyj)\
**Post date:** [July 23, 2020, 8:03pm UTC](https://discuss.freedombox.org/t/install-wordpress/519/4 "2020-07-23T20:03:02Z")

</div>

I posted this to a thread of my own, but I’m wondering if it would be helpful here. This was my own hacky way of getting WordPress to act as the root website on my FBX install. I know how to make WP work, but I’m not familiar with FBX enough to recommend doing it this way on a production system.

> **From my notes on making WP work as default www page.**
>
> That’s actually something I wanted to bring up with someone more knowledgeable than I am…I _made_ WP work by editing config files without knowing exactly what else that would affect.
> 
> 1. I installed apache-mariadb-php using the instructions here: [https://www.linuxbabe.com/debian/install-lamp-stack-debian-10-buster](https://www.linuxbabe.com/debian/install-lamp-stack-debian-10-buster), including the mysql\_secure\_installation piece.
> 
> - Before you do this, try taking a snapshot of the /etc/apache2/ directory. The install disables some of the configs and vhosts, causing FBX to lose functionality. So make sure you know what’s already configured.
> 
> - After the install, check /etc/apache2/sites-enabled, mods-enabled, and confs-enabled to ensure that everything that was there before is still there. If not, use sudo a2ensite, a2enmod, and a2enconf to make it match.
> 
> - Before restarting Apache, edit the default vhost site config (000-default.conf) and point the document root directive to your wordpress directory. Here is my working VirtualHost \*:80 config:
> 
> 1. Edit the file /etc/apache2/conf-available/freedombox-apache-homepage.conf and comment out the first line, `RedirectMatch "^/$" "/index.html"` with two hashtags like this: `## RedirectMatch "^/$" "/index.html"`. You have to comment it instead of using a2disconf on the whole config or FBX fixes itself and makes /plinth your default site.
> 2. Now restart apache with sudo systemctl apache2 reload.
> 3. It’s super helpful to change the owner/group of the WP html directory and its contents to www-data. WP will help you add and edit files in your installation if it has filesystem access with write permissions.
> 4. You’ll need to install the Apache library for Certbot and get a cert using the command line. I found instructions [on the EFF site](https://certbot.eff.org/lets-encrypt/debianbuster-apache.html), but they only work if you change the python version to 3 like this:  
> `sudo apt-get install certbot python3-certbot-apache`
> 
> - Then run:  
> `sudo certbot --apache`  
> and it will pick up your new domain as a candidate for requesting a certificate. You can’t use the built-in Certbot UI from FBX.
> - This also creates the apache2 site conf file for port 443.
> 
> I’ve pulled these directions from my notes, so I may have left out some minor details. Let me know if you run into any trouble. Configuring WP to run in just about any server setup is my thing, so I’m sure I can help.
