Skip to content

Instantly share code, notes, and snippets.

@peterjmit
Last active March 18, 2017 18:29
Show Gist options
  • Save peterjmit/5699524 to your computer and use it in GitHub Desktop.
Save peterjmit/5699524 to your computer and use it in GitHub Desktop.

Revisions

  1. peterjmit revised this gist Jun 12, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion composer_create_project.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    $ cd /var/www
    $ composer create-project symfony/framework-standard-edition my-app v2.3.0-RC1
    $ composer create-project symfony/framework-standard-edition my-app
  2. peterjmit revised this gist Jun 3, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion composer_create_project.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    $ cd /var/www $ composer create-project symfony/framework-standard-edition my-app v2.3.0-RC1
    $ cd /var/www
    $ composer create-project symfony/framework-standard-edition my-app v2.3.0-RC1
  3. peterjmit created this gist Jun 3, 2013.
    11 changes: 11 additions & 0 deletions app_dev.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php
    // ...
    if (isset($_SERVER['HTTP_CLIENT_IP']) ||
    isset($_SERVER['HTTP_X_FORWARDED_FOR']) ||
    !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1', /* Host machine IP */'10.10.4.1'))
    ) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
    }

    // ...
    1 change: 1 addition & 0 deletions composer_create_project.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    $ cd /var/www $ composer create-project symfony/framework-standard-edition my-app v2.3.0-RC1
    15 changes: 15 additions & 0 deletions config.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    <?php

    // ...

    if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
    '127.0.0.1',
    '::1',
    // Host machine IP
    '10.10.4.1',
    ))) {
    header('HTTP/1.0 403 Forbidden');
    exit('This script is only accessible from localhost.');
    }

    // ...
    2 changes: 2 additions & 0 deletions edit_php_ini.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    $ sudo nano /etc/php5/cli/php.ini
    $ sudo nano /etc/php5/apache2/php.ini
    12 changes: 12 additions & 0 deletions hosts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting. Do not change this entry.
    ##
    127.0.0.1 localhost

    #...

    # The entry for our Symfony app
    10.0.0.15 local.my-app.com
    3 changes: 3 additions & 0 deletions install_composer.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    $ sudo apt-get install curl
    $ curl -sS https://getcomposer.org/installer | php
    $ sudo mv composer.phar /usr/local/bin/composer
    11 changes: 11 additions & 0 deletions my-app.vhost
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName local.my-app.com
    DocumentRoot /var/www/my-app/web

    <Directory /var/www/my-app/web>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny allow from all
    </Directory>
    </VirtualHost>
    12 changes: 12 additions & 0 deletions php.ini
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    [Date]
    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    date.timezone = Europe/London

    ; ...

    ; Default Value: On
    ; Development Value: Off
    ; Production Value: Off
    ; http://php.net/short-open-tag
    short_open_tag = Off
    2 changes: 2 additions & 0 deletions run_symfony_check_script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    $ cd /var/www/my-app
    $ php app/check.php