Pixid Web Server

by pixid
2 deployments · 0 still active · last rev. 5 years ago

Compatible with: No distros currently supported
						#!/bin/bash
# <UDF name="hostname" label="Hostname" example="Desired hostname of your Linode" />
# <UDF name="domain" label="Domain Name" example="Domain name which Apache will host" />
# <UDF name="mysqlpassword" label="MySQL Root Password" />
# <UDF name="rvmruby" label="RVM ruby to install" default="1.9.2" />

# Update mirrorlist for pacman
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.old
wget http://www.archlinux.org/mirrorlist/all/ -O /etc/pacman.d/mirrorlist.new
sed -i '/^#\S/ s|#||' /etc/pacman.d/mirrorlist.new
rankmirrors -n 6 /etc/pacman.d/mirrorlist.new > /etc/pacman.d/mirrorlist

# Upgrade software
pacman -Syy --noconfirm
pacman -S --noconfirm pacman
pacman -S --noconfirm reflector curl
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
reflector -l 8 -r -o /etc/pacman.d/mirrorlist
pacman -Syy --noconfirm
pacman -Syu --noconfirm

# Set hostname
sed -i "s/# HOSTNAME=\"myhost\"/HOSTNAME=\"$HOSTNAME\"/" /etc/rc.conf

# Set locales
sed -i 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/#en_US ISO-8859-1/en_US ISO-8859-1/' /etc/locale.gen
locale-gen

# Make some tweaks for bash completion/coloring and handy aliases
pacman -S --noconfirm bash-completion
rm /etc/skel/.bashrc
rm /etc/skel/.bash_profile
wget https://gist.github.com/raw/1dfcf5019b227315c389/61137621e788691de0d89ac8514168ef9b9b5f87/bash_profile.sh -O /etc/skel/.bash_profile
wget https://gist.github.com/raw/1dfcf5019b227315c389/8378bde77a24a68c5e3f3f34badeee27b6078c28/bashrc.sh -O /etc/skel/.bashrc
wget https://gist.github.com/raw/1dfcf5019b227315c389/f9ef7eb4190b790f3e3a213da928e14d6807017f/bash.bashrc.local.sh -O /etc/bash.bashrc.local
cp /etc/skel/.bash_profile /root/.bash_profile
cp /etc/skel/.bashrc /root/.bashrc

# Install sudo
pacman -S --noconfirm sudo
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers

# Install RVM
pacman -Sy --noconfirm gcc patch curl bison zlib readline libxml2 libxslt git autoconf diffutils patch bison make
bash < <( curl -L http://bit.ly/rvm-install-system-wide )
source '/usr/local/lib/rvm'