How to resolve 403 Forbidden on Symfony website - symfony

I just started a project and when I try to access the website I get this error:
Forbidden
You don't have permission to access this resource.
Here's the config of my website:
<VirtualHost *:80>
ServerName portfolio.lxc
ServerAdmin webmaster#localhost
DocumentRoot /var/www/portfolio/public
<Directory /var/www/portfolio/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I enabled my website like this
a2ensite portfolio
systemctl reload apache2
And then this error. When I looked on the Internet, it was said to allow "Options FollowSymLinks" but it's already allowed on my conf. I tried
chmod -R 777 /var/www/portfolio/
But I still get this error.

Related

Migrate rules from apache to nginx

I have to migrate an Apache configuration file to Nginx but as I have no experience in Nginx I would like some help.
This is my apache setup:
000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster#localhost
<Directory /var/www/ff>
AllowOverride All
Options -Indexes
</Directory>
DocumentRoot /var/www
RedirectMatch ^/$ /ff/
Alias "/uploads" "/var/www/ff/uploads/"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I’m a little lost as using the parameter RedirectMatch in nginx, I guess it has another name
help me create a configuration file for nginx?
Regards,

Apache2 shows default page even after disabling it

I've moved a wordpress site to an Ubuntu Server. While I access it from localhost everything works fine but when I try from my public IP address I can only see the apache2 default page.
I tried everything:
Disabled 000-default.conf and enabled mine
Deleted the default HTML page
Added AllowOverride All
Here there's my Virtual Host file
<VirtualHost *:80>
<Directory "/var/www/exidis">
AllowOverride All
</Directory>
ServerName alternanza.duckdns.org
ServerAlias www.alternanza.duckdns.org
DocumentRoot /var/www/exidis
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Thanks in advance for any suggestion

DNS error - host not found after enabling site

I get the below error when I try and setup by wordpress site on Apache, beta.xxx.co.uk. Any ideas? I am expecting to see the wordpress setup wizard but just get an error.
I have:
setup my A record in my DNS under my domain (beta).
created my conf file under sites-available
sudo a2ensite beta.xxxx.co.uk.conf
​sudo service apache2 restart
Conf file:
<VirtualHost *:80>
ServerName beta.xxx.co.uk
DocumentRoot /var/www/beta.xxx.co.uk
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/beta.xxx.co.uk/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Host Not Found
DNS error (the host name of the page you are looking for does not exist) or Server did not accept the connection.
Please check that the host name has been spelled correctly.
all I could find is:
<Directory /var/www/beta.xxx.co.uk/>
should propably be:
<Directory /var/www/beta.xxx.co.uk>
Port 80 & 443 is open?
Regards Tom

Why does localhost work but my alias does not?

I currently have this apache2 site configuration:
<VirtualHost *:80>
ServerAdmin admin#example.com
ServerName engine.com
ServerAlias www.engine.com
DocumentRoot /var/www/engine.com/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
If I type engine.com I just get a blank page.
My directory setup is like this
/var/www/engine.com/public_html/wp-content...
Localhost works fine and wordpress installation is triggered, but as I say engine.com just brings me a blank page.
Don't you need to add
engine.com 127.0.0.1
to your hosts file?

Symfony2 project with VirtualHost doesn't work

I'm working on a Symfony2 project (using latest 2.3.2) and for that I made this virtual host:
<VirtualHost *:80>
DocumentRoot /var/www/html/nnplat/web
ServerName nnplat.devserver
<Directory /var/www/html/nnplat/web>
AllowOverride all
Allow from all
</Directory>
ErrorLog logs/nnplat-error_log
CustomLog logs/nnplat-access_log common
</VirtualHost>
If I call http://nnplat.devserver I got this error:
Oops! An Error Occurred The server returned a "404 Not Found".
Something is broken. Please e-mail us at [email] and let us know what
you were doing when this error occurred. We will fix it as soon as
possible. Sorry for any inconvenience caused.
But if I call this URL http://devserver/nnplat/web/app_dev.php it works, where is the problem? I can't find what is wrong in my VH
try this
ServerName nnplat.devserver
<VirtualHost *:80>
DocumentRoot /var/www/html/nnplat/web
<Directory "/var/www/html/nnplat/web">
DirectoryIndex app_dev.php
Options -Indexes FollowSymLinks SymLinksifOwnerMatch
AllowOverride All
Allow from All
</Directory>
</VirtualHost>

Resources