This document provides instructions for installing and configuring SEOnaut. Follow the steps below to set up the application using Docker or by compiling it from source. Instructions for configuring a reverse proxy with HTTPS and WebSocket support are also included.
Before installing SEOnaut, ensure the following are installed on your system:
- Docker: Install Docker from docker.com.
- Git: Required to clone the repository.
- Go Programming Language (optional, if not using Docker): Install Go from golang.org.
- Make (optional): To use the Makefile commands provided in the project.
- MySQL Database: Install and configure a MySQL server (if not using Docker).
- Nginx or Apache: Required to set up a reverse proxy.
-
Clone the Repository
Clone the SEOnaut repository from GitHub:git clone https://github.com/stjudewashere/seonaut.git
-
Navigate to the Project Directory
Move to the project folder:cd seonaut
-
Build and Run Docker Containers
Run docker-compose to build and start the containers:docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
Or use the provided Makefile to build and start the Docker containers:
make docker
-
Access the Application
Open your browser and navigate to:http://localhost:9000
To secure SEOnaut with HTTPS, set up a reverse proxy as explained below.
-
Clone the Repository
Clone the SEOnaut repository:git clone https://github.com/stjudewashere/seonaut.git
-
Navigate to the Project Directory
Change into the project directory:cd seonaut
-
Run the Application
Use the Makefile to run the application with the default configuration:make run
To use a custom configuration file, specify it with the
-c
option:go run -race cmd/server/main.go -c path/to/your/config
-
Compile the CSS
To compile the CSS you'll need to install esbuild. Then you can compile the CSS:
esbuild ./web/css/style.css \
--bundle \
--minify \
--outdir=./web/static \
--public-path=/resources \
--loader:.woff=file \
--loader:.woff2=file \
--loader:.png=file
Alternatively you can use make front
to compile the CSS or make watch
to compile and monitor CSS file changes while developing.
-
Access the Application
Navigate to:http://localhost:9000
The application uses a configuration file named config
, located in the root directory. Customize this file to match your environment or specify a custom file using the -c
option.
[server]
host = "0.0.0.0"
port = 9000
url = "http://localhost:9000"
[database]
server = "db"
port = 3306
user = "seonaut"
password = "seonaut"
database = "seonaut"
[crawler]
agent = "Mozilla/5.0 (compatible; SEOnautBot/1.0; +https://seonaut.org/bot)"
-
[server]
host
: IP address to bind the server (default:0.0.0.0
).port
: Port for the server (default:9000
).url
: Base URL of the application, e.g.,https://example.com
.
-
[database]
server
: Hostname or IP of the database server.port
: Port of the database (default:3306
).user
: Database username.password
: Database password.database
: Name of the database.
-
[crawler]
agent
: User agent string for the crawler.
-
Install Nginx
Install Nginx using your package manager:sudo apt update && sudo apt install nginx
-
Create a Configuration File
Create/etc/nginx/sites-available/seonaut
with the following content:server { listen 80; server_name example.com;
location / { proxy_pass http://localhost:9000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } location /crawl/ws { proxy_pass http://localhost:9000/crawl/ws; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }
}
-
Enable HTTPS with Certbot
Install Certbot and configure HTTPS:sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com
-
Restart Nginx
Reload the configuration:sudo systemctl reload nginx
-
Install Apache
Install Apache using your package manager:sudo apt update && sudo apt install apache2
-
Enable Required Modules
Enable the necessary Apache modules:sudo a2enmod proxy proxy_http proxy_wstunnel ssl
-
Create a Virtual Host File
Add/etc/apache2/sites-available/seonaut.conf
with the following content:<VirtualHost *:80> ServerName example.com
ProxyPreserveHost On ProxyRequests Off <Location /> ProxyPass http://localhost:9000/ ProxyPassReverse http://localhost:9000/ </Location> <Location /crawl/ws> ProxyPass ws://localhost:9000/crawl/ws ProxyPassReverse ws://localhost:9000/crawl/ws </Location>
-
Enable HTTPS with Certbot
Configure HTTPS:sudo apt install certbot python3-certbot-apache
sudo certbot --apache -d example.com
-
Restart Apache
Reload the configuration:sudo systemctl reload apache2