1

I have a bit of an issue that I am very stumped on. I have a webpage on a CentOS 7 server running Apache. This page is on a virtual host file so that when ever I browse to htp://servername or IP I get my website.

The issue I am having is that one section of CSS is not loading properly. If I remove the site from the virtualhost file and browse to the site directory via htp://server/website/index.html everything loads perfect.

I thought It might have been a selinux issue but it isnt, and I know the code is not wrong as it loads great without the virtual host file. Below is my vhost file in my http.conf file as of right now. As you can see I have been playing around with it right now, so this file is wrong. The page loads but the very top css bar does not load at all. Just some white space with unstyled page links.

#NameVirtualHost *:80
<VirtualHost *:80>
#     AllowOverride All
     DocumentRoot /var/www/html/gemini.com/
    <Directory "/var/www/html/gemini.com">
        Options Includes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
     ServerName 192.168.0.100
     ServerName gemini.com
#     ErrorLog /var/www/html/Landing/error.log
#     CustomLog /var/www/html/Landing/requests.log
</VirtualHost>

Checking the httpd error_log I see a lot of this error.

[Mon Nov 10 09:00:20.828462 2014] [authz_core:debug] [pid 4421] mod_authz_core.c(802): [client 192.168.0.30:9237] AH01626: authorization result of Require all Granted: granted, referer: http://192.168.0.100/css/one-page-wonder.css

My area in the index.html that loads the css menu

<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="css/one-page-wonder.css" rel="stylesheet">
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Project Gemini</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    <a href="#about">Confluence</a>
                </li>
                <li>
                    <a href="#services">GLPI</a>
                </li>
                <li>
                    <a href="#contact">OCSng</a>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

The fist image is what displays when the virtualhost is set and the second is when virtualhost is disabled

![1]: https://i.stack.imgur.com/EaYcj.png ![2]: https://i.stack.imgur.com/EaYcj.png#1

Anyone have any ideas, Im a little stumped on this. And thank you in advance

Celerium
  • 11
  • 2
  • What's actually returned in your browser if you just try to open the CSS file directly? – Evan Anderson Nov 10 '14 at 16:30
  • If i browse to the css file directly I can see the css file – Celerium Nov 10 '14 at 16:32
  • It sounds like Apache is doing the right thing, then. – Evan Anderson Nov 10 '14 at 16:36
  • Ya Apache works great but I feel like its something with the virtualhost file, since whenever its set the css menu at the top doesn't load. I added some pictures to show what it does – Celerium Nov 10 '14 at 16:38
  • 1
    If the browser can retrieve the CSS file at the path where the HTML is expecting it with the virtualhost setting enabled then Apache isn't your problem. I'd be jumping into my "Developer Tools" in the browser and tracing thru the network activity during the page load. – Evan Anderson Nov 10 '14 at 16:40

0 Answers0