Setting up new sites fast

Does anyone have scripts that will create the appropriate apache config and restart the proper services? I'm used to my one click setup for domains and not the multi-step process required with my own server. I figured someone probably has a simple shell script that does all of this for you?

7 Replies

Hi there,

This probably isn't a thing, honestly. It would prove difficult to set something like this up – especially where each site would have it's own configuration and someone else's configuration will likely not match what you want.

I guess the idea overall would be easy to do, but configuration-wise it wouldn't be feasible.

Thanks,

Dave.

Yea, I guess most of my sites would have extremely similar configurations. I'm going to use what I found here:

https://coderwall.com/p/cqoplg

That'll probably work for a basic set up :) If you need any help throughout the process, we'll be here :)

you can probably write a shell script to automate it if you want

I do that for Centmin Mod and adding Nginx vhosts http://centminmod.com/nginxdomaindns_setup.html :)

Hey,

I was bored, so wrote a dead basic Debian/Ubuntu based script. Nothing amazing but will get the job done.

Download the file:

wget http://www.paulwoodman.co.uk/linode/vhost.sh

make it executable:

chmod +x vhost.sh

Then run the script:

./vhost.sh

Have fun!

For the record, pumping the results of curl into bash is a terrible plan. In the malicious case, the page could provide something you do not expect (even based on user agent). Even without a malicious actor, an interrupted connection can ruin your day. For instance, if the script says "rm -r /var/lib/coolscript/junk", and the connection dies, you can end up pumping "rm -r /var" into your shell.

  • Les

@akerl:

For the record, pumping the results of curl into bash is a terrible plan. In the malicious case, the page could provide something you do not expect (even based on user agent). Even without a malicious actor, an interrupted connection can ruin your day. For instance, if the script says "rm -r /var/lib/coolscript/junk", and the connection dies, you can end up pumping "rm -r /var" into your shell.

  • Les

Fair point.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct