Score:0

Why server shows default Apache page instead of my app?

il flag

I setup Php+Mysql app on my Ec2 instance but when I reach domain,Apache default page is shown. Bookstack is my app. tail log

172.68.50.230 - - [21/Apr/2022:05:26:52 +0000] "GET / HTTP/1.1" 304 2539 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36"

My default.conf output cat 000-default.conf

<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLCertificateFile /etc/apache2/certs/pizd.pem
    SSLCertificateKeyFile /etc/apache2/certs/pizd.key
</VirtualHost>

My bookstack.conf

<VirtualHost *:80>
    ServerName bookstack

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/bookstack/public/

    <Directory /var/www/bookstack/public/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        <IfModule mod_rewrite.c>
            <IfModule mod_negotiation.c>
                Options -MultiViews -Indexes
            </IfModule>

            RewriteEngine On

            # Handle Authorization Header
            RewriteCond %{HTTP:Authorization} .
            RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

            # Redirect Trailing Slashes If Not A Folder...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_URI} (.+)/$
            RewriteRule ^ %1 [L,R=301]

            # Handle Front Controller...
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^ index.php [L]
        </IfModule>
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

I checked this

sudo ls -l /etc/apache2/sites-enabled/
total 4
-rw-r--r-- 1 root root 338 Apr 20 14:20 000-default.conf
lrwxrwxrwx 1 root root  33 Apr 18 09:38 bookstack.conf -> ../sites-available/bookstack.conf

What should I try?

paladin avatar
id flag
Are you sure your `000-default.conf` is not causing any problems?
MarkoGM avatar
il flag
@paladin I do not know,I just added the content.
paladin avatar
id flag
I suggest to you to know more about it.
in flag
Please add the content of bookstack.conf as well.
MarkoGM avatar
il flag
@GeraldSchneider Just added.
in flag
Are you trying to reach your server via HTTP or HTTPS?
MarkoGM avatar
il flag
https,( Record on my company's Cloudflare)
in flag
Then you need to add a VirtualHost for that Server with Port 443.
Score:0
jp flag

First, check if the apache ssl-module is enabled yet with: sudo a2enmod ssl.

Then add the following lines into your 000-default.conf right after the DocumentRoot part:

<Directory /var/www/html/bookstack/public/>
Options FollowSymlinks
AllowOverride All
Require all granted</Directory>
MarkoGM avatar
il flag
Module ssl already enabled.
Dominolias avatar
jp flag
Have your restarted your apache2? Try `sudo systemctl restart apache2`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.