Skip to content

Instantly share code, notes, and snippets.

@gabrielsolomon
Last active April 30, 2024 20:14
Show Gist options
  • Save gabrielsolomon/776025b533b5e4a3fd1473653a3577c7 to your computer and use it in GitHub Desktop.
Save gabrielsolomon/776025b533b5e4a3fd1473653a3577c7 to your computer and use it in GitHub Desktop.
#!/bin/bash
wget -O - https://gist.githubusercontent.com/gabrielsolomon/776025b533b5e4a3fd1473653a3577c7/raw/initial_setup.sh | bash
wget -O - https://gist.githubusercontent.com/gabrielsolomon/776025b533b5e4a3fd1473653a3577c7/raw/install_lamp_ubuntu.sh | bash
#wget -O - https://gist.githubusercontent.com/gabrielsolomon/776025b533b5e4a3fd1473653a3577c7/raw/certbot.sh | bash
#wget -O - https://gist.githubusercontent.com/gabrielsolomon/776025b533b5e4a3fd1473653a3577c7/raw/newrelic_php.sh | bash
#!/bin/bash
sudo apt-get -y install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get -y install certbot
sudo apt-get -y install python-certbot-apache
#sudo apt-get -y install python-certbot-nginx
sudo apt-get -y install python3-certbot-dns-cloudflare
#!/bin/bash
# Add some repositories
echo -e "\e[96m Updating repositories \e[39m"
sudo add-apt-repository universe
sudo apt-get update && sudo apt-get upgrade -y
# Install Base Packages
sudo locale-gen en_US.UTF-8
sudo /usr/sbin/update-locale LANG=en_US.UTF-8
# Install cURL
sudo apt-get -y install curl
# Install Git
sudo apt-get -y install git-core
# Install Git
cd ~
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get -y install nodejs
sudo apt-get -y install npm
sudo npm install -g grunt-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
# Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
# Install Utilities
sudo apt-get -y install mc
# Install supervisor
sudo apt-get install supervisor
## visudo "{{ dev_user}} ALL=(ALL) NOPASSWD: /usr/bin/supervisorctl"
#!/bin/bash
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
echo -e "\e[96m Installing apache \e[39m"
sudo apt-get -y install apache2 libapache2-mod-fcgid
sudo a2enmod actions fcgid alias proxy_fcgi
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
echo -e "\e[96m Installing php \e[39m"
#sudo apt-get -y install php-xdebug
sudo phpenmod curl
sudo apt-get -y install php-fpm php8.0 php8.0-fpm
sudo a2enconf php8.0-fpm
a2enmod php8.0
sudo apt-get -y install php8.0-curl \
php8.0-mbstring \
php8.0-bz2 \
php8.0-zip \
php8.0-xml \
php8.0-intl \
php8.0-gettext \
php8.0-gd \
php8.0-mysqli
sudo apt-get -y install php-fpm php8.1 php8.1-fpm
sudo a2enconf php8.1-fpm
a2enmod php8.1
sudo apt-get -y install php8.1-curl \
php8.1-mbstring \
php8.1-bz2 \
php8.1-zip \
php8.1-xml \
php8.1-intl \
php8.1-gettext \
php8.1-gd \
php8.1-mysqli \
php8.1-soap
sudo apt-get -y install php-fpm php8.2 php8.2-fpm
sudo a2enconf php8.2-fpm
a2enmod php8.2
sudo apt-get -y install php8.2-curl \
php8.2-mbstring \
php8.2-bz2 \
php8.2-zip \
php8.2-xml \
php8.2-intl \
php8.2-gettext \
php8.2-gd \
php8.2-mysqli \
php8.2-soap
# Enable some apache modules
sudo a2enmod rewrite
sudo a2enmod macro
sudo a2enmod ssl
sudo a2enmod headers
sudo a2enmod gzip
echo -e "\e[96m Restart apache server to reflect changes \e[39m"
sudo service apache2 restart
# Download and install composer
echo -e "\e[96m Installing composer \e[39m"
# Notice: Still using the good old way
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
# Add this line to your .bash_profile
# export PATH=~/.composer/vendor/bin:$PATH
# Check php version
php -v
# Check apache version
apachectl -v
# Check mysql version
#mysql --version
# Check if php is working or not
php -r 'echo "\nYour PHP installation is working fine.\n";'
# Check composer version
composer --version
# Clean up cache
sudo apt-get clean
#!/bin/bash
# Configure the New Relic apt repository.
echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list
# Trust the New Relic GPG key.
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
sudo apt-get update
# Install the PHP agent.
sudo apt-get -y install newrelic-php5
sudo newrelic-install install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment