Problem With Website On VDS

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Feb 18, 2011 2:02 pm

Problem With Website On VDS

Post by {{Classic}} »

Hey guys... I'm running low on ideas, so I thought it'd be great to ask some of the pro's here at NFO.

I'm running multiple websites from a VDS, the setup is Apache/PHP5 utilizing vhosts. Right now, I have a SMF site running, a few E107 sites (good old CMS packages ;) ) Those sites run fine. They have been backed up from GoDaddy, and moved over to hosting on the VDS. The sites all worked fine on GoDaddy.

All the sites are transferred and working just fine, except for one...

This site I'm trying to put back up relies on mod_rewrite and I'm not good at this... but I think the problem may be in the mod_rewrite... or perhaps the PHP configuration... if I knew, I wouldn't be coming here now would I? ;p

So here's the deal... the site will not load from other PHP files contained within the index.php. The page partially loads, but pretty much just the background colors and html stuff. When I click on a link, such as login, I end up at this page...

Forbidden

You don't have permission to access /< on this server.

The URL it directs me to is http://(my_domain.com)%3C?=LOGIN_URL.%28MOD_REWRITE?%27account/login%27:%27account.php?action=login%27%29?%3E

So the question is, what is different on GoDaddy hosting, where this website worked fine, and hosting it myself, where all I get are broken links, parts of an unloaded page, and bad URL's that take me to a non-existent directory I do not have access to?

Hopefully someone knows what is up, or has seen this before and can point me in the right direction, or can even just throw some random ideas at me... cause after working on this for a few hours, I just really do not know what else to try.

Thanks ;)
IcEWoLF
This is my homepage
This is my homepage
Posts: 1192
Joined: Thu Aug 10, 2006 9:41 pm
Contact:

Re: Problem With Website On VDS

Post by IcEWoLF »

Did you use to use any control panels with GoDaddy such as cPanel?
Sometimes this can be an issue when moving from cPanel to no control panel servers.

Also I'd suggest checking out this thread: http://www.webhostingtalk.com/showthread.php?t=943469

Also check this post: http://tech.gaeatimes.com/index.php/arc ... -solution/
Image
Image
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Problem With Website On VDS

Post by {{Classic}} »

Thanks IcEWoLF for the resources. Strange thing, when I'm trying to run the debug, I get a 500 Server Internal Error. I tried adding the debug lines in the the configuration for apache, vhost, and in the .htaccess file, but no matter where I put it, it causes the page to error and in the log states: "RewriteLog not allowed here" I must be doing that wrong... I gotta read a bit more on it.

While I was roaming through the log though, I noticed something interesting... I see a lot of errors with: (20024)The given path is misformatted or contained invalid characters: Cannot map GET /%3C?=LOGIN_URL?%3E HTTP/1.1 to file I'm really not big on troubleshooting Apache, and this is going to take me awhile to fix yet probably, but would this error be caused by the mod_rewrite?

Thanks ^-^
User avatar
Edge100x
Founder
Founder
Posts: 12961
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Problem With Website On VDS

Post by Edge100x »

If it says "RewriteLog not allowed here", that indicates that mod_rewrite is not enabled. Check to make sure that you have a LoadModule line for it in /etc/apache2/httpd.conf (or the equivalent file for your distribution) and that you have AllowOverride set to "All" for "<Directory />" in /etc/apache2/modules.d/00_default_settings.conf (or the equivalent file for your distribution).
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Problem With Website On VDS

Post by {{Classic}} »

Alright, got the rewrite logging working... it kept stopping at /< tho, instead of using the full string. Did I mention I'm on a Windows VDS? Probably why I'm having so many issues. I'm pretty sure my setup is good, but if anything, it's just Windows being dumb. ;p

It seems that this may be an issue with PHP, and not the mod_rewrite.
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Problem With Website On VDS

Post by {{Classic}} »

Ahh, it was in the PHP settings.

So I went over to #PHP on the Rizon network, and asked over there. Nate, in the channel, pointed out that it was either "no PHP installed or short_tags"...

Turns out, the bit of PHP I'm using, was done in "lazy-mode" ;p

So with a tweak of PHP.ini, and changing short_open_tag = Off to short_open_tag = On, problem solved... the page works properly now. ;) Although, I'll probably have to go change the code, since the short tags are really not recommended, and I hear may be removed in PHP6.

Thanks for your help IcEWoLF and Edge100x \o/
User avatar
Edge100x
Founder
Founder
Posts: 12961
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Problem With Website On VDS

Post by Edge100x »

I'm glad you were able to find a fix :). We had to flip the same switch for our webserver configs, since PHP 5.4 defaults it to "off".

Short tags are convenient and useful, so I hope they leave them in. PHP is all about laziness and convenience.
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Problem With Website On VDS

Post by {{Classic}} »

Y'know, my only other problem, is trying to figure out why changing the default settings on apache is not working...

<Directory />
Options FollowSymLinks -Indexes
AllowOverride All
Order deny,allow
Deny from all
</Directory>


My default settings. Yet, it will not read .htacess files. When I add a <Directory> listing and put the mod_rewrites in there, for defined directories, it works fine... but it seems AllowOverride All for the default settings is not doing anything... I have to be missing something.
{{Classic}}
A semi-regular
A semi-regular
Posts: 26
Joined: Fri Feb 18, 2011 2:02 pm

Re: Problem With Website On VDS

Post by {{Classic}} »

Meh... whatever... it's working.

Perhaps I am just not understanding how Apache works exactly. I thought that the default settings is how it would work, when no <Directory> entries were added, since the document root is already specified in the vhost.config... but maybe that's just how I figure it works, and you need a <Directory> listing for 'everything' you wish to do anything special with.

So anyways, I just added the <Directory> with AllowOverride All and it seems to pull from the .htaccess now just fine. ;)

Ok, it works, hurray... I'm done with it now. hah
Post Reply