Sign inSign up

justakazh/wp-research

By justakazh

•Updated over 2 years ago

my wordpress container for research purposes

Image
Security
Web servers
Web analytics
0

185

justakazh/wp-research repository overview

This is a WordPress container for my research needs (not recommended for production). This container uses Apache2, mysql-server, phpmydmin, and the Ubuntu operating system.

By default, the host used is research.local and it has been registered in the WordPress settings inside. This container comes with several features such as:

  • wp-start: to start Apache2 and MariaDB.
  • wp-regen: to automatically reset WordPress. This feature is very helpful if WordPress and the database have undergone many changes or have too much data, allowing us to return to a clean state without having to reinstall. This can be used via /reset.php.
  • Debugging for PHP and SQL is available in the /wp-content folder. In the wp-config.php file, the setting define('DISALLOW_UNFILTERED_HTML', true); has been applied to enhance security.
  • Default credentials for all user roles:
Administrator -> admin:1
Author -> user_author:1
Editor -> user_editor:1
Contributor -> user_contributor:1
Subscriber -> user_subscriber:1

For those who want to try, you can follow these instructions:

  1. Nginx Install First, please install Nginx with the following command:
sudo apt install nginx
  1. Creating the Container
docker pull justakazh/wp-research
docker run -td --name wordpress -p <local_port>:80 justakazh/wp-research
docker run -td --name wordpress -p <local_port>:80 -v yourvolume:/var/www/html justakazh/wp-research

Please adjust the command as needed.

  1. Configuring Nginx Copy the code below to /etc/nginx/sites-available/wordpress.conf as a virtual host / reverse proxy to the container.
server {
    listen 80;
    listen [::]:80;

    server_name research.local;

    location / {
        proxy_pass http://CHANGE_THIS_TO_CONTAINER_IP; 
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

To get the container IP, run the following command:

docker inspect --format='{{.NetworkSettings.IPAddress}}' wordpress

Next, create a symbolic link:

ln -s /etc/nginx/sites-available/wordpress.conf /etc/nginx/sites-enabled/wordpress.conf
nginx -t 
service nginx restart
  1. Add research.local to /etc/hosts
nano /etc/hosts
127.0.0.1       research.local

If using WSL and you want to access it through Windows, you can change your hosts file in C:\Windows\System32\drivers\etc\hosts and point it to the WSL IP.

Tag summary

Content type

Image

Digest

sha256:0e12cce4f…

Size

266.1 MB

Last updated

over 2 years ago

docker pull justakazh/wp-research