Tutorial: Local Host

From Lorekeeper Wiki
Revision as of 10:51, 5 November 2020 by Newt (talk | contribs)
Jump to navigation Jump to search

NOTE THAT THIS IS A WINDOWS BASED SETUP

I personally use a windows device, I have very limited knowledge of MacOS or Linux setup, however both should be very similar. I cannot provide help for bugs encountered on these Operating Systems outside of general google search.


Lorekeeper Setup Tutorial: http://lorekeeper-arpg.wikidot.com/wiki:tutorial:setting-up

This guide takes the approach that the reader has no or very little knowledge about xampp before beginning the guide. It may be more beneficial for more advanced users to skip towards the end of the guide, or read Draginraptor’s guide located here


This guide is also made under the assumption the user is already familiar with sourcetree and has a local copy of lorekeeper.


Install / Initial Setup

- - -

To begin our tutorial, you’ll need the following:

  • Xampp


The download link is located here

If you don’t already have PHP installed, Xampp comes with PHP 7.4 bundled in


If you see the following warning, just press ok, it shouldn’t impact anything lorekeeper related

When installing, you may receive multiple options on what to include

The following are required, but you can choose more if you wish

Install.png

After this, complete the install as usual!

One completed, Xampp should look similar to this

Console.png

(OPTIONAL) To make starting your server easier, consider enabling MySQL and Apache to start as soon as xampp is opened. You can do this by going into config

Image5.png

And then selecting the following

Image13.png


Click save and it should be done!

Lorekeeper Setup

Similarly to live servers, lorekeeper local requires a database and composer.

To start, we will install composer. To do this, you will need to install composer to your device

Composer can be downloaded here (Composer-Setup.exe)

Image12.png

I personally recommend installing for all users.

Image19.png
Image7.png


Do not select developer mode, and you can also skip the proxy URL.

Your install should look similar to this

Image6.png

Once installed globally, open your local lorekeeper folder.

518.991x518.991px

Copy the file directory

742.997x742.997px

Open command prompt. You may need to run with administrator privileges.

Type the following

<code>cd <directory></code>

If typed correctly, the next line should read as your directory

585.994x585.994px

Type the following:

composer install

It should start an install process

Image1.png

While composer installs, start up Apache and MySQL on your xampp control panel

Image8.png

Go to http://localhost/phpmyadmin

(note the link may be http://localhost:8080 if you have set your port to 80. If you haven’t or don’t know what port you’re using, localhost will work fine)

Create a new database

Image16.png
401.989x401.989px

Once made, add the name to your .env

An example .env is included at the bottom of this tutorial.

Once done and composer has been install, run the following commands in command prompt, ensuring you are in your lorekeeper directory

Your env MUST be setup

php artisan key:generate

php artisan migrate

php artisan add-site-settings

php artisan add-text-pages

php artisan copy-default-images

php artisan setup-admin-user

You will have to manually authenticate your admin user and all subsequent users. You can do this in your database in the users table by adding a time to the ‘email_verified_at’ table and ‘alias’ table.

Once this process has completed, open xampp and STOP your Apache service

556.989x556.989px

Next, click config on the apache line, and select Apache(httpd.conf) . It will open a text document.

Image15.png

CTRL + F and search for “documentroot”

Image20.png

BY DEFAULT, YOUR DOCUMENT ROOT LINK WILL LEAD TO C:\Xampp OR SIMILAR

Change both links to be your lorekeeper directory in your public folder

E.g, the directory you used for command prompt, but with \public appended to the end.

Once done, save, and start apache again

Go to http://localhost

(note the link may be http://localhost:8080 if you have set your port to 80. If you haven’t or don’t know what port you’re using, localhost will work fine)

If done successfully, you should have a local server!

Image18.png


ENV Example

Copy paste this if you are unsure what should be in your .env

The only variables you will need to change are your database name.

APP_NAME=Lorekeeper APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost

CONTACT_ADDRESS= DEVIANTART_ACCOUNT=

LOG_CHANNEL=stack DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=CHANGE TO YOUR DATABASE NAME, NO SPACES DB_USERNAME=root DB_PASSWORD=

BROADCAST_DRIVER=log CACHE_DRIVER=file QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379

MAIL_DRIVER= MAIL_HOST= MAIL_PORT=587 MAIL_USERNAME= MAIL_PASSWORD= MAIL_FROM_ADDRESS= MAIL_FROM_NAME=

AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION= AWS_BUCKET=

PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

DEVIANTART_CLIENT_ID= DEVIANTART_CLIENT_SECRET= DEVIANTART_CALLBACK_URL=/

Common errors:

Error: Composer has ran out of memory

If this error occurs, you will need to find your php.ini file, and set the memory limit to -1

Error: Apache shutdown unexpectedly

  • This error is usually caused by a mistyped / wrong document root