Created
December 8, 2012 19:14
-
-
Save cursedcoder/4241466 to your computer and use it in GitHub Desktop.
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
<?php | |
`apt-get update && sudo apt-get upgrade && apt-get install nginx php5-fpm -y`; | |
$nginx = <<<TEXT | |
user www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
} | |
http { | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 122048; | |
client_max_body_size 128M; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
gzip on; | |
gzip_disable "msie6"; | |
server { | |
listen 80; | |
server_name localhost; | |
root %%base_path%%/web; | |
index app_test.php; | |
# strip app.php/ prefix if it is present | |
rewrite ^/app_test\.php/?(.*)$ /$1 permanent; | |
location / { | |
index app_test.php; | |
try_files \$uri @rewriteapp; | |
} | |
location @rewriteapp { | |
rewrite ^(.*)$ /app_test.php/$1 last; | |
} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9001 | |
location ~ ^/(app|app_dev|app_test)\.php(/|$) { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; | |
fastcgi_param HTTPS off; | |
} | |
} | |
} | |
TEXT; | |
$nginx = str_replace('%%base_path%%', __DIR__, $nginx); | |
file_put_contents('/etc/nginx/nginx.conf', $nginx); | |
`service nginx start`; | |
`service php5-fpm start`; | |
`wget http://selenium.googlecode.com/files/selenium-server-standalone-2.25.0.jar`; | |
`java -jar selenium-server-standalone-2.25.0.jar > /dev/null 2>&1 &`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment