Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Explain how multiple domains can be used/added #252

Closed
enoversum opened this issue Nov 27, 2021 · 10 comments · Fixed by #263
Closed

Documentation: Explain how multiple domains can be used/added #252

enoversum opened this issue Nov 27, 2021 · 10 comments · Fixed by #263

Comments

@enoversum
Copy link

I have to confess, I’m not an in-depth server managing Linux pro that spends his days in the console. It took me quite some time to understand how I could actually add further domains to my main domain as shortlink domains, as the documentation only explains in detail how shortlink resolving works with multiple domains, but not how to actually add further domains.

The documentation could briefly mention that you'd have to set up your additional domain(s) to point to your Shlink installation, and then could use/add the domain for a specific link through either the CLI or web interface (while the latter is also a bit complicated to find, but you probably won't add new domains every day).

@acelaya acelaya transferred this issue from shlinkio/shlink Nov 27, 2021
@acelaya
Copy link
Member

acelaya commented Nov 27, 2021

Fair point

@enoversum
Copy link
Author

@acelaya Thanks again here!

@acelaya acelaya added this to the 6.25.0 milestone Dec 6, 2021
@acelaya
Copy link
Member

acelaya commented Dec 12, 2021

Hey @enoversum. Would something like this be helpful?

image

@enoversum
Copy link
Author

enoversum commented Dec 12, 2021

Hey @acelaya, I think that's already helpful!
I would just write an own paragraph with a heading (maybe 'Adding a domain') for it, explain that you have to point all additional domains to the shlink installation from your server (not done inside Shlink), and that you can add them to the Shlink database for domain selection (i.e. web interface, list of available domains via CLI) by just adding a link with the new short domain (CLI) or adding a new domain manually on the web interface. And then add the notice in the yellow box that configuring domains, DNS etc. is something outside of Shlink and should be done server-side (nginx, Apache etc.)

@Jai-JAP
Copy link

Jai-JAP commented Oct 8, 2022

Instructions to add a new domain to shlink database (when the server is configured) aren't still documented, where can i get instructions to do that on the server cli or via rest api.
Also is it currently possible to register new domain in shlink db without using web ui to create new short url on new domain option to name the new domain?

@jeremiah-k
Copy link

Instructions to add a new domain to shlink database (when the server is configured) aren't still documented, where can i get instructions to do that on the server cli or via rest api. Also is it currently possible to register new domain in shlink db without using web ui to create new short url on new domain option to name the new domain?

Were you able to find a command for adding a new domain to the database?

@Jai-JAP
Copy link

Jai-JAP commented Jan 8, 2023

Instructions to add a new domain to shlink database (when the server is configured) aren't still documented, where can i get instructions to do that on the server cli or via rest api. Also is it currently possible to register new domain in shlink db without using web ui to create new short url on new domain option to name the new domain?

Were you able to find a command for adding a new domain to the database?

Now but it's possible by using the partial steps for web server configuration for multiple domains and then using the web ui to create a link and select a new server. But I am not able to find the rest api endpoint for it.

@acelaya
Copy link
Member

acelaya commented Jan 8, 2023

There's no endpoint to create new domains explicitly.

Domains are created as a side effect of creating a short URL with a domain which not yet exists, or configuring special redirects for a domain which not yet exists.

The second one is not yet supported by shlink-web-client.

However, these two are only used to make Shlink aware of the existence of new domains internally. You still need to take care of all the infrastructure stuff (make sure those domains properly resolve at DNS level, make sure your web server will respond to requests to those domains, etc)

@crxssrazr93
Copy link

How do I go configuring a DNS record to connect another domain on my shlink instance?

I am using link.site.com to host and manage my shlink instance.

But I want to add domains like domain1.com, domain2.com.

domain1.com, domain2.com are running wordpress.

On domain1.com NS, do I have to add a record like this?

RECORD TYPE: A
HOSTNAME: @
POINTS TO: link.site.com

Or?

@enoversum
Copy link
Author

How do I go configuring a DNS record to connect another domain on my shlink instance?

I am using link.site.com to host and manage my shlink instance.

But I want to add domains like domain1.com, domain2.com.

domain1.com, domain2.com are running wordpress.

On domain1.com NS, do I have to add a record like this?

RECORD TYPE: A HOSTNAME: @ POINTS TO: link.site.com

Or?

The DNS record for this domain should point to the same server as the main domain you are using for Shlink. Then you need to point this domain to the Shlink path just as you did with your main domain.
On NGINX, a server block for your second domain would look basically the same as the one for the first domain, with the 'root' pointing to your shlink installation, e.g.:

server {

    server_name myseconddomain.com;

    root /var/www/shlink/public;
    error_log /var/log/nginx/shlink.error;
    access_log /var/log/nginx/shlink.access;
    index index.php;
    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

}

Note that this is just my personal server with its settings, take care for that you use the right settings for your environment (PHP version, proxy etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants