Commit 00c1661b authored by Owain Jones's avatar Owain Jones
Browse files

added mongodb stuff. added to nginx config the ability to fall back to PHP-FPM...

added mongodb stuff. added to nginx config the ability to fall back to PHP-FPM if (when) HHVM crashes, but this is commented out for now.
parent f5ee7927
...@@ -57,6 +57,7 @@ if [ -f /usr/bin/pypy ]; then ...@@ -57,6 +57,7 @@ if [ -f /usr/bin/pypy ]; then
pypy -m pip install lxml==3.4.4 pypy -m pip install lxml==3.4.4
pypy -m pip install sqlalchemy pypy -m pip install sqlalchemy
pypy -m pip install elasticsearch pypy -m pip install elasticsearch
pypy -m pip install pymongo
pypy setup.py install pypy setup.py install
source /home/gliders/pythonenv/bin/activate source /home/gliders/pythonenv/bin/activate
fi fi
......
...@@ -83,6 +83,16 @@ server { ...@@ -83,6 +83,16 @@ server {
# pass the PHP scripts to FastCGI server from upstream phpfcgi # pass the PHP scripts to FastCGI server from upstream phpfcgi
location ~ ^/(app|app_dev|config)\.php(/|$) { location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass hhvmfcgi; fastcgi_pass hhvmfcgi;
fastcgi_intercept_errors on;
# error_page 502 = @fallback;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $symfonyroot/web$fastcgi_script_name;
fastcgi_param HTTPS off;
}
location @fallback {
fastcgi_pass phpfcgi;
include fastcgi_params; include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $symfonyroot/web$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $symfonyroot/web$fastcgi_script_name;
......
...@@ -5,6 +5,7 @@ Description=HHVM HipHop Virtual Machine (FCGI) ...@@ -5,6 +5,7 @@ Description=HHVM HipHop Virtual Machine (FCGI)
ExecStartPre=/bin/mkdir -p /var/run/hhvm ExecStartPre=/bin/mkdir -p /var/run/hhvm
ExecStartPre=/bin/chown -R gliders:nginx /var/run/hhvm ExecStartPre=/bin/chown -R gliders:nginx /var/run/hhvm
ExecStart=/usr/local/bin/hhvm --user gliders --mode daemon -d hhvm.server.type=fastcgi -d hhvm.server.file_socket=/var/run/hhvm/sock -d hhvm.admin_server.port=9001 -d hhvm.admin_server.password=gliders9876 ExecStart=/usr/local/bin/hhvm --user gliders --mode daemon -d hhvm.server.type=fastcgi -d hhvm.server.file_socket=/var/run/hhvm/sock -d hhvm.admin_server.port=9001 -d hhvm.admin_server.password=gliders9876
#ExecStartPost=/usr/bin/python /home/gliders/code/gliders-tools/bin/warmup.py
Restart=on-failure Restart=on-failure
[Install] [Install]
......
...@@ -25,7 +25,7 @@ yum install -y inotify-tools incron ...@@ -25,7 +25,7 @@ yum install -y inotify-tools incron
yum groupinstall -y "Development Tools" yum groupinstall -y "Development Tools"
# Install python libraries # Install python libraries
yum install -y python-inotify numpy python-matplotlib python-virtualenv python-pip python-pandas libffi-devel pypy pypy-devel yum install -y python-inotify numpy python-matplotlib python-virtualenv python-pip python-pandas libffi-devel pypy pypy-devel python-daemon
pip install css-html-js-minify pip install css-html-js-minify
pip install bcrypt pip install bcrypt
...@@ -45,12 +45,16 @@ systemctl enable mariadb ...@@ -45,12 +45,16 @@ systemctl enable mariadb
# Install ElasticSearch # Install ElasticSearch
# (Used for full-text searching of glider log files) # (Used for full-text searching of glider log files)
yum install -y java-1.8.0-openjdk # yum install -y java-1.8.0-openjdk
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch # rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
cp elasticsearch.repo /etc/yum/repos.d/ # cp elasticsearch.repo /etc/yum/repos.d/
yum check-update -y # yum check-update -y
yum install -y elasticsearch # yum install -y elasticsearch
systemctl enable elasticsearch # systemctl enable elasticsearch
# Install MongoDB
yum install -y mongodb python-pymongo php-pecl-mongo
systemctl enable mongod
# Install SQLAlchemy # Install SQLAlchemy
yum install -y MySQL-python python-sqlalchemy yum install -y MySQL-python python-sqlalchemy
...@@ -132,6 +136,12 @@ loginctl enable-linger gliders ...@@ -132,6 +136,12 @@ loginctl enable-linger gliders
cp security-limits.d-10-files.conf /etc/security/limits.d/10-files.conf cp security-limits.d-10-files.conf /etc/security/limits.d/10-files.conf
cp sysctl.d-0-filelimits.conf /etc/sysctl.d/0-filelimits.conf cp sysctl.d-0-filelimits.conf /etc/sysctl.d/0-filelimits.conf
# Add dev.gliders.localhost and gliders.localhost entries
# This allows us to access the gliders website from nginx on this
# machine.
echo '127.0.0.1 dev.gliders.localhost gliders.localhost' >> /etc/hosts
echo '::1 dev.gliders.localhost gliders.localhost' >> /etc/hosts
# (optional) Compile HHVM -- this will take ages! # (optional) Compile HHVM -- this will take ages!
# yum install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc}-devel \ # yum install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc}-devel \
# {ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \ # {ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment