This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function showProgress($total, $current, $message = '') | |
{ | |
$this->cachedMessage = str_repeat("\x08", strlen($this->cachedMessage)); | |
$percentComplete = ($current/$total); | |
$completedCharacters = ceil($percentComplete * $this->totalProgressCharacters); | |
$bar = str_repeat("*", $completedCharacters); | |
$bar = str_pad($bar, $this->totalProgressCharacters, " "); | |
$bar = "[" . $bar . "] "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum remove -y php* | |
yum install -y epel-release vim rsync git git-core zsh ntp screen nano wget htop gcc tree nginx net-tools | |
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm | |
yum install -y php56w php56w-mbstring php56w-xml php56w-fpm php56w-pdo php56w-mysqli | |
sudo sed -ri 's/^(;)(cgi.fix_pathinfo=)(1)$/\2'0'/' /etc/php.ini | |
sudo sed -ri 's/^(listen = )(127.0.0.1:9000)$/\1\/var\/run\/php-fpm\/php-fpm.sock/' /etc/php-fpm.d/www.conf | |
sudo sed -ri 's/^(;)(listen.owner = )(nobody)$/\2'nginx'/' /etc/php-fpm.d/www.conf | |
sudo sed -ri 's/^(;)(listen.group = )(nobody)$/\2'nginx'/' /etc/php-fpm.d/www.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
#server_name "~^(?<sub>.+)\.something\.com$"; | |
#root /var/www/$sub/current/public; | |
server_name something.com; | |
root /var/www/site/current/public; | |
index index.html index.htm index.php; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ /.well-known { | |
allow all; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return 301 https://$host$request_uri; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443 ssl; | |
server_name something.somesite.com; | |
ssl_certificate /etc/letsencrypt/live/something.somesite.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/something.somesite.com/privkey.pem; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream jenkins { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 443 default ssl; | |
server_name jenkins.somesite.com; | |
ssl_certificate /etc/letsencrypt/live/jenkins.somesite.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/jenkins.somesite.com/privkey.pem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_server { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name jenkins.somesite.com; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum install -y epel-release nginx | |
yum install -y certbot | |
sudo setsebool -P httpd_can_network_connect 1 | |
# install well-known conf in nginx. | |
systemctl restart nginx.service | |
certbot certonly -a webroot --webroot-path=/usr/share/nginx/html -d jenkins.somesite.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
su - deploy | |
mkdir .ssh && cd .ssh | |
ssh-keygen -b 2048 -t rsa -f key -C deploy | |
cat > authorized_keys < key.pub | |
chmod 0700 ~/.ssh; chmod 0600 ~/.ssh/authorized_keys |
OlderNewer