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, ... ?KingCrunch– KingCrunch2011-04-07 14:49:05 +00:00Commented 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?KCavon– KCavon2011-04-07 14:59:37 +00:00Commented Apr 7, 2011 at 14:59
Add a comment
|
3 Answers
For custom index page place this in your .htaccess (in root folder)
DirectoryIndex login.php
I don't understand your first question.
3 Comments
KCavon
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
KCavon
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
Dejan Marjanović
@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 .htaccessFor 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
Ivan Ivanic
httpd.conf is empty on ubuntu, use apache2.conf
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
KingCrunch
May someone explain the downvote? There is nothing wrong as far as I can see, but maybe Im wrong, so clarification would be nice.