assetto-corsa-web / acweb

Assetto Corsa Server Management Tool via Web Interface.
MIT License
55 stars 9 forks source link

Setup and usage guide video #26

Closed Kugelschieber closed 5 years ago

Kugelschieber commented 7 years ago

Create a setup and usage guide video.

goatboynz commented 6 years ago

where does one set environment variables on windows?

Kugelschieber commented 6 years ago

Open cmd, cd to your acweb directory and set the environment variables using "set NAME=value". Then start acweb.exe. I recommend to write a batch file to set all environment variables, so you don't need to set them again when you close cmd. Or use docker :)

DECIGrade commented 5 years ago

Hello, I am on Debian Server version 9, MySQL and GOLANG is been installed and working good. But when I run ./run_ dev_server I have this output :

root@xxxx:~/acweb/acweb-master# ./run_dev_server Starting application... runtime /usr/local/go/src/runtime/cgo.go:9:3: //go:cgo_export_static main only allowed in cgo-generated code

it's possible to have step-by-step guide ? Thanks in advance.

Kugelschieber commented 5 years ago

You should not try to run the server using Go. The scripts you've found are for development purposes only. Download the latest version from the release page: https://github.com/assetto-corsa-web/acweb/releases/tag/1.3.0 and follow the steps in the readme to install it: https://github.com/assetto-corsa-web/acweb#manual-installation (download and unzip, setup database using migration scripts, configure using environment variables, run binary).

DECIGrade commented 5 years ago

Thank you, I have been downloaded the good version and unzip it to my server, When I launch ./acweb I have this output : root@xxxx:~/acweb/v1.3.0# ./acweb FATA[0000] Error connecting to database err="Error 1045: Access denied for user ''@'localhost' (using password: NO)"

Normal error because user and password are not in. But I can't open acweb for configuration variables.

Kugelschieber commented 5 years ago

You have to set the environment variables described in the setup instructions. To configure your database for example (Linux, use set FOO=bar on Windows):

export ACWEB_DB_TYPE=mysql
export ACWEB_DB_USER=root
export ACWEB_DB_PASSWORD=root
export ACWEB_DB_HOST=tcp(localhost:3306)
export ACWEB_DB=acweb

You can create a startup script if you like (start_acweb.sh):

#!/bin/bash
export ACWEB_DB_TYPE=mysql
...
./acweb
DECIGrade commented 5 years ago

I have created a startup script :

!/bin/bash

export ACWEB_DB_TYPE=mysql export ACWEB_DB_USER=adminwp export ACWEB_DB_PASSWORD=mypassword export ACWEB_DB_HOST=tcp(localhost:3306) export ACWEB_DB=acweb ./acweb

but I have this output :

root@xxx:~/acweb/v1.3.0# ./start_acweb.sh ./start_acweb.sh: line 5: syntax error near unexpected token (' ./start_acweb.sh: line 5:export ACWEB_DB_HOST=tcp(localhost:3306)'

Kugelschieber commented 5 years ago

Try to add quotes around the parameters.

DECIGrade commented 5 years ago

It's work ! :+1:
I have access to web panel and configuration etc :) Thanks :1st_place_medal:

DECIGrade commented 5 years ago

A little question, it's possible to have access to the web interface like "myhost.com/webacserver" ? :roll_eyes:

Kugelschieber commented 5 years ago

Yes, but you do need to configure that outside of acweb. You should be able to do that by configuring your DNS and add a reverse proxy in front of acweb. It's too much to explain that here, but you'll find resources online on how to do that (look for nginx for example).

DECIGrade commented 5 years ago

And if it's "myipaddress/webacserver" ? It's the same ?

I have apache2 instance running in 80 port, and I don't want access to web manager at 8080 (because not allowed by my hosting).

Kugelschieber commented 5 years ago

You can change the port by setting the ACWEB_HOST variable. Example export ACWEB_HOST=0.0.0.0:9988

DECIGrade commented 5 years ago

Working fine with 9988 port. Many thanks for this project. It's light, simple and nice look 🥇 It's work like a charm now !

!/bin/bash

export ACWEB_HOST=0.0.0.0:9988 export export ACWEB_LOGDIR=/var/log/acweb export ACWEB_LOGLEVEL=info export ACWEB_INSTANCE_LOGDIR=instance_logs export ACWEB_CONFIG_DIR=/root/acweb/v1.3.0/config/ export ACWEB_DB_TYPE=mysql export ACWEB_DB_USER=xxxx export ACWEB_DB_PASSWORD=xxxx export ACWEB_DB_HOST=tcp"(localhost:3306)" export ACWEB_DB=acweb ./acweb

This is my final ./start_acweb.sh script.

AndrewFoley commented 5 years ago

Hello, I have a problem on starting the server with acweb. I've istalled acweb on my dedicated server with windows server 2012. These are the paths c:/acweb c:/acserver c:/acserver/stracker/stratcker.exe

Now, on Server Settings page i have set: AC server folder: c:/acserver Executable: acserver

When I launch the istance it doesn't work...

This is the log output

time="2019-01-24T18:10:34+01:00" level=info msg="Connecting to 'mysql' database 'acweb' at 'tcp(localhost:3306)'" time="2019-01-24T18:10:34+01:00" level=info msg="Starting server on 0.0.0.0:9889" time="2019-01-24T18:10:38+01:00" level=error msg="Session not found on logout" err="Session with token 'ydNXGUr5uZ79ZYpiKw20ftsU19W6pCouofwB_gYPu4o=' not found" time="2019-01-24T18:11:01+01:00" level=error msg="Error when instance stopped" err="exit status 1" process_state="exit status 1" time="2019-01-24T18:11:01+01:00" level=info msg="Instance removed" instance=0 pid=5192

What I wrong?? Thanks so much

Kugelschieber commented 5 years ago

I haven't used it on Windows so far, but the path to the game server meight be wrong. Have you tried starting it without acweb? I guess you have to use an UNC path: https://de.wikipedia.org/wiki/Uniform_Naming_Convention For example: \\?\C:\acserver or\.\C:\Daten` also try using forward slashes.

AndrewFoley commented 5 years ago

I've used the sharing function for generating the network path, i've tried with back and front slash:

\my_ip_host\acserver

I think that now path i right but the instance keeps closing. This is the log report

time="2019-01-25T09:15:02+01:00" level=error msg="Session not found on logout" err="Session with token 'EuPE2V2Ngviu5O8x5qQ-k7CbytphGVhCy-QWFoFARMc=' not found" time="2019-01-25T09:15:10+01:00" level=error msg="Error when instance stopped" err="exit status 1" process_state="exit status 1"

This the instance log

Server CFG Path : config\4\server_cfg.ini Entry List Path : config\4\entry_list.ini Assetto Corsa Dedicated Server v1.15 Protocol version: 202 2019-01-25 09:15:10.6683316 +0100 CET Num CPU: 8 LOCAL IP 0: fe80::a18a:dfbd:d945:244c%Ethernet LOCAL IP 1: 144.76.xx.xxx LOCAL IP 2: 2002:904c:5db7::904c:5db7 Using cfg path: config\4\server_cfg.ini config\4\server_cfg.ini NOT FOUND. EXITING

What do you think?

Kugelschieber commented 5 years ago

Sorry I don't have time to answer all your questions right now. The path looks relative, so that AC cannot find the generated config files. Try to set an absolute path on the configuration page.

Ringleague commented 5 years ago

I have a problem to connect to the DB using the Script.

Unknown database type provided, allowed are: mysql, postgres db_type="mysql\r" i use Maria DB because i need it for a Webpanel but isnt it mysql ? is there a "way around" ?

Kugelschieber commented 5 years ago

Yes MariaDB should by compatible with the MySQL driver. Make sure you don't put whitespace (\r carriage return) characters behind your db type configuration.

Ringleague commented 5 years ago

That's in the script / start.sh

export ACWEB_DB_TYPE=mysql export ACWEB_DB_USER=mydbuser export ACWEB_DB_PASSWORD=mypassword export ACWEB_DB_HOST=tcp(localhost:3306) export ACWEB_DB=acweb ./acweb

Kugelschieber commented 5 years ago

Looks fine, but it seems like there is an invisible character behind the first export line. So acweb can't recognize the database type correctly. You can try to remove the ACWEB_DB_TYPE entirely, MySQL is used be default.

Ringleague commented 5 years ago

Hi, I did that and got an error about the DNS settings. So I tried a start script a user here posted before. When I try to start the script it looks like it might run in the background [1] 24742 but maybe 2 seconds later it stopps. [1]+ Exit 1 ./start.sh

I really dont have an idea what could cause it to stop.

Kugelschieber commented 5 years ago

No log output? Can you connect to your database from that server if you use the same settings as acweb does? It's really hard to help with stuff like that.

Ringleague commented 5 years ago

That's the problem,i try to get a log but it says there is no file available... I am using docker right now to try get it running and it looks like there is no problem with the database any longer.

Now I get a different error

docker: Error response from daemon: driver failed programming external connectivity on endpoint acweb (478558e6f9f95e25cb5c1c46ed1def289135230e15fb6f89ca677b65b476db1e): Error starting userland proxy: listen tcp 0.0.0.0:9600: bind: address already in use. Is it a problem that the AC Server is already running ?

Ringleague commented 5 years ago

So I tried using docker to run the script but it is not possible to connect to the DB! Fortunately I am able to get a log now :)

time="2019-04-20T18:47:22Z" level=info msg="Connecting to 'mysql' database 'acweb' at 'tcp(127.0.0.1:3306)'" time="2019-04-20T18:47:22Z" level=fatal msg="Error connecting to database" err="dial tcp 127.0.0.1:3306: connect: connection refused" There are also websites running and it is no problem to connect to the DB with PHPMyAdmin and everything is running fine.

I started the container with

docker run -d -p 8000:8080 -p 9600:9600/tcp -p 9600:9600/udp -p 8081:8081 --name acweb \ -e ACWEB_DB_USER=myuser \ -e ACWEB_DB_PASSWORD=mypw \ -e ACWEB_DB_HOST="tcp(127.0.0.1:3306)" \ -e ACWEB_DB=acweb \ -v /ac/install/path:/home/steam/assetto \ -v /log/dir/path:/logs \ kugel/acweb

I have no clue why it wont connect... I really hope someone knows how

Ringleague commented 5 years ago

I just want to give a quick update on the situation : After I had such a problem to get a connection by using localhost and local IP I thought I might use the external IP et voila, it works !

I hope I can set up everything now without any further problems.