0

I have a small little site I am testing, first time using PHP. It is sitting on an Ubuntu box, in the /var/www folder. I can get to it in my internal network, but I can't get to it outside. I have port 80 forwarded to my Ubuntu box in my router. That is the first question. Second, how do I designate the first page to be served when you get to that box. The default Apache page is index.html. I want a page called login.php to be first. I have renamed index.html to html.old, but then I just get a file listing. Any help, much appreciated.

2
  • What do you mean by "I can't get to it outside"? Is there an error message, a timeout, ... ? Commented Apr 7, 2011 at 14:49
  • chrome returned a oops could not find page. The ip address is correct, I am wondering if 80 is blocked by my ISP? Commented Apr 7, 2011 at 14:59

3 Answers 3

2

For custom index page place this in your .htaccess (in root folder)

DirectoryIndex login.php

I don't understand your first question.

Sign up to request clarification or add additional context in comments.

3 Comments

When I try to access the site from outside of my house, Chreome returns a oops cannot find xxx.xxx.xxx.xxx. I know th eIP address is right, just can't get to the site. Wondering if port 80 is blocked by my ISP
added .htaccess to root(/var/www) with that line, added that line to httpd.conf, when I got to the IP address, al I see is a directory listing
@KCavon I think you actually see your network IP, not internet IP. Using your Ubuntu go to whatsmyip.org and check if IP's are consistent. If not, try using the one from website. Regarding .htaccess, double check, also try adding Options +FollowSymLinks -Indexes on top of .htaccess
0

For the apache default page, you can either go find your httpd.conf file edit this:

DirectoryIndex index.html

Or you can add the following to a .htaccess file:

DirectoryIndex login.php

1 Comment

httpd.conf is empty on ubuntu, use apache2.conf
-1

2) Delete or move index.html. Rename login.php to index.php or create a new index.php with

<?php require dirname(__FILE__) . '/login.php';

Thats the most basic ways to do this. There are many there solutions, but it seems to me, that this is sufficient in your case.

This works, because the apache by default is looking for several index.*-files (in order).

1 Comment

May someone explain the downvote? There is nothing wrong as far as I can see, but maybe Im wrong, so clarification would be nice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.