Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Problems enabling and disabling Apache web-sites

Got problems with your B2 or B3? Share and get helped!
Post Reply
daggett
Posts: 6
Joined: 20 Jan 2011, 01:26

Problems enabling and disabling Apache web-sites

Post by daggett »

(The following maybe belongs in part on a Drupal, Mysql or Apache forum.)

(BTW, thanks, again, RandomUserName for his helpful response elsewhere.)

I am attempting to set up a testbed content-managed Drupal webserver on my B3 to work alongside3 the Bubba web-site there.

When I had difficulty configuring Apache, Mysql and Drupal, I tried to temporarily disable the Bubba web-site with the command:
# a2dissite Bubba
... which (as Apache administrators will know) has the effect of removing the Unix link to /etc/apache2/sites-available/Bubba at /etc/apache2/sites-enabled/Bubba .

This should have left my own test-bed web-site (adapted from the Bubba configuration) as the only enabled web-site. This had been previous enabled with the comand:
# a2ensite realnews
... which (as Apache administrators will know) has the effect of creating the link to /etc/apache2/sites-available/realnews at /etc/apache2/sites-enabled/realnews

The file, realnews, did not as far as I could tell, refer to any part of the Bubba web site (located in /home/web). Instead the confgiuration file referred to /home/realnews/cms as the root file directory of that site.

Yet, when I entered the URL for the B3, http://192.168.0.2 (I only could use the IP address of 192.168.0.3 , because I seem to have lost the name of b3 or b3.local, but that's another story.) I still get the Bubba web pages in full.

Even when I also disabled 'realnews' so that there were no sites enabled, my B3 still serves Bubba pages when I enter the URL http://192.168.0.3 .

Can anyone suggest why the Apache web-server will give me the Bubba pages when there is no site 'enabled', as far as I can tell, which includes the Bubba pages?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Problems enabling and disabling Apache web-sites

Post by Ubi »

did you try

Code: Select all

apache2ctl  -St
?
(I guess you did try to restart apache)
daggett
Posts: 6
Joined: 20 Jan 2011, 01:26

Re: Problems enabling and disabling Apache web-sites

Post by daggett »

Yes, thanks Ubi. I did try restarting apache (/etc/init.d/apache2 restart) as well as merely reloading (/etc/init.d/apache2 reload), but the problem still remained.

I worked out what was going on by looking at the log files. It turns out that the information I needed was in /var/log/apache2/other_vhosts_access.log .

From looking at that I was able to work out that what I assumed was a site, which I thought should have been defined in:

Code: Select all

/etc/apache2/sites-enabled/
... was, in fact, defined by the file:

Code: Select all

/usr/share/bubba-frontend/apache.conf
... which was linked to by

Code: Select all

/etc/apache2/conf.d/admin.conf
The above link is, of course, read into the apache2 webserver at startup time by the following statement in /etc/apache2/apache2.conf:

Code: Select all

Include conf.d/
The underlying problem, I guess, was my far from comprehensive understanding of how Apache works.
danjex
Posts: 2
Joined: 13 Apr 2011, 14:08

Re: Problems enabling and disabling Apache web-sites

Post by danjex »

I'm having the same problem. When I try to access the web server from inside the LAN I'm getting sent to the admin-page via the redirect in /home/web/index.html. But when I access from outside of the LAN I get sent to the path set in the site-available link.

Daggett, did you solve it? I tried to remove every line in apache.conf but I was still sent to /home/web and I still don't understand why I was sent there.

Thanks
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Problems enabling and disabling Apache web-sites

Post by Ubi »

because the config you're looking for is not in apache.conf but in sites-enabled, as mentioned in this thread .

what's your output of apache2ctl -St?
danjex
Posts: 2
Joined: 13 Apr 2011, 14:08

Re: Problems enabling and disabling Apache web-sites

Post by danjex »

apache2ct -St returns this:

Code: Select all

bubba:/home/web/forum# apache2ctl -St
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server localhost.localdomain (/etc/apache2/sites-enabled/bubba:1)
         port 80 namevhost localhost.localdomain (/etc/apache2/sites-enabled/bubba:1)
Syntax OK
The configuration in sites-enabled was the one I expected to kick in, and the DocumentRoot there is set to /home/web/forum. That is also the destination I'm sent to when I connect from outside of my LAN.
Post Reply