This is my first post to SO so I hope I'm asking this correctly.
I wrote a shell script to automate the installation of Passenger & Nginx (along with some other components) without any user input on a Vagrant VM running Ubuntu 14.04. It works fine using the following:
echo "****** Adding Passenger & Nginx Repo ******"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7
sudo apt-get install apt-transport-https ca-certificates -y
echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main" | sudo tee /etc/apt/sources.list.d/passenger.list
sudo chown root: /etc/apt/sources.list.d/passenger.list
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
sudo apt-get update
echo "****** Installing Passenger & Nginx ******"
sudo apt-get install nginx-extras passenger -y
Now I want to do the same thing for a Vagrant VM running CentOS 6.4. I followed the directions for CentOS found on the Phusion Passenger site but I can't seem to get it working properly. When I do the following, the output from the shell script says "No package passenger available.":
echo "****** Adding Passenger & Nginx Repo ******"
sudo yum install epel-release pygpgme curl -y
sudo 'echo "curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo"'
sudo chown root: /etc/yum.repos.d/passenger.repo
sudo chmod 600 /etc/yum.repos.d/passenger.repo
sudo yum update
echo "****** Installing Passenger & Nginx ******"
sudo yum install nginx passenger -y
Looking in the /etc/yum.repos.d directory after the script is run, there is no passenger.repo listed, so it looks like for whatever reason curl is not downloading the repo file. However, if I manually type the commands in my terminal command line after the script finishes it will pull down the repo and run.
I'm probably doing something stupid here, but I'm rather new to shell scripting and can't seem to figure out where the problem is.
Thanks for any help you can give me.
sudo 'echo "curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo"'
That is wrong and is not what the manual instructed. It should be:
sudo curl --fail -sSLo /etc/yum.repos.d/passenger.repo https://oss-binaries.phusionpassenger.com/yum/definitions/el-passenger.repo
Related
When I run curl, it shows this error:
~$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
I'm unable to install yarn.
I tried killing:
~$ kill -9 gpg-agent
and restarting:
~$ gpg-agent --daemon
but nothing worked so far. Any advice?
I did this from my root -
npm install -g yarn
Checked if the yarn is installed by -
yarn --version
It worked.
The following worked for me:
sudo apt remove gnupg
sudo apt autoremove
sudo apt install gnupg1
This installs GNUPG Classic. Read more here.
just set up a dev laptop but installing ddev has been problematic. followed instructions from docs.docker.com, ddev.readthedocs.com, and Mike Anello's book for DDEV LOCAL.
An unusual and undocumented bit of installation is when I tried to run brew initially, my Ubuntu 18.04 complained to me to install linuxbrew-wrapper so I did. Then the brew worked properly.
The situation is this: I cannot run ddev unless the docker container is stopped. Looking in /bin and /Cellar shows most of the executables have myname:docker as owner/group but ddev, hello, patchelf are myname:myname owner/group.
Should I chown those files to myname:docker owner/group to be able to run them while the container is live?
or
Am I supposed to shut off the container for running ddev?
Solution (ymmv)
Part 1
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo docker run hello-world
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose
docker-compose --version
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
Part 2
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
sudo apt-get install build-essential
sudo apt-get -o Dpkg::Options::="--force-overwrite" install --fix-broken
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.profile
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.bashrc
source .bashrc
Part 3
brew
brew install gcc
brew tap drud/ddev && brew install ddev
mkcert --install
I created a Drupal site running on a Vagrant virtual box. However, I can't display anything beyond the homepage. I've included the vagrant bootstrap.sh code below:
sudo apt-get update
echo "mysql-server mysql-server/root_password password root" | sudo debconf-set-selections
echo "mysql-server mysql-server/root_password_again password root" | sudo debconf-set-selections
sudo apt-get -y install mysql-server
sudo apt-get -y install zip unzip git php5 php5-cli apache2 libapache2-mod-auth-mysql php5-mysql libapache2-mod-php5 php5-mcrypt php5-gd
mysql -u root -p"root" -e "CREATE DATABASE DKAN_TEST;"
sudo rm -Rf /var/www
sudo mkdir /var/www/
sudo ln -s /home/vagrant/dkan/ /var/www/html
php -r "readfile('http://files.drush.org/drush.phar');" > /tmp/drush
php /tmp/drush core-status
chmod +x /tmp/drush
sudo mv /tmp/drush /usr/local/bin
echo "ServerName dkan-test.local.com" | sudo tee -a /etc/apache2/apache2.conf
sudo service apache2 restart
sudo drush init
git clone --branch master https://github.com/nuams/dkan-drops-7.git dkan
cd dkan
unzip master.zip
sudo drush -y site-install dkan --db-url="mysql://root:root#localhost/DKAN_TEST" --verbose
So this creates my Drupal site, which seems to function correctly when I visit the assigned IP address. However, clicking any link on the site gives me an error, e.g., "The requested URL /about was not found on this server."
I tried to follow the instructions on this page but to no avail. When I make a phpinfo.php file with only phpinfo(); in it, visiting assigned-ip/phpinfo.php shows me phpinfo(); in plaintext. I also checked my RewriteBase settings, and I set AllowOverride All to everything in my /home/vagrant/dkan/ directory.
I have the following docker file that I am attempting to use to build a Ubuntu image with mono.
FROM ubuntu:14.04
MAINTAINER John Smith <John.Smith#gmail.com>
RUN sudo apt-get update
RUN sudo /bin/bash -l -c apt-get install wget
RUN sudo /bin/bash -l -c apt-get http://download.mono-project.com/repo/xamarin.gpg
RUN sudo apt-key add xamarin.gpg
RUN sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list
RUN sudo apt-get update
RUN sudo apt-get install mono-complete
When I run the following docker build command...
docker build -t="test/mono" .
It fails building and gives the following errors message:
gpg:can't open 'xamaring.gpg': No such file or directory.
2015/05/27 16:11:01 The command [/bin/bash -c sudo apt-key add xamarin.gpg] returned a non-zero code: 2
Anything obviously wrong sticking out?
It looks like you forgot to use wget instead of apt-get after you installed wget, so 'xamaring.gpg' has not been downloaded and that's why it can't be found.
You need this:
/bin/bash -l -c "wget http://download.mono-project.com/repo/xamarin.gpg"
The is an example of this in docker's website:
Dockerizing MongoDB
I would like to install ghostscript when creating my vagrant environment but i have no idea how to achieve this. My provisioning script looks as following:
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y wget php5 apache2
# Apache stuff
sudo a2enmod rewrite
rm -rf /var/www
ln -fs /vagrant /var/www
sudo service apache2 restart
Inside your shell provisioning script you must define the following commands
wget http://downloads.ghostscript.com/public/ghostscript-9.10.tar.bz2
tar xjf ghostscript-9.10.tar.bz2
cd ghostscript-9.10
rm -rf zlib && ./configure --prefix=/usr --disable-compile-inits \ --enable-dynamic --with-system-libtiff && make
make so
su root
make install
gs -v
What this basically does is:
download the package
extract the contents
compiles ghostscript
installs ghostscript
checks if it installed correctly
Above explanation has to send you on it's way to install it