Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Apache2 websites subfolders getting a 404 error

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
anca
Posts: 3
Joined: 2018-10-07 16:47

[Solved] Apache2 websites subfolders getting a 404 error

#1 Post by anca »

Hello,
I m running a raspberry using raspbian with a apache2 webserver. I have 2 websites on this server and i can access the main directory of both websites (with index.html). i have used certbot for ssl and i m redirecting all trafic to 443. So far everything was great but then i created a sub folder on one of my webiste so i can build a php forum from scratch to learn php and mysql with mariadb. And i m getting a 404 error. I have checked the permission and to be sure it was fine :

Code: Select all

sudo chgrp www-data /var/www
Here is the conf for one of my website :

Code: Select all

<VirtualHost *:80>

    ServerName example.com
    ServerAlias www.example.com

    RewriteEngine on
    RewriteCond %{HTTPS} !on
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

<VirtualHost *:443>

    ServerName example.com
    ServerAlias www.example.com

    DocumentRoot /var/www/example.com

    <Directory /var/www/example.com>
        Options -Indexes
        AllowOverride all
        Order allow,deny
        allow from all
    </Directory>

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/www.example.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/www.example.com/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/www.example.com/chain.pem
    SSLProtocol all -SSLv2 -SSLv3
    SSLHonorCipherOrder on
    SSLCompression off
    SSLOptions +StrictRequire
    SSLCipherSuite *********************************************************************
    Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

    LogLevel warn
    ErrorLog ${APACHE_LOG_DIR}/www.example.com-error.log
    CustomLog ${APACHE_LOG_DIR}/www.example.com-access.log combined

</VirtualHost>
i have tryed everything but the right thing (obviously) and it s time to ask for help if anyone have time for it. English is not my native language but i will try my best to understand what you re saying and i will provide any informations that will help you to help me ;)
Hope we ll fix this
thanks for reading me

ps: last raspbian based on debian 9, update & upgrade done)
Last edited by anca on 2018-10-14 04:53, edited 1 time in total.

kopper
Posts: 138
Joined: 2016-09-30 14:30

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#2 Post by kopper »

You'll get better support at Rasbian forums.

Rasbian is not Debian.
Debian 10.2 Stable with i3
Secure your stuff: Securing Debian Manual
Don't break your stuff: Source List Management DontBreakDebian

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#3 Post by dilberts_left_nut »

What do your logs tell you?
AdrianTM wrote:There's no hacker in my grandma...

User avatar
anca
Posts: 3
Joined: 2018-10-07 16:47

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#4 Post by anca »

kopper wrote:You'll get better support at Rasbian forums.

Rasbian is not Debian.
Hello,
Raspbian is a debian build no?


dilberts_left_nut wrote:What do your logs tell you?
Hello,
Here the log i just get with tail @ /var/log/apache2/access.log

Code: Select all

 - - [09/Oct/2018:09:31:26 +0000] "GET /forum/index.php HTTP/1.1" 404 690 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0"

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#5 Post by GarryRicketson »

Hello,
Raspbian is a debian build no?
No it isn't . Here is a list of all the Debian releases:
https://www.debian.org/releases/

No "raspian" listed. I think you are confused, they (the developers at Raspbian )might have used a Debian base, to build another Distribution, and named it Raspbien, but once the base has been modified , it is no longer a Debian release, it is a release (distro) built and produced by others , so that is why you should be asking them, they know what changes have been made, etc.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#6 Post by dilberts_left_nut »

404 means 'not found' for %webroot%/forum/index.php
AdrianTM wrote:There's no hacker in my grandma...

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#7 Post by debiman »

anca wrote:Here the log i just get with tail @ /var/log/apache2/access.log
this is not a valid unix command.
please be precise.
and why only one line? tail defaults to 10 iirc.
anyhow, with this little information the most likely explanation is still a permission issue (since you say the files are where they're supposed to be).

User avatar
anca
Posts: 3
Joined: 2018-10-07 16:47

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#8 Post by anca »

Hey thanks for the support, much appreciated.


I have two websites on my raspberry: website1 with sub directory not working and the reason i asked for help here.
i don t like being stuck and waiting for help so i keep looking and i checked the website2 and sub directory were fine...
I m sorry i didn t check that website before asking for help and i m sorry i wasted your time.

It was indeed a permission issue
Since sub directory and files was there it had to be a file.conf issue (imo)
website1 had two conf file @ /etc/apache2/sites-enabled : website1.conf and website1-le-ssl.conf
when website2 had only one (website2.conf) so i commented website1-le-ssl.conf
then i

Code: Select all

apache2ctl configtest
, got an ok, restarted apache et voila :)

i wonder where this website1-le-ssl.conf come from

Again thanks

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: [raspbian] Apache2 websites subfolders getting a 404 err

#9 Post by kedaha »

anca wrote: i wonder where this website1-le-ssl.conf come from
It comes from running letsencrypt
if it is not enabled and configured then you won't get https
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: [Solved] Apache2 websites subfolders getting a 404 error

#10 Post by debiman »

this is the first time i see proof (other than on my own system) that letsencrypt is messing with people's servers.

all that security talk, and then you're expected to just run some unknown python script with root privileges, that you KNOW messes around at the very heart of your server, every 3 months...
:roll:

Post Reply