Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install php as part of the setup.sh script #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TheAspens
Copy link
Member

Fixes issue #3

@TheAspens
Copy link
Member Author

@drshawnkwang can you test and merge if it works as intended? Thanks!

@Rytiss
Copy link

Rytiss commented Oct 23, 2018

@TheAspens Why are you checking for existence of apt-get and then using apt instead?

@TheAspens
Copy link
Member Author

Because I wasn't being careful when I changed it from apt-get to apt. Thanks for the catch. Fixed.

@drshawnkwang
Copy link

drshawnkwang commented Oct 25, 2018

I did get this warning, repeated for each package composer installed.

    Failed to download sebastian/version from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php --ini` to show them.
    Now trying to download from source
  - Installing sebastian/version (2.0.1): Cloning 99732be0dd from cache

The packages are correctly installed, but I think using git. On a bare (new) system, install package 'zip' and 'unzip'. Once these are installed, then composer won't spit out this warning. For Debian apt install zip will do the trick (as it installs unzip). For Redhat-family, I am unsure, but yum install unzip will probably do the trick.

@TheAspens
Copy link
Member Author

Thanks - I added. Feel free to merge when you are good with this pull request. Thanks!

@drshawnkwang
Copy link

I finally got around to testing the updated setup.sh script. No problems, the PR is ready to be merged. However, two comments.

  1. I don't have the write permissions to merge this PR. (FTR: I don't really think I need/want it.) You'll have to merge it.
  2. Comment about composer. If you naively run the PHP commands on composer's Web site, you will get a executable named composer.phar in your current working directory. And command -v composer checks for the command 'composer' in ones $PATH. I think it would be worthwhile to add a comment to the script saying:
echo 'Please install composer with command "php composer-setup.php --install-dir=/usr/local/bin --filename=composer". Or manually move the executable composer.phar into your PATH and rename it "composer".'

Since I've used composer before I already knew I had to move the executable. Adding a sentence may make things more clear for people who have never downloaded composer before.

@TheAspens
Copy link
Member Author

@drshawnkwang - I just noticed this pull request lagging. I believe I have addressed your concerns as well as fixed a few other issues I found (I have a new laptop so I'm fixing a few things). Can you take a look and merge if possible? You should have access to merge now.

@drshawnkwang
Copy link

drshawnkwang commented Apr 23, 2019

I tested this branch in a vagrant VM running vanilla Debian 9. Two comments

  1. Github says I do not have write access to merge this code.
  2. When I run setup, everything works. When I try to start the boincserver with ansible-playbook -i hosts start.yml the command fails. I believe the problem is: boincserver starts an docker apache process which binds to port 80. However, as part of setup.sh, apache2 is installed in the VM. This starts the apache2 daemon and binds to port 80. The result is that the docker apache process cannot bind to port 80 and fails. (I think.)

The solution may be a command systemctl stop apache at the end of the setup.sh.

Lastly, I will try to test this branch with a Centos VM tomorrow and post if there are any problems.

@TheAspens
Copy link
Member Author

Which part of the setup.sh triggered the install of apache? Apache isn't needed so I'm not sure why it is getting installed.

@drshawnkwang
Copy link

drshawnkwang commented Apr 24, 2019

Which part of the setup.sh triggered the install of apache?

It turns out the answer is: the PHP package that installs apache, i.e., what I am 'asking for'. apt install php installs apache2 on Debian 9 stretch.

I was also able to test out this branch on a vanilla Centos 7 VM. First, php does not install apache2.

However, Centos 7 does not build the docker stack. I get the following error.

fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["docker-compose", "build", "--no-cache"], "delta": "0:00:00.495324", "end": "2019-04-24 14:30:19.727193", "msg": "non-zero return code", "rc": 1, "start": "2019-04-24 14:30:19.231869", "stderr": "Building mysql\nService 'mysql' failed to build: Error parsing reference: \"mariadb:10.3.8-bionic AS mysql\" is not a valid repository/tag: invalid reference format", "stderr_lines": ["Building mysql", "Service 'mysql' failed to build: Error parsing reference: \"mariadb:10.3.8-bionic AS mysql\" is not a valid repository/tag: invalid reference format"], "stdout": "Step 1/3 : FROM mariadb:10.3.8-bionic AS mysql", "stdout_lines": ["Step 1/3 : FROM mariadb:10.3.8-bionic AS mysql"]}

Reformatting the stderr lines to be more readable:

"stderr_lines": [
"Building mysql",
"Service 'mysql' failed to build: Error parsing reference: "mariadb:10.3.8-bionic AS mysql" is not a valid repository/tag: invalid reference format"
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants