Create A Local Network Development Website using Parallels and Ubuntu 21.10
doc id: 8fc2a97b4c7b74a536b1be6c558095fc9e0a8877
Complete Website Domain Tasks
Create A Colby Website Project On Your Development Workstation
-
Start the Terminal app on your workstation.
-
workstation$ cd <colby_projects_directory>
-
workstation$ mkdir <reverse_server_specific_domain>
-
workstation$ cd <reverse_server_specific_domain>
-
workstation$ curl -s https://mattifesto.com/install/ > install.php && php install.php
Scenario 0: Create A New Colby Website Git Repository
In this scenario you have chosen to create a whole new website that is being born in this moment. This only happens when you are creating a website that has never existed before, at least not as a Colby website.
-
choose option 0) create a brand new website
Scenario 1: Create A New Website Instance Using An Existing Git Repository
-
choose option 1) create a website using an existing Git repository
Scenario 2a: Copy/Move Another Website Instance On This Workstation
-
choose option 2) create directories for a website
-
Go to the update admin page for the website you are copying and click on the "Backup Database" button. We will import this backup into the database for this site later.
-
workstation$ rm -rf document_root
-
workstation$ cp -r <source_website_project_directory>/document_root document_root
NOTE: No ending slash on either document_root directory.
Scenario 2b: Copy/Move Another Website Instance On Another Workstation or Web Server
At the heart of this scenario we are just copying the document_root directory from one computer to another. You can accomplish this task using any method you like. This is the method that we most often use.
-
choose option 2) create directories for a website
-
Go to the update admin page for the website you are copying and click on the "Backup Database" button. We will import this backup into the database for this site later.
-
workstation$ rm -rf document_root
-
Determine the source host name or IP address.
If you are copying from another local server you can use its hostname.
If you are copying between two DigitalOcean droplets you will want to use the source droplet's PRIVATE IP address which is available on the DigitalOcean admin page.
-
You may need to set up SSH keys to access the previous server from the new server.
-
workstation$ rsync -a --info=progress2 <username>@<source_hostname_or_ipaddress>:~/<document_root_path>/ document_root
IMPORTANT: A slash is placed after the source document root path, but no slash is placed after the destination path.
Share The Website Project Folder With The Development Web Server
-
$ ssh <development_web_server>
-
I am currently just using the /media/psf/<project_directory> as the website location.
Share Directory
-
To share a directory using Parallels follow the instructions on this page: http://download.parallels.com/stm/docs/en/Parallels_Desktop_Users_Guide/22907.htm
Configure The Project
webserver$ php document_root/colby/bin/cbt update-configuration
Create Database On The Web Server
webserver$ php document_root/colby/bin/cbt create-database
webserver$ sudo mysql < create_database.sql
Scenario 2: Import The Database From The Copied Website Instance
This step is only necessary if you are copying/moving another website instance.
-
webserver$ cp document_root/tmp/database-backups/<most_recent_backup_file> import.sql
-
webserver$ vi import.sql
-
:%s/<old_database_name>/<new_database_name>/gc
The new database name is in the cb_configuration.json file.
This moment is where it really helps if the database names are globally unique.
-
webserver$ mysql -u <username> -p < import.sql
The username and password are in the cb_configuration.json file.
-
If
document_root/colby-configuration.php
exists delete it.
Create And Enable Virtual Hosts On The Web Server
webserver$ php document_root/colby/bin/cbt create-apache-conf
webserver$ sudo cp *.conf /etc/apache2/sites-available/
webserver$ sudo a2ensite *.conf
webserver$ sudo apache2ctl configtest
webserver$ sudo systemctl reload apache2
Set Up The Website
$ php document_root/colby/bin/cbt setup
If a user doesn't exist for the email address you entered when you configured the site, one will be created and you will be asked for that user's password.
After this step is complete you can navigate to the home page or the /admin/ page to log in.