Home > database >  https apache2 not working on only one virtul host
https apache2 not working on only one virtul host

Time:09-27

I have a virtual machine I am trying to install WordPress on it as a virtual host. the vm has other virtual hosts which are working fine and redirecting fine to (http and https) my server uses SSL from a certificate authority, the SSL is configured for the entire directory that host all the virtual hosts "www". My WordPress website (wpsite.com) doesn't work on HTTPS (https://wpsite.com) it gives 404 not fould.and only work on HTTP (http://wpsite.com) I can edit and view the home normally, I checked directory permissions, sites available,sites available config and rebooted apache, and I cant find the issue. here is my wpsite.conf on apache2 and 10.11.11.11 is the vm ip

<VirtualHost 10.11.11.11:80>

    ServerAdmin [email protected]
    DocumentRoot /srv/www/wpsite
    ServerName wpsite.com

    Redirect permanent / https://wpsite.com/

    <Directory /srv/www/wpsite/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

    LogLevel warn
    ErrorLog ${APACHE_LOG_DIR}/wpsite_error.log
    CustomLog ${APACHE_LOG_DIR}/wpsite_access.log combined
I tried to remove the (Redirect permanent / https://wpsite.com/) but I couldnt get it to work.

What am I missing here?

CodePudding user response:

I figured out what was wrong in my setup. I am not using the default path to store my website, so I had to change that on apache2.conf in that section ...

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /srv/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

Now everything works fine

  • Related