diff options
-rwxr-xr-x | .openshift/action_hooks/deploy | 8 | ||||
-rw-r--r-- | .openshift/markers/.gitkeep | 0 | ||||
-rw-r--r-- | config/nginx.d/default.conf.erb | 40 | ||||
-rw-r--r-- | config/nginx.d/export_env.erb | 5 | ||||
-rw-r--r-- | config/php.d/.gitkeep | 0 | ||||
-rw-r--r-- | config/php.d/extensions.ini | 45 | ||||
-rw-r--r-- | www/index.php | 83 | ||||
-rw-r--r-- | www/static/openshift-logo.png | bin | 0 -> 9714 bytes |
8 files changed, 181 insertions, 0 deletions
diff --git a/.openshift/action_hooks/deploy b/.openshift/action_hooks/deploy new file mode 100755 index 0000000..95cdeef --- /dev/null +++ b/.openshift/action_hooks/deploy @@ -0,0 +1,8 @@ +#!/bin/bash + +echo "Deploying..." +build_config + +# Uncomment the following line to use Composer and automatically install dependencies on deploy. +# +#cd $OPENSHIFT_REPO_DIR; composer install diff --git a/.openshift/markers/.gitkeep b/.openshift/markers/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.openshift/markers/.gitkeep diff --git a/config/nginx.d/default.conf.erb b/config/nginx.d/default.conf.erb new file mode 100644 index 0000000..d82da13 --- /dev/null +++ b/config/nginx.d/default.conf.erb @@ -0,0 +1,40 @@ +server { + root <%= ENV['OPENSHIFT_REPO_DIR'] %>/www; + listen <%= ENV['OPENSHIFT_PHP_IP'] %>:<%= ENV['OPENSHIFT_PHP_PORT'] %>; + server_name <%= ENV['OPENSHIFT_APP_DNS'] %>; + index index.php index.html index.htm <%= ENV['NGINX_EXTRA_INDEX'] %>; + + set_real_ip_from <%= ENV['OPENSHIFT_PHP_IP'] %>; + real_ip_header X-Forwarded-For; + + # avoid caching by proxies + add_header Cache-Control private; + + location ~ \.php$ { + try_files $uri =404; + fastcgi_pass unix:<%= ENV['OPENSHIFT_PHP_DIR'] %>/run/php-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + include openshift_params; + + # uncomment to export all environment variables to fastcgi + #include <%= ENV['OPENSHIFT_REPO_DIR'] %>/config/nginx.d/export_env; + } + + # avoid unnecessary log + location = /favicon.ico { + access_log off; + log_not_found off; + } + + location = /robots.txt { + access_log off; + log_not_found off; + } + + # Handle any other URI + location / { + try_files $uri $uri/ =404; + } +} diff --git a/config/nginx.d/export_env.erb b/config/nginx.d/export_env.erb new file mode 100644 index 0000000..4e5db9a --- /dev/null +++ b/config/nginx.d/export_env.erb @@ -0,0 +1,5 @@ +<% +ENV.each do |name, value| + puts "fastcgi_param #{name} '#{value}';" unless name.start_with?("OPENSHIFT_"); +end +%>
\ No newline at end of file diff --git a/config/php.d/.gitkeep b/config/php.d/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/config/php.d/.gitkeep diff --git a/config/php.d/extensions.ini b/config/php.d/extensions.ini new file mode 100644 index 0000000..0379fe6 --- /dev/null +++ b/config/php.d/extensions.ini @@ -0,0 +1,45 @@ +extension=apcu.so +extension=bcmath.so +extension=bz2.so +extension=calendar.so +extension=ctype.so +extension=curl.so +extension=dom.so +extension=exif.so +extension=fileinfo.so +extension=ftp.so +extension=gd.so +extension=gettext.so +extension=gmp.so +extension=iconv.so +extension=imagick.so +extension=imap.so +extension=intl.so +extension=json.so +extension=mbstring.so +extension=mcrypt.so +extension=mysqli.so +extension=pdo.so +extension=pdo_mysql.so +extension=pdo_pgsql.so +extension=pdo_sqlite.so +extension=pgsql.so +extension=phar.so +extension=posix.so +extension=shmop.so +extension=simplexml.so +extension=soap.so +extension=sockets.so +extension=sqlite3.so +extension=sysvmsg.so +extension=sysvsem.so +extension=sysvshm.so +extension=tidy.so +extension=tokenizer.so +extension=xmlreader.so +extension=xml.so +extension=xmlwriter.so +extension=xsl.so +extension=wddx.so +extension=zip.so +#extension=mongodb.so diff --git a/www/index.php b/www/index.php new file mode 100644 index 0000000..74b121d --- /dev/null +++ b/www/index.php @@ -0,0 +1,83 @@ +<!doctype html> +<html> +<head> + <meta charset="utf-8" /> + <title>Welcome to OpenShift</title> + <link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet" type="text/css" /> + <style type="text/css"> + html, body { + margin: 0; + padding: 0; + } + + body { + font-family: 'Open Sans', sans-serif; + padding-top: 100px; + } + + h1 { + font-size: 52px; + margin-bottom: 0; + } + + h1, h2, p { + margin-top: 0; + font-weight: normal; + } + + a { + color: #DB242F; + } + + a:not(:hover) { + text-decoration: none; + } + + .container { + display: flex; + flex-direction: row; + margin: 0 auto; + width: 960px; + } + + .section { + padding: 15px; + } + + .section + .section { + margin-left: 15px; + } + + .welcome { + background: #eee; + border-radius: 5px; + text-align: center; + flex: 0 0 300px; + } + </style> +</head> +<body> + <div class="container"> + <div class="section welcome"> + <div> + <img src="/static/openshift-logo.png" alt="OpenShift Logo" /> + </div> + <h1>Welcome!</h1> + <p>You are running PHP <?php echo phpversion(); ?></p> + </div> + <div class="section"> + <h2>What's next?</h2> + <p>Make changes to this website by editing the files inside <code>www/</code> of your repository.</p> + <p>Commit your changes after, then push to the remote repository.</p> + <pre><code>$ git commit -a -m "Some commit message" +$ git push origin master</code></pre> + <h2>More</h2> + <ul> + <li>Visit <a href="http://www.openshift.com">http://www.openshift.com</a>.</li> + <li>Get help in the <a href="http://www.openshift.com/forums/openshift">OpenShift forums</a>.</li> + <li>More on the cartridge at <a href="https://github.com/pinodex/openshift-cartridge-nginx-php7">pinodex/openshift-cartridge-nginx-php7</a>.</li> + </ul> + </div> + </div> +</body> +</html>
\ No newline at end of file diff --git a/www/static/openshift-logo.png b/www/static/openshift-logo.png Binary files differnew file mode 100644 index 0000000..e83e59b --- /dev/null +++ b/www/static/openshift-logo.png |