Page: Previous  1, 2, 3, 4

techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
I told you you would laugh when you figured it out. That's why you shouldn't reinstall to solve this type of issue.

I forgot to mention that one thing I had to do was change the sites-enabled to site.conf in the directory.

I'm actually happy you posted this thread, I'd been putting off fully updating my apache2 working configs on my local dev server, having used the old method for a few years, but now my stuff is all current and correct as well, like yours.

I was actually going to ask you if you'd done that, make the sites-enabled by *.conf but I forgot to mention it.

By the way, this is exactly how you learn to run apache, by running it and solving/debugging issues as you encounter them.

After years though it's hard, I think I started on apache 1.3, went to 2.0, or 2.1, then 2.2, now 2.4, and the configs/syntax change a bit with each release, it's a bit confusing to track the syntax when you are used to older versions, or small changes etc, but I have to say, on 2.4, the debugger output was spot on and really helped solve the problems in my case.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
All's well that ends well.
I have to do some more testing though.
My namevhost is not 127.0.0.1, but what I got from the Debian installer when I joined this computer to a domain.
No problem there, except that I don't have to use 127.0.0.1 as in your setup.
So now the first line in my dumbsite.conf reads:
:: Code ::
<VirtualHost papimalo:80>

because that is the namevhost I get from apache2ctl -S.
Probably VirtualHost *:80 would work too, but I have not tested yet.
Also, I added dumbsite to the second line in my /etc/hosts because that is where papimalo is.
So my virtual hosting is no longer on 127.0.0.1 but on 127.0.1.1, it works, so who cares?
As long as all the pieces of the puzzle are in the right place it will work.
Will shuffle them around a bit more until I am clear on how everything is supposed to work.
BTW apache2ctl -t shows Syntax OK, no more errors, but I think that this is due to restarting apache correctly from /etc/init.d, there is some documentation I got with the install about that, so I RTFM.
One thing I would like to have, before making those tests and definitely calling the issue solved is the output of your apache2ctl -S so I can compare configs.
My first cup of coffee is waiting, so chau.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Did a few tests on a test machine and I can confirm that the above mentioned procedure is correct.
So I will summarize it, this is for Debian (or derivatives) users.
On the newest apache2, sites in sites-available must have the .conf extension to be enabled.
Also, apache2ctl -S (as root) will tell what your namevhost is, sites must be added to the line in /etc/hosts where that vhost is, in my case it is 127.0.1.1, but it could be something else, depending on how your machine is configured.
The first line in your "sitename.conf" should read "<VirtualHost namevhost:80>", of course replacing namevhost with whatever name your vhost has.
Then run as root a2ensite sitename.conf.
Debian recommends to run the helpers because those have additional troubleshooting capabilities, i.e. they show errors.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
Back to the basics.
I got stumped because I wanted to enable virtual hosting for Drupal, I need to do a lot of testing on that huge and extremely powerful CMS.
But alas!, my previous instructions were not working.
So before crying in desperation to techadmin I decided to read all he wrote, earlier on this same post you can find:

:: Quote ::
Since you have allowoverride all switched on, any .htaccess file will override anything in your apache config


So I changed from my previous dumbsite example, which was working fine to:

AllowOverride none

saved, restarted apache (service apache2 reload as root)and the 505 internal server error disappeared.

Morale: Some of these CMSs require that you set AllowOverride to all but others abhor it.
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
I don't agree with your conclusion, in fact, what it means is that your .htaccess file had errors in it that triggered a 505 error, that is the error you get with apache server configuration errors.

There's a few small differences between the syntax for .htaccess files and for the direct apache configuration, mainly in file paths.

It's not drupal giving you 505 errors, it's apache, drupal was not involved at all unless it included an .htaccess file that was examplified and which you did not update with the real server configuration.
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
:: techAdmin wrote ::
I don't agree with your conclusion...

Hola h2, and thanks for the enlightenment.
I did some more research and found out what really happened.
My ISP needs a couple lines in the .htaccess to load PHP 5.3, they default to 5.2.
So I modified .htaccess locally, uploaded and it worked.
I also installed in local server for testing purposes, without realizing that I was installing a modified .htaccess, which was loading my ISP's requirements.
After reading your post, I commented out those lines, went back to the original dumbsite example and it also worked.
My local server packs PHP 5.5.*, Drupal works great on any of those versions.
Thanks again for clarifying, you the man.
Back to top
alexandre
Status: New User - Welcome
Joined: 29 May 2014
Posts: 1
Reply Quote
:: techAdmin wrote ::
If nothing else works, do this:
service apache2 stop
apache2ctl stop
source /etc/apache2/envvars && apache2 -k restart

Better, as root:
:: Code ::
source /etc/apache2/envvars && apache2ctl restart

Because apache2 -k restart can don't show errors.

Ref.: [new user link]
Back to top
ckosloff
Status: Contributor
Joined: 21 Dec 2011
Posts: 292
Location: South Florida
Reply Quote
I think this was caused by the new syntax in apache, you have to add .conf in the name of the file, at the end example.com.conf
Back to top
Display posts from previous:   
Page: Previous  1, 2, 3, 4
All times are GMT - 8 Hours