403 Forbidden in Local after modification of apache2.conf - php

I modified the file etc/apache2/apache2.conf for a WordPress permalink problems, but now I can't access on my localhost.
I changed
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all denied
</Directory>
to
Options Indexes FollowSymLinks
AllowOverride FileInfo
Require all granted
After a2enwrite and reload apache2 my server doesn't work.
I work on Ubuntu 16.04 LTS. Can you help me?

Related

Laravel 8 404 api routes in production

I have never had this issue before, it was working perfectly and after I reinstalled the server I now got a 404 when I call my 0.0.0.0/api/students/show.
I did composer production call on SSH to create latest autoloader. Cleared the cache for php artisan, the normal steps to setup a Laravel production app. But I still get 404 when I call the API endpoint.
Maybe the problems is something with chmod rights? Storage, etc. is already done...
In your apache2.conf make sure you've AllowOverride All and not AllowOverride none.
Example
<Directory /var/www/html/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Original Answer
You should not need to write Directory at all.
This is my working page custom .conf file on sites-available folder:
<VirtualHost *:80>
ServerName matiaslauriti.dev
ServerAlias www.matiaslauriti.dev
Redirect 301 / https://matiaslauriti.dev
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName matiaslauriti.dev
ServerAlias www.matiaslauriti.dev
DocumentRoot /var/www/html/public
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/matiaslauriti.dev/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/matiaslauriti.dev/privkey.pem
</VirtualHost>
</IfModule>
What I do have on my apache2.conf is default, I did not change anything:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options +FollowSymLinks -Indexes
AllowOverride All
Require all granted
</Directory>

phpmyadmin giving 500 error after update the apache2.conf

I am using Linux mint. I am working in a Wordpress, It was not possible navigate a page. I got a answer from a source to change the apache2.conf file like bellow
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
to
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
But for me the phpmyadmin is not working after this change. For that problem i go for this
Adding
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
in the phpmyadmin.conf file. But still it is working. Is there are anything i have left.
Thanks in advance.

File not found localhost/phpmyadmin macos sierra 10.12.15

i have a problem with phpmyadmin installation via brew, i have modified my root directory to point to /Users/username/Sites in /usr/local/etc/apache2/2.4/httpd.conf.
I have put this in the same file :
Alias /phpmyadmin #{HOMEBREW_PREFIX}/share/phpmyadmin
<Directory #{HOMEBREW_PREFIX}/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
I use virtual host, so i create a symlink of the folder /usr/shar/phpmyadmin in /Users/username/Sites and create a phpmyadmin.conf like this:
<Directory "/Users/amerej/Sites/phpmyadmin">
Allow From All
AllowOverride All
Options +Indexes
Require all granted
</Directory>
<VirtualHost *:*>
ServerName phpmyadmin.localhost
DocumentRoot "/Users/amerej/Sites/phpmyadmin"
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9071/Users/amerej/Sites/phpmyadmin/$1
</VirtualHost>
I user follow this tutorial for using multiple versions of php :
https://lukearmstrong.github.io/2016/12/setup-apache-mysql-php-homebrew-macos-sierra/
Thank you if can help me i try to solve my problem alone but don't find the solution.

enable htaccess apcahe on ubuntu

I have an apache server on ubuntu where i have a virtual host that points to my site. Problem is my htaccess not functional.
In my apache2.conf file i have something like
<Directory />
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
if i change AllowOverride for "www" directory htaccess is functional but i get 403 forbidden error. please guide me what i am doing wrong.
regards.
You have to set AllowOverride to all like this.
<Directory "/var/www">
AllowOverride All
</Directory>
After that if you are facing forbidden error then probably you have error in htaccess file. Remove the code in htaccess file then start writing code block by block. By this you can debug error in htaccess file. For more info, you can have a look on this.
https://askubuntu.com/questions/429869/is-this-a-correct-way-to-enable-htaccess-in-apache-2-4-7-on-ubuntu-12-04#answer-429931

Xampp OS X 5.5.37 unable to remote access

I just upgrade xampp 5.5.37 for MariaDB but I cannot set up remote access to my htdocs.
in this new version, the httpd-xampp.conf, I can not find these line:
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
Please help!
Here is how I solve my issue:
find httpd.conf make change as follow:
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
# Require local # comment this out and add
Require all granted
</Directory>
find httpd-xampp.conf if you want to allow phpmyadmin, then change follow:
<Directory "/Applications/XAMPP/xamppfiles/phpmyadmin">
AllowOverride AuthConfig Limit
#Require local
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
If this does not work, meaning that the problem is router or firewall.
As i'm not an expert, I don't know this change will affect the security risk!

Categories