Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Bootstrap 3.0 not working with Apache 2.4?

I just installed Centos 7.0 which comes with Apache 2.4. My bootstrap applications are not rendering properly. To be specific, the bootstrap components are not rendering correctly. For example, on button with class=btn-primary, where the color is blue and the text is white, the text gets rendered black with Apache 2.4. There are many other issues.

My question is has anyone else had this problem? Is there a work-around such as a backwards-compatibility flag for html tags? I Googled and could not find any other references.

Thanks for sharing any findings you may have.

like image 897
Doug Wolfgram Avatar asked Aug 07 '14 16:08

Doug Wolfgram


People also ask

Why my Bootstrap is not working?

These are the possible reasons: You have a wrong or incorrect link to the bootstrap file. browser caching and history is messing with your html. Other CSS files are overriding the bootstrap file.

How do I know if Bootstrap is working?

We can check Bootstrap-specific method is available or not. Syntax: var bootstrap = (typeof $(). "Bootstrap-specific method" == 'function');

How to install Bootstrap locally?

Another way of importing Bootstrap to HTML is to directly download the files locally to your HTML project folder. The files can be downloaded from the following links: Bootstrap 4: https://getbootstrap.com/docs/4.3/getting-started/download/ Bootstrap 5: https://v5.getbootstrap.com/docs/5.0/getting-started/download/


2 Answers

We had the same problem. It took us 5-6hrs to debug. It was an alias mapping bootstrap.css in the welcome.conf in /etc/httpd/conf.d/ directory

Alias /.noindex.html /usr/share/httpd/noindex/index.html
Alias /css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
Alias /css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png

Just remove/comment out all the /css/ lines or disable to the welcome.conf. I don't know whether this comes with just CentOS or httpd package. It was a stupid thing to do.

Same thing happened to us with /error/ alias as well.

like image 95
adinindu Avatar answered Sep 19 '22 00:09

adinindu


I found the problem. The bootstrap.min.css file is not compatible with APache 2.4. I have no idea why but when I switched to the non-minified version, everything worked properly.

like image 43
Doug Wolfgram Avatar answered Sep 17 '22 00:09

Doug Wolfgram