50
loading...
This website collects cookies to deliver better user experience
etc/apache2/apache2.conf
because it is the main configuration file of Apache so if you broke that file probably your Apache will not work.etc/apache2/sites-available/000-default.conf
inside the block <VirtualHost *:80>
or create your own configuration file in etc/apache2/sites-available
if you do the last one remember run the script a2ensite YOUR_CONFIGURATION_FILE.conf
for Apache recognize it.DocumentRoot /var/www/html/YOUR_PROJECT_NAME/web
<Directory /var/www/html/YOUR_PROJECT_NAME/web>
AllowOverride All
Require all granted
Allow from All
</Directory>
DocumentRoot: Apache will serve files located here
Directory: Group of files where we are applying Apache rules
AllowOverride All: Allow configuration from .htaccess
Require all granted: Access is allowed unconditionally.
Allow from All: All hosts can access the server.
service apache2 reload
/var/log/apache2/error.log
if something wrong happensapp/cache
and app/logs
folders must be accessed by web-server user www-data
(This is the default username, keep in mind if your web server has a different username or group name you should replace it with the corresponding name) to Symfony Applications work as expected. I highly recommended changing the default group of the project's folder to www-data
even /var/www/
to avoid relating this folder with the root usersudo chown -R :www-data /var/www
sudo usermod -a -G www-data YOUR_USER
exit
www-data
must create logs and cache folders itself.chmod 775 -R app
chmod 775 -R app/cache
chmod 775 -R app/logs
r = Read
w = Write
x = Execute
Permissions | Owner | Group | Others |
---|---|---|---|
0 | - | - | - |
1 | - | - | x |
2 | - | w | - |
3 | - | w | x |
4 | r | - | - |
5 | r | - | x |
6 | r | w | - |
7 | r | w | x |
web
folder.