Difference between revisions of "Tutorial: Local Host"
Line 53: | Line 53: | ||
I personally recommend installing for all users. | I personally recommend installing for all users. | ||
[[File:Image19.png|left|thumb|456x456px]] | [[File:Image19.png|left|thumb|456x456px]] | ||
− | [[File:Image7.png|none|thumb| | + | [[File:Image7.png|none|thumb|418x418px]] |
Line 60: | Line 60: | ||
Your install should look similar to this | Your install should look similar to this | ||
[[File:Image6.png|none|thumb|437x437px]] | [[File:Image6.png|none|thumb|437x437px]] | ||
+ | Once installed globally, open your local lorekeeper folder. | ||
+ | [[File:Image14.png|none|thumb|518.991x518.991px]] | ||
+ | Copy the file directory | ||
+ | [[File:Image17.png|none|thumb|742.997x742.997px]] | ||
+ | Open command prompt. You may need to run with administrator privileges. | ||
+ | |||
+ | Type the following | ||
+ | |||
+ | <nowiki><code>cd <directory></code></nowiki> | ||
+ | |||
+ | If typed correctly, the next line should read as your directory | ||
+ | [[File:Image11.png|none|thumb|585.994x585.994px]] | ||
+ | Type the following: | ||
+ | |||
+ | composer install | ||
+ | |||
+ | It should start an install process | ||
+ | [[File:Image1.png|none|thumb|465x465px]] | ||
+ | While composer installs, start up Apache and MySQL on your xampp control panel | ||
+ | [[File:Image8.png|none|thumb]] | ||
+ | Go to <nowiki>http://localhost/phpmyadmin</nowiki> | ||
+ | |||
+ | (note the link may be <nowiki>http://localhost:8080</nowiki> 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 | ||
+ | [[File:Image16.png|none|thumb]] | ||
+ | [[File:Image4.png|none|thumb|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 | ||
+ | [[File:Image21.png|none|thumb|556.989x556.989px]] | ||
+ | Next, click config on the apache line, and '''select Apache(httpd.conf)''' . It will open a text document. | ||
+ | [[File:Image15.png|none|thumb]] | ||
+ | CTRL + F and search for “documentroot” | ||
+ | [[File:Image20.png|none|thumb|510x510px]] | ||
+ | '''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 <nowiki>http://localhost</nowiki> | ||
+ | |||
+ | (note the link may be <nowiki>http://localhost:8080</nowiki> 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! | ||
+ | [[File:Image18.png|none|thumb|530x530px]] | ||
<br /> | <br /> | ||
+ | |||
+ | === '''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=<nowiki>http://localhost</nowiki> | ||
+ | |||
+ | 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=/ | ||
+ | <br /> | ||
+ | |||
+ | === '''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 |
Revision as of 10:50, 5 November 2020
Contents
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
After this, complete the install as usual!
One completed, Xampp should look similar to this
(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
And then selecting the following
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)
I personally recommend installing for all users.
Do not select developer mode, and you can also skip the proxy URL.
Your install should look similar to this
Once installed globally, open your local lorekeeper folder.
Copy the file directory
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
Type the following:
composer install
It should start an install process
While composer installs, start up Apache and MySQL on your xampp control panel
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
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
Next, click config on the apache line, and select Apache(httpd.conf) . It will open a text document.
CTRL + F and search for “documentroot”
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!
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