Score:0

Apache2 alias loading from document root instead of alias directory

cn flag

I have problem with apache2. I'm new to it and I'm trying to solve some problems. I have a server running debian with apache2.4 installed and 3 web-site running. A Shiny Server, a django website and a static website. The three sites are located differently The Static webiste is a blogdown site located at /var/www/html/mysite with an assigned alias to it mysite.com/blog/. The problem is that surf on that site i cannot load any css or I'm not able o access every subpage of this website. Instead of holding the /blog/link-to-some-page address apache2 is driving me to /link-to-some-page. Here my apache2 config file.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /srv/dev-disk-by-label-disco1/django/wrkt-site
    

    <Directory /srv/dev-disk-by-label-disco1/django/wrkt-site>
    Options FollowSymLinks
        AllowOverride All
        Order deny,allow
        Allow from all
    </Directory>
    
    Alias /static /srv/dev-disk-by-label-disco1/django/wrkt-site/static

    <Directory /srv/dev-disk-by-label-disco1/django/wrkt-site/static>
        Require all granted
    </Directory>

    <Directory /srv/dev-disk-by-label-disco1/django/wrkt-site>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>
    
            
 
WSGIDaemonProcess wrkt python-path=/srv/dev-disk-by-label-disco1/django/wrkt-site/ python-home=/srv/dev-disk-by-label-disco1/django/wrkt-site/venv
WSGIProcessGroup wrkt
WSGIScriptAlias / /srv/dev-disk-by-label-disco1/django/wrkt-site/wrkt/wsgi.py

Alias /blog "/var/www/html/mysite"
    <Directory "/var/www/html/mysite">
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    

# Proxy rules
ProxyRequests Off
ProxyPreserveHost On  
ProxyPass /stats-apps http://localhost:3333/    
ProxyPassReverse /stats-apps http://localhost:3333/

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

And here there are the errors that errors.log is giving me:

[Mon Sep 27 15:01:23.486805 2021] [wsgi:error] [pid 6689] [remote XXX.XX.XX.XXX:60541] Not Found: /css/main.css 
[Mon Sep 27 15:01:23.504880 2021] [wsgi:error] [pid 6689] [remote XXX.XX.XX.XXX:58335] Not Found: /css/fonts.css
[Mon Sep 27 15:01:23.506045 2021] [wsgi:error] [pid 6689] [remote XXX.XX.XX.XXX:56566] Not Found: /images/logo.png
    [Mon Sep 27 15:01:23.507491 2021] [wsgi:error] [pid 6689] [remote XXX.XX.XX.XXX:50814] Not Found: /images/hugo-logo.png

I'm really in trouble to solve this.

Marco

Michael Hampton avatar
cz flag
The blogdown software should have an option to generate the links correctly with the `/blog` prefix you have chosen. Check its documentation carefully.
MarkPT avatar
cn flag
@MichaelHampton going in the `config.yaml` and modifying the `baseurl` parameter solved. The problem now is that if I try to access to a post of the blog, instead of `/blog/post-01` is giving me `/blog/blog/post-01` with all links for posts incorrects
MarkPT avatar
cn flag
I searched for some help in the guide [link](https://bookdown.org/yihui/blogdown/a-quick-example.html#configure-site) but I was not able to find something that helped me.
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.