Jump to content
  • 0

What are the first steps to create my own patch and open to internet connections?


zeusc137

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  42
  • Reputation:   3
  • Joined:  04/11/22
  • Last Seen:  

Hello, thank you very much for considering helping me on this and I hope this can help other people too!

I just successfully installed and enjoyed a great time playing my own RO server locally running on my Docker with this Ubuntu image and sending below...

The thing is... how do I go one step further and expose it to the internet using zerotier/Hamachi/customize my router?

I'm asking this because I got stuck at this point of changing config and running it offline... I really would be glad if I could invite some friends to join my server!

That said, I just want to thank this community for now and see if I can help a bit more in the future too!

(PLEASE IGNORE WHAT COMES NEXT BELOW IF YOU DON'T WANT TO CHECK HOW I'M RUNNING MY APP WITH DOCKER)

Dockerfile:
```

# Use Ubuntu 22.04 as base image
FROM ubuntu:22.04
 
# Update and upgrade packages
RUN apt-get update -y && apt-get upgrade -y
 
# Install necessary packages
RUN apt-get install -y build-essential git libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc
RUN apt-get install -y libpcre3 libpcre3-dev make libmysqlclient-dev zlib1g-dev
RUN apt-get install -y apache2
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server supervisor
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y php
 
# Install the PDO MySQL driver
RUN apt-get install -y php-mysql
 
# Install Neovim just cause I want it:
RUN apt install -y neovim
 
# Install the cURL and XML PHP extensions
RUN apt-get install -y php-curl php-xml
 
# Configure Apache
RUN chown -R www-data:www-data /var/www/html
RUN chmod -R 755 /var/www/html
 
# Start MariaDB and configure users and database
RUN service mariadb start && \
    sleep 3 && \
    mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456');" && \
    mysql -e "DELETE FROM mysql.global_priv WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" && \
    mysql -e "DELETE FROM mysql.global_priv WHERE User='';" && \
    mysql -e "DROP DATABASE IF EXISTS test;" && \
    mysql -e "FLUSH PRIVILEGES;" && \
    mysql -e "CREATE USER 'ragnarok'@'%' IDENTIFIED BY 'ragnarok';" && \
    mysql -e "CREATE DATABASE ragnarok;" && \
    mysql -e "GRANT ALL PRIVILEGES ON ragnarok.* TO 'ragnarok'@'%';" && \
    mysql -e "FLUSH PRIVILEGES;"
 
# Copy configuration files
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY zeus-login.sql /opt/app/zeus-login.sql
 
RUN git clone https://github.com/rathena/rathena.git /opt/app/rathena
RUN git clone https://github.com/projetoeaBrasil/rathena_pt-br /opt/app/rathena_pt-br
 
WORKDIR /opt/app/rathena
 
RUN ./configure --enable-packetver=20190605 && make clean && make server
 
# Expose ports
EXPOSE 80 443 8888 5121 3306 6900
 
# Run supervisor
CMD ["/usr/bin/supervisord"]

```

docker-compose.yml:
```

version: "3.9"
services:
  zeus_server:
    container_name: zeus
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - type: bind
        source: ./ubuntu_root
        target: /root
    ports:
      - "80:80"
      - "443:443"
      - "6900:6900"
      - "6121:6121"
      - "5121:5121"
    networks:
      - zeus_network
 
networks:
  zeus_network:
    driver: bridge

```


supervisord.conf:
```

[supervisord]
nodaemon=true
 
[program:apache2]
command=/usr/sbin/apache2ctl -D FOREGROUND
 
[program:mariadb]
command=/usr/bin/mysqld_safe
 
[program:rathena-fluxcp]
command=bash -c 'git clone https://github.com/rathena/FluxCP.git /root/FluxCP || true'
autostart=true
autorestart=false
startretries=0
 
[program:apache2-cleanup]
command=bash -c 'mv /var/www/html/index.html /var/www/html/index.bkp.html || true'
autostart=true
autorestart=false
startretries=0
priority=2
 
[program:fluxcp-configure]
command=bash -c 'cp -r /root/FluxCP/* /var/www/html || true \
                 && service apache2 restart'
autostart=true
autorestart=false
startretries=0
priority=2
 
[program:import_initial_sql]
command=sh -c 'sleep 6; mysql ragnarok < /opt/app/rathena/sql-files/main.sql \
               && mysql ragnarok < /opt/app/zeus-login.sql'
startsecs = 0
autorestart = false
 
[program:rathena-translate]
command=bash -c 'cp -rf /opt/app/rathena_pt-br/* /opt/app/rathena/ || true'
autostart=true
autorestart=false
startretries=0
priority=2
 
[program:rathena-configure]
command=bash -c 'sleep 3; cd /opt/app/rathena \
                 && ./configure --enable-packetver=20190605 \
                 && make clean && make server \
                 && ./athena-start start || true'
autostart=true
autorestart=false
startretries=0
priority=3

```

And I also created this file `zeus-login.sql` in the same folder to create a new user for me:
```

INSERT INTO `login` (`userid`, `user_pass`, `sex`, `email`, `group_id`) VALUES ('zeus', '256854', 'M', '[email protected]', '99');

```
 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   47
  • Joined:  12/04/13
  • Last Seen:  

I've created a short guide that works for majority of linux servers with minor syntax changes. Give it a try if you're still in need of help. I'll add how to do a patch right now.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...