Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Owain Jones
gliders-webserver
Commits
1e1e7112
Commit
1e1e7112
authored
9 years ago
by
Owain Jones
Browse files
Options
Download
Email Patches
Plain Diff
added stuff for HHVM, automatically set up github api key variables for composer and bower
parent
ece59d23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
1 deletion
+43
-1
deploy.sh
deploy.sh
+13
-1
hhvm.service
hhvm.service
+10
-0
install.sh
install.sh
+16
-0
nginx.conf
nginx.conf
+4
-0
No files found.
deploy.sh
View file @
1e1e7112
...
...
@@ -40,6 +40,8 @@ git clone git@gitlab.noc.soton.ac.uk:owanes/gliders-website.git
# then fetch all our log files and parse them!
cd
gliders-tools
python setup.py
install
sudo cp
fetchlogs.service /etc/systemd/system/
sudo
systemctl
enable
fetchlogs
echo
"please enter your mysql root user password"
read
-s
pass
...
...
@@ -48,11 +50,21 @@ echo "CREATE USER 'gliders'@'%' IDENTIFIED BY '"$pass"' ;" | mysql -u root -p$pa
echo
"GRANT ALL ON gliders.* TO 'gliders'@'%';"
| mysql
-u
root
-p
$pass
cd
bin
sh migrate_data.sh
sudo
systemctl start fetchlogs
# Set up a GitHub API key and add it to .bash_profile
# export API_KEY=...
echo
"Deploying the website requires interacting with GitHub a lot."
echo
"We need a GitHub API Key so we don't go over the public limits."
echo
"Please go to: https://github.com/settings/tokens/new?scopes=repo&description=
`
hostname
`
"
echo
"Generate the token and then paste it into the prompt below."
read
-p
"Token: "
GITHUB_API_KEY
echo
"export GITHUB_API_KEY=
$GITHUB_API_KEY
"
>>
~/.bashrc
echo
"export BOWERPHP_TOKEN=
$GITHUB_API_KEY
"
>>
~/.bashrc
composer config
-g
github-oauth.github.com
$GITHUB_API_KEY
export
BOWERPHP_TOKEN
=
$GITHUB_API_KEY
# Deploy the website
cd
/home/gliders/code/gliders-website
sh bin/deploy.sh /var/gliders/www_dev dev
sh bin/deploy.sh /var/gliders/www prod
\ No newline at end of file
sh bin/deploy.sh /var/gliders/www prod
This diff is collapsed.
Click to expand it.
hhvm.service
0 → 100644
View file @
1e1e7112
[Unit]
Description
=
HHVM HipHop Virtual Machine (FCGI)
[Service]
ExecStartPre
=
/bin/mkdir -p /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
[Install]
WantedBy
=
multi-user.target
This diff is collapsed.
Click to expand it.
install.sh
View file @
1e1e7112
...
...
@@ -123,3 +123,19 @@ systemctl enable haveged
# Enable SystemD User services to start automatically on machine
# boot and continue running even if the user never logs in...
loginctl enable-linger gliders
# (optional) Compile HHVM -- this will take ages!
# yum install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc}-devel \
# {ImageMagick,sqlite,tbb,bzip2,openldap,readline,elfutils-libelf,gmp,lz4,pcre}-devel \
# lib{xslt,event,yaml,vpx,png,zip,icu,mcrypt,memcached,cap,dwarf}-devel \
# {unixODBC,expat,mariadb}-devel lib{edit,curl,xml2,xslt}-devel \
# glog-devel oniguruma-devel ocaml gperf enca libjpeg-turbo-devel openssl-devel \
# mariadb mariadb-server make -y
# git clone https://github.com/facebook/hhvm -b master hhvm --recursive
# cd hhvm
# cmake .
# make -j4
# make install
# cd -
# cp hhvm.service /etc/systemd/system/
# systemctl enable hhvm
This diff is collapsed.
Click to expand it.
nginx.conf
View file @
1e1e7112
...
...
@@ -39,6 +39,10 @@ http {
server
unix:/var/run/php5-fpm.sock
;
#for PHP-FPM running on UNIX socket
}
upstream
hhvmfcgi
{
server
unix:/var/run/hhvm/sock
;
}
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment