Mini-net is a very tiny social network, shaped for family.
It is based on the PHP framework Symfony2, and is also using Bootstrap, jQuery and Fancybox.
- Web server with PHP >= 5.4
- MySQL / PostgreSQL database (or any database supported by Doctrine ORM)
This guide is made for Debian 7 (Wheezy) with an Apache 2 web server and a MySQL database, feel free to adapt it to your own configuration.
Install all the needed softwares:
apt-get install apache2
apt-get install mysql-server
apt-get install php5 php5-mysql php5-sqlite php-apc php5-intl php5-gd
apt-get install git
Get composer on your system:
curl -s https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Tip: you might need to modify you php.ini to install composer, juste follow the instructions of the installer. For more information about composer see getcomposer.org
Clone mini-get git repository from github
git clone https://github.com/inouire/mini-net.git
Copy default config file to app/config/parameters.yml
cp app/config/parameters.yml.dist app/config/parameters.yml
Edit app/config/parameters.yml
with your settings
Retrieve project dependencies with composer
composer install --no-dev --prefer-dist
Configure a new apache2 virtual host which root is the /web directory of git repository
For clean urls, activate mod_rewrite and AllowOverride of .htaccess in your apache virtual host
a2enmod rewrite
a2enmod headers
a2enmod expires
Tip: if you intend to run a production environement, modifiy web/.htaccess like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
Give your web server read access, and set write permission for web server on app/cache, app/logs and web directory
usermod -G www-data -a your_user
chgrp -R www-data *
chmod g+rwx app/{cache,logs}
chmod g+rwx web/*
Edit /etc/php5/apache2/php.ini to set configuration recommended by Symfony
- set date.timezone (for example Europe/Paris)
- set short open tags to Off
- set max upload size to 10M (only images need to be uploaded in mini-net)
Restart your web server to take config into account
Check your config with Symfony built-in script at http:https://youradress/config.php (if not on localhost, temporary disable source check at the beginning of the file config.php)
Create database with doctrine (if not already)
php app/console doctrine:database:create
Automatically create schema with doctrine
php app/console doctrine:schema:update --force
Add one or more users with doctrine
php app/console fos:user:create
Go to http:https://youradress/home You should get a login page, use the login/password of the user you created the step before
Enjoy !
If you're having some issue and can't figure it with the message displayed in your browser, use the logs at app/logs/dev.log (or app/logs/prod.log for prod environment) to know what's going on
If running prod environnement, don't forget to clean the cache after each modification
php app/console --no-debug cache:clear --env=prod