fbpx
Toggle navigation

Bedrock - Folder Structure

Bedrocks are a WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure.

Requirements

PHP >= 7.4
Composer (Installation)
Extension required for php :
gd extension
mysql
pdo
pdo_mysql
Simple XML
mbstring
tokenizer
curl

Composer check in comsoser.json and update version: 2
$ sudo composer self-update

Also check this stuffs by using this command:
$ sudo apt install openssl php-common php-json php-xml php-zip

bedrock-folder-structure

How to Setup WordPress via Bedrock ?

Create a new Bedrock Project:

Goto the folder and click right click and open the terminal where you need to install

(like : https://user5@user5/var/www/html$) and run the command.

$ composer create-project roots/bedrock [project_folder_name]

Update environment variables in the .env file : (Before this create database first)

DB_NAME – Database name
DB_USER – Database user
DB_PASSWORD – Database password
DB_HOST – Database host

Change the all parameters + WP_HOME (check below screenshot)

Now generate the salt key by using this url : WordPress Salts and replace with .env salt key.

(Why Salt key is important in wordpress: WordPress salts are long strings of random characters that are used by WordPress to secure the credentials of logged in users.)

  • Add theme(s) in web/app/themes/ as you would for a normal WordPress site. Copy paste the theme here which you want to activate.
  • Set the document root on your webserver to Bedrock’s web folder: /path/to/site/web/ (Need to setup virtual host in localhost first :

Here is the installation guide url:

 

bedrock-1

Configuration for our domain / set document root for our domain:

Check ls (for list ) or ll (list with details)

$ cd /etc/apache2/sites-available
$ ls

Now enter command $ cp 000-default.conf example.live.conf (copy default file with new file with the same name domain name) if permission issue then use sudo

$ sudo nano example.live.conf (for file edit and its content)

or use$ sudo gedit example.live.conf for open file in editor.

# Change with project domain name which is set in /etc/hosts

ServerName example.live

# if use www then use serveralias (optional)

ServerAlias www.example.live

ServerAdmin webmaster@example.live

# change with project path

DocumentRoot /var/www/html/example/web

ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

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

<Directory “/var/www”>

AllowOverride All

</Directory>

If we use folder outside the wamp/xamp

<VirtualHost *:80>

# Change with project domain name which is set in /etc/hosts

ServerName example.live

# if use www then use serveralias (optional)

ServerAlias www.example.live

ServerAdmin webmaster@example.live

# change with project path

DocumentRoot /home/bitcot/Documents/example/web

ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

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

<Directory “/home/bitcot/Documents”>

AllowOverride All

</Directory>

Enable this virtual host or domain configuration:

$ sudo a2ensite wprock.local.conf

Server restart (if needed use sudo) :

$ systemctl reload apache2

Now goto project .env file:

bedrock-3
bedrock-4
bedrock-6
bedrock-5
bedrock-7

How to Access WordPress Admin Panel

bedrock-8

Advantages Pros that we have realized

Plugins

https://wpackagist.org, There’s an awesome website out there called

which is effectively a WordPress plugin repository mirror with all plugins factored as dependencies for composer. It’s WPackagist which brings true version control to your WordPress builds. As they put it, here’s why you should use composer for plugin dependency management:

  • Avoid committing plugins and themes into source control.
  • Avoid having to use git sub-modules.
  • Manage WordPress and non-WordPress project libraries with the same tools.
  • Could eventually be used to manage dependencies between plugins.

What They Have to Say

Contact Us

Have a question? get in touch for a fee & confidential app consultation where here to help!

    owner-bitcot image

    Raj Sanghvi

    CEO BitCot

    Need help? We design, build, and grow digital products across Android, iOS, and web.

    +1 858-683-3692 Support

    Free project quote

    Fill out the enquiry form and we'll get back to you as soon as possible.

    Contact Us: 858-683-3692

      Dave S

      Co-Founder- StompSessions

      Quote

      I have Known BitCot for 4 years and have been impressed with the diversity and quality of BitCot work. With that solid foundation it was really easy to select BitCot as our development partner.

      Quote