Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


[Script] 1 Click Caddy Installer/Manager
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

[Script] 1 Click Caddy Installer/Manager

sayem314sayem314 Member
edited August 2016 in Tutorials

Hello there,

I created a bash script that manage (start|stop|install|update|uninstall) Caddy Web Server.

This script got 24 updates till now. Still in beta. I want to make it more robust and I look forward to hear your feedback/suggestion.

To install this on your vps, run below command. Fresh OS is recommended

wget https://git.io/vra5C -O - -o /dev/null|bash

Installing 'Caddy Web Server Installer'

You have installed 'Caddy Web Server Installer'. Now It's time to run below command to install Caddy Web Server :)

caddy install

Once installed run below command to start it. Make sure your domain is pointed to your ip else you might get some error.

caddy start

I have already installed and running. I'm running reload/restart command.

Restarting Caddy

To check your 'Caddy Web Server' status run below command.

caddy

Checking Caddy status

If you want to see your current version of Caddy/Script/PHP then run below command.

caddy -v

Checking Caddy version

When 'Caddy Web Server' release an update you can update Caddy within few seconds.

caddy update

updating caddy server

After successful update. Run below command.

caddy start

If you have any question about this script ask me here :)

https://github.com/sayem314/Caddy-Web-Server-Installer

«1

Comments

  • Good stuff, bookmarked.

    Caddy auto starts on system boot right?

  • dailydaily Member

    The idea of making Caddy any easier blows my mind.

  • BochiBochi Member

    @TheOnlyDK said:
    Caddy auto starts on system boot right?

    Don't see anything in the script right now that would create an init script or such.

  • Nice. Thanks for the effort!

    Thanked by 1sayem314
  • @Bochi said:
    Don't see anything in the script right now that would create an init script or such.

    I mean the caddy software itself creates the auto start scripts, doesn't it? Like nginx, apache, etc all have their own built in init scripts or systemd start target (or whatever they call it..), I'm assuming the same? Maybe I will try this someday and answer my own question.

  • BochiBochi Member

    @TheOnlyDK said:
    I mean the caddy software itself creates the auto start scripts, doesn't it?

    Not to my knowledge, caddyserver is just a single executable - which is one of its main features I'd say.

    Thanked by 1sayem314
  • Most of you will know how to do this but I thought I'd share this anyway: https://denbeke.be/blog/servers/running-caddy-server-as-a-service-with-systemd/

    Should be pretty simple to create a bash to create some sort of installer.

    Thanked by 2TheOnlyDK sayem314
  • sayem314sayem314 Member
    edited March 2016

    @TheOnlyDK said:
    Good stuff, bookmarked.

    Thanks.

    Caddy auto starts on system boot right?

    Unfortunately no! Caddy is portable server. But noted, will work on that. This script still in beta, more to come :)

    I got so sick after posted this, will work on this script after I get well.

  • Have any of you been able to run Caddy on Windows10? I can't get it to work:(

  • BochiBochi Member

    @Straykat said:
    Have any of you been able to run Caddy on Windows10? I can't get it to work:(

    So, which error (message) do you get? Just tried it on a Windows 10 Pro (64bit) without any problems.

  • sayem314sayem314 Member
    edited March 2016

    @Straykat said:
    Have any of you been able to run Caddy on Windows10?

    Should work fine. Just tried on Windows 7, should work fine on Windows 10

    I can't get it to work:(

    Can you explain more? Any error?

    Thanked by 1Straykat
  • mholtmholt Member
    edited March 2016

    This is really cool - thanks for making and sharing it!

    There's also the semi-official installer script here: https://getcaddy.com/ -- should work on every platform, including Windows+cygwin (I've heard it works although I haven't tested that myself).

    We also have a few init scripts that you can use in the https://github.com/mholt/caddy/tree/master/dist/init folder.

    Thanked by 1sayem314
  • @mholt said:
    This is really cool - thanks for making and sharing it!

    Thank you more for creating such an amazing web server.

    There's also the semi-official installer script here: https://getcaddy.com/ -- should work on every platform, including Windows+cygwin (I've heard it works although I haven't tested that myself).

    I just heard about it now. Will check that.

    We also have a few init scripts that you can use in the https://github.com/mholt/caddy/tree/master/dist/init folder.

    I'm traveling now, I'll work on this script when I come back home.

    Thanked by 1mholt
  • Added support for ARM on v2.3 (beta)

    Thanked by 1mholt
  • @sayem314, I just deleted the dir and extracted it again and it worked fine.

    Thanked by 1sayem314
  • @sayem314 i tested on 3 vps and find php is not working, just print 502 bad gateway

  • @singhigh said:
    i tested on 3 vps and find php is not working, just print 502 bad gateway

    Should work fine. PHP is working fine on my test. What OS and virt are you using to test?

  • running on debian / ubuntu...

  • @singhigh said:
    running on debian / ubuntu...

    Is the domain you typed during installation pointed to your VPS IP? Was PHP installation successful? Did you tried on fresh OS? Are you using latest version (2.3 beta) of this script?

  • of course, but how can I check if PHP installation successful?

  • sayem314sayem314 Member
    edited April 2016

    @singhigh said:
    how can I check if PHP installation successful?

    ubuntu/debian > php5-fpm -v

    redhat/centos > php-fpm -v

  • i checked it is installed well

  • sayem314sayem314 Member
    edited April 2016

    Edit line 212 on '/etc/php5/fpm/php.ini' and change Etag off to on

    then restart php fpm

    Thanked by 1singhigh
  • singhighsinghigh Member
    edited April 2016

    hey, still not working, 502 Bad Gateway
    and my line 212 is a line with ";", not for settings.

  • @singhigh said:
    hey, still not working, 502 Bad Gateway
    and my line 212 is a line with ";", not for settings.

    Share me your Caddyfile and php5-fpm.ini on PM. Upload to pastebin plz

  • sayem314sayem314 Member
    edited August 2016

    version 3.4 released. not very far to stable version :)

    -Added process uptime feature

    -Fixed mixed output of fixphp

    -Fixed minor update issue

    -Fixed restart issue

    -Fixed pidfile issue for init

    N.B: Post has been updated.

  • doughnetdoughnet Member
    edited August 2016

    I installed using the script then did the nice and simple:
    caddy service command but it unfortunately is not adding the startup script. Ideas?

    Debian 8 64bit

    It starts fine with caddy restart or start though.

    EDIT
    Seems that when I do the command: caddy service it will completely stop working and won't even start back up again. Any ideas?

  • @doughnet said:
    I installed using the script then did the nice and simple:
    caddy service command but it unfortunately is not adding the startup script. Ideas?

    Debian 8 64bit

    It starts fine with caddy restart or start though.

    EDIT
    Seems that when I do the command: caddy service it will completely stop working and won't even start back up again. Any ideas?

    For the moment service is not working as expected. That's why I haven't done it by default. I'd release improved service. For now, disable service. Start manually.

    rm /etc/init/caddy.conf
    systemctl disable caddy
    rm /etc/systemd/system/caddy.service

    Then reboot or restart caddy :)

  • Okay thanks.

    Is it possible to setup my own script then or will it break the caddy web server still?

  • sayem314sayem314 Member
    edited August 2016

    @doughnet said:
    Okay thanks.

    Is it possible to setup my own script then or will it break the caddy web server still?

    No. It's possible :)

    BTW, v3.5 released :)

    Added support for Ubuntu 16.04 and 16.10

    Changed service type

    Fixed php7.0 issue

    Added support to restart php along with caddy

    Fixed some error output when installing on CentOS

    @doughnet new service type added to /etc/init.d
    delete previous service and run 'caddy service' now. reboot and see if it works :)

Sign In or Register to comment.