Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-05 07:27:06

dariusdr
New Member
Registered: 2007-12-05
Posts: 7

URL still needs "localhost" to browse files despite "It Works" msg

Hi everyone,

First of all, my apologies if this question has already been posted before.. I spent some time searching this forum (changing my keywords along the way) but didn’t find anything similar to the problem I’m having. So, here it goes…

I’m using the “Textpattern Solutions” book by Kevin Potts, et. al. (great resource, btw) and I was pretty much successful with my setup until…

After getting the “It Works!” message by typing “http://example.dev” in my browser, I was unable to load the textpattern setup page after I typed in “http://example.dev/textpattern/” (404 error).

I changed the URL to “http://localhost/example.dev/textpattern/” and I was able to access it, but still, I want to work in the way it’s described in the book.

Also, I looked up my problem in the FAQ page of this site, and saw this:

“404 error unless I use index.php” (http://textpattern.com/faq/104/404-error-unless-i-use-indexphp)

…but it only talked about a problem similar to the one I’m having, not exactly the same. However, I still did what was suggested there (uncomment the “#DirectoryIndex…” line in the .htaccess file of example.dev); still, it didn’t work. I still need to add “localhost” to the URL in the browser for me to access the setup page of Textpattern.

What should I do? Thanks in advance for any help. :-)

dr.darius.dr@gmail.com

(I’m using PHP 5.2.3, MySQL 5.0.37, and Apache 2.2.4 running on Windows XP Professional SP2. I didn’t have to install XAMMP as I’ve been using PHP for some time now.)

Offline

#2 2007-12-06 05:14:08

dariusdr
New Member
Registered: 2007-12-05
Posts: 7

Re: URL still needs "localhost" to browse files despite "It Works" msg

I’ve installed txp on my web server and this problem didn’t pop up. I guess I won’t have to worry myself about this minute problem (my local server setup is working quite well except for the need to append “localhost” in the URL).

Thanks txp team! :)

Offline

#3 2007-12-06 05:29:16

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: URL still needs "localhost" to browse files despite "It Works" msg

dariusdr

After getting the “It Works!” message by typing “http://example.dev” in my browser, I was unable to load the textpattern setup page after I typed in “http://example.dev/textpattern/” (404 error).

The “It Works!” message is the standard Apache welcome message after a default install. It just means that Apache is running ok — it doesn’t mean that your textpattern install went ok. What happens if you point your browser at http://localhost? Do you just get the “It works!” message or do you get a message from textpattern about where to navigate to in order to set it up?

You might have missed copying the .htaccess file over.


Steve

Offline

#4 2007-12-06 05:35:43

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: URL still needs "localhost" to browse files despite "It Works" msg

It sounds like you didn’t modify your hosts file.

Offline

#5 2007-12-06 07:18:08

dariusdr
New Member
Registered: 2007-12-05
Posts: 7

Re: URL still needs "localhost" to browse files despite "It Works" msg

@netcarver

Thanks. You’re right, the “It Works!” message is a standard Apache message after a successful installation. Interestingly, it’s also the same message I got when I typed in “http://localhost/” in the URL field. No message from textpattern at all.

And I also checked the example.dev folder, the .htaccess file is there.

@Mary

Thanks. I checked the hosts file again in my Windows directory to see if I was able to save the changes I made previously. Apparently, I did, because the line reads:

127.0.0.1 localhost example.dev

I also checked the httpd-vhosts.conf file inside Apache. Again, I think I made the necessary changes:

NameVirtualHost localhost:80

<VirtualHost localhost>
ServerName localhost
DocumentRoot “D:/Apache Software Foundation/Apache2.2/htdocs”
</VirtualHost>

<VirtualHost example.dev>
ServerName example.dev
DocumentRoot “D:/Apache Software Foundation/Apache2.2/htdocs/example.dev”
</VirtualHost>

In the httpd.conf file, I also enabled mod_rewrite by removing the hash (#) in front of:

LoadModule rewrite_module modules/mod_rewrite.so

What could be the problem here? Please help me. Thanks!

Offline

#6 2007-12-06 09:41:21

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: URL still needs "localhost" to browse files despite "It Works" msg

dariusdr

Your VirstualHost setup doesn’t look right to me.

Try…

NameVirtualHost *
<VirtualHost *>
        ServerName localhost
        DocumentRoot “D:/Apache Software Foundation/Apache2.2/htdocs”
</VirtualHost>
<VirtualHost *>
        ServerName example.dev
        DocumentRoot "D:...your txp root path here..."
</VirtualHost>

You’ll then need to restart apache. On *nix (Edit: Ubuntu Linux) you can do … sudo apache2 -k restart, don’t know about Windows, presumably there’s some kind of control panel applet.

(The above assumes you setup Apache to listen on 127.0.0.1:80 somewhere in httpd.conf.)

Last edited by net-carver (2007-12-06 09:55:23)


Steve

Offline

#7 2007-12-06 10:14:37

dariusdr
New Member
Registered: 2007-12-05
Posts: 7

Re: URL still needs "localhost" to browse files despite "It Works" msg

Thanks net-carver. Hmm… I was actually following the setup instructions in the “Textpattern Solutions” book, and one of the instructions was to rename the textpattern folder (“textpattern-4.0.5”) to “example.dev” and place it inside the htdocs folder (see book on page 32). So what you saw as the “example.dev” folder inside htdocs was actually the “textpattern-4.0.5” folder (obtained after unzipping the downloadable “installer”).

(In the book, the document root for example.dev is set to “C:/Program Files/xampp/htdocs/example.dev”. But since I didn’t use the XAMPP installer, I just modified the path to point to where my htdocs folder was located.)

Thanks man! Thanks for the time and brain cells you’re spending to solve my problem. I sure would like to buy you a drink if I could… :)

Offline

#8 2007-12-06 10:37:52

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: URL still needs "localhost" to browse files despite "It Works" msg

dariusdr

You did restart Apache after the changes you outlined above right?


Steve

Offline

#9 2007-12-06 10:42:11

dariusdr
New Member
Registered: 2007-12-05
Posts: 7

Re: URL still needs "localhost" to browse files despite "It Works" msg

Yup!

Actually, I started it again just now, crossing my fingers that it would work this time. It didn’t. (Ironically, I’m still getting the “It Works!” message.)

Offline

#10 2007-12-06 11:20:47

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: URL still needs "localhost" to browse files despite "It Works" msg

Not really surprising. Your default Apache install and virtual host seem fine. AFAIK, it’s the example.dev one that’s wrong, the localhost one appears to be overriding it. Suggest you try what I posted above — if it doesn’t work, just switch back, no harm done.


Steve

Offline

#11 2007-12-06 17:45:04

dariusdr
New Member
Registered: 2007-12-05
Posts: 7

Re: URL still needs "localhost" to browse files despite "It Works" msg

Hi Steve, thanks… you mean I should rename it back to “textpattern”? You’re referring to this folder right, the “txp root” folder in htdocs, as far as my ‘installation’ goes?

OK… so I’ve changed the hosts file and httpd-vhosts.conf to reflect the recent changes I made, i.e. renaming ‘example.dev’ back to ‘textpattern.’ I’ve also restarted Apache several times in the course of doing it. But I think I’m still getting the same results…

“http://localhost/” —> “It Works!”
“http://textpattern/” (folder inside htdocs with txp files) —> “It Works!”
“http://textpattern/textpattern/” —> 2 warnings and 1 fatal error (no more 404 error)
“http://localhost/textpattern/” —> 2 warnings and 1 fatal error (no more 404 error)
“http://localhost/textpattern/textpattern/” —> took me to txp login page!

… or did it get worse? :p

Anyway, no worries, I could rename it back to example.dev if we really can’t figure it out. :) Thanks mate!

Offline

#12 2007-12-11 03:33:12

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: URL still needs "localhost" to browse files despite "It Works" msg

…the hosts file again in my Windows directory…

You do mean C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS and not C:\WINDOWS\HOSTS, right?

Offline

Board footer

Powered by FluxBB