I love when everything is in its place, everything is clean and tidy.For me it is important to have a stable OS with the confidence that after the next daily update, nothing will break. Many developers choose the OS based on the availability of current versions of software. I can cook Centos and in " yum-y install yum-cron " I am 99.98% sure.
Therefore, once a quarter, raking creative mess.
curl -O http://vestacp.com/pub/vst-install.sh bash vst-install.sh -d
cat > /usr/local/vesta/data/templates/web/nginx/socket.tpl << EOF upstream %domain%_app_server { server unix:/tmp/%domain%.sock fail_timeout=0; } server { listen %ip%:%proxy_port%; server_name %domain_idn% %alias_idn%; error_log /var/log/httpd/domains/%domain%.error.log error; access_log /var/log/httpd/domains/%domain%.access.log; location /static/ { alias %docroot%/static/; } location /media/ { alias %docroot%/media/; } location / { proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header Host \$http_host; proxy_set_header X-Forwarded-Proto \$scheme; proxy_redirect off; if (!-f \$request_filename) { proxy_pass http://%domain%_app_server; break; } } include %home%/%user%/conf/web/nginx.%domain%.conf*; } EOF cat > /usr/local/vesta/data/templates/web/nginx/socket.stpl << EOF server { listen %ip%:%proxy_ssl_port%; server_name %domain_idn% %alias_idn%; ssl on; ssl_certificate %ssl_pem%; ssl_certificate_key %ssl_key%; error_log /var/log/httpd/domains/%domain%.error.log error; access_log /var/log/httpd/domains/%domain%.access.log; location /static/ { alias %sdocroot%/static/; } location /media/ { alias %sdocroot%/media/; } location / { proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header Host \$http_host; proxy_set_header X-Forwarded-Proto \$scheme; proxy_redirect off; if (!-f \$request_filename) { proxy_pass http://%domain%_app_server; break; } } include %home%/%user%/conf/web/snginx.%domain%.conf*; } EOF chown admin.admin /usr/local/vesta/data/templates/web/nginx/socket*
yum install mongodb-server -y chkconfig mongod on service mongod start yum install http://mirror.symnds.com/distributions/gf/el/6/gf/i386/gf-release-6-6.gf.el6.noarch.rpm -y yum --enablerepo=gf-plus install supervisor -y chkconfig supervisord on service supervisord start yum groupinstall "Development tools" -y yum install ImageMagick-devel mysql-devel zlib-devel bzip2-devel openssl-devel ncurses-devel \ sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libjpeg-devel \ libyaml-devel libffi-devel -y yum install git mercurial nodejs -y
[program:djangocms.test.site] directory=/home/reguser/web/%(program_name)s/public_html command=/home/reguser/.pyenv/shims/gunicorn -b unix:/tmp/%(program_name)s.sock project.wsgi:application user=reguser autostart=true autorestart=true redirect_stderr=true [program:quokka.test.site] directory=/home/reguser/web/%(program_name)s/public_html command=/home/reguser/.pyenv/shims/gunicorn -b unix:/tmp/%(program_name)s.sock manage:app user=reguser autostart=true autorestart=true redirect_stderr=true [program:redmine.test.site] directory=/home/reguser/web/%(program_name)s/public_html/ #command=/home/reguser/.rbenv/shims/unicorn -l /tmp/%(program_name)s.sock -E production command=/home/reguser/.rbenv/shims/thin start --socket /tmp/%(program_name)s.sock -e production user=reguser autostart=true autorestart=true redirect_stderr=true [program:refinerycms.test.site] directory=/home/reguser/web/%(program_name)s/public_html/ command=/home/reguser/.rbenv/shims/unicorn -l /tmp/%(program_name)s.sock user=reguser autostart=true autorestart=true redirect_stderr=true
su - reguser
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile . ~/.bash_profile type rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install -l rbenv install 2.0.0-p643 rbenv install 2.2.1
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash echo 'export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile . ~/.bash_profile pyenv install -l pyenv install 2.7.9 pyenv install 3.4.3
cd ~/web/redmine.test.site/public_html rm -rf * hg clone --updaterev 3.0-stable https://bitbucket.org/redmine/redmine-all . echo 'production: adapter: mysql2 database: reguser_redmine host: localhost username: reguser_redmine password: "password" encoding: utf8 ' > config/database.yml
rbenv local 2.2.1 gem install bundler bundle install --without development test rake generate_secret_token RAILS_ENV=production rake db:migrate RAILS_ENV=production rake redmine:load_default_data
The choice of thin or unicorn (as indicated in the supervisor): gem install thin echo 'gem "thin"' >> Gemfile gem install unicorn echo 'gem "unicorn"' >> Gemfile
cd ~/web/refinerycms.test.site/public_html/ rbenv local 2.0.0-p643 gem install rails --version 4.1.8 gem install execjs rails new . -m http://refinerycms.com/t/edge gem install unicorn
cd ~/web/djangocms.test.site/public_html pyenv local 3.4.3 pip install djangocms-installer
djangocms -p . project
python manage.py cms check # check cms pip install gunicorn
cd ~/web/quokka.test.site/public_html git clone https://github.com/quokkaproject/quokka . pyenv local 2.7.9 pip install -r requirements.txt sed -i "s|^GRAVATAR.*$|&\n 'use_ssl': True,|" quokka/settings.py python manage.py populate python manage.py createsuperuser ln -s quokka/static static pip install gunicorn
Source: https://habr.com/ru/post/252955/
All Articles