LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-16-2010, 12:49 AM   #1
hungry4knowhow
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Rep: Reputation: 0
Question Fresh CentOS5, PHP, mySQL Install, but Cant Pull up Localhost in Web browser.


Hey all, new to linux today. Wanting to learn it in order to have more control over my dedicated server and at some point get rid of Server Management Company.

So I installed CentOS5.4, Apache, PHP, mysql from repositories. Then according to tutorial i should have created a file index.php with the following in it: <? phpinfo(); ?> so in VMWare I did this:

cat > index.php
<? phpinfo(); ?>
CTRL+D

then

mv index.php /var/html/www

then went to firefox (windows outside of vmware)and entered the following
http://localhost > Nothing
http://192.0.0.1 > Nothing

did ifconfig and a few addresses come up:
lo inet addr: 127.0.0.1
virbr0 inet addr: 192.168.122.1 Bcast: 192.168.122.255
tried all of those and nothing.
also tried the subnet ip address that shows up in vmware edit menu.

All these things and no php info page coming up. Not sure what i've done wrong any hints as to which direction to go in order to find out whats not working would help greatly.

Thanks.

Last edited by hungry4knowhow; 04-16-2010 at 01:28 AM.
 
Old 04-16-2010, 01:20 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Well you should put that file in /var/www/html. Can you see the difference?
And make sure your apache server is running and listening.
service httpd start should start the service.
 
Old 04-16-2010, 01:27 AM   #3
hungry4knowhow
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
hey thanks for the help!

I'm pretty sure my typing of /var/html/www was a typo and I have it in the correct directory, however I do not know how to confirm this.

Also, service httpd start was completed before, and i had Issues then when I entered the ip's and localhost it didnt even bring up Apache Test Page all this prior to creating the index.php

Thanks for the continuing help! I've googled and searched but as I am new to Linux im sure im not using the correct terminology and have come up with nothing

Also wanted to edit to add that it is CentOS 5.4

Last edited by hungry4knowhow; 04-16-2010 at 01:28 AM.
 
Old 04-16-2010, 01:36 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
If your apache is setup correctly and is up and running, you should get the apache default start page. And if you are unable to see the page, you should first setup your apache first. And then host the pages. It should not be too difficult though if you have used yum to install everything. It should already be configured.
 
Old 04-16-2010, 01:37 AM   #5
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by hungry4knowhow View Post
Hey all, new to linux today. Wanting to learn it in order to have more control over my dedicated server and at some point get rid of Server Management Company.

So I installed CentOS5.4, Apache, PHP, mysql from repositories. Then according to tutorial i should have created a file index.php with the following in it: <? phpinfo(); ?> so in VMWare I did this:

cat > index.php
<? phpinfo(); ?>
CTRL+D

then

mv index.php /var/html/www

then went to firefox (windows outside of vmware)and entered the following
http://localhost > Nothing
http://192.0.0.1 > Nothing

did ifconfig and a few addresses come up:
lo inet addr: 127.0.0.1
virbr0 inet addr: 192.168.122.1 Bcast: 192.168.122.255
tried all of those and nothing.
also tried the subnet ip address that shows up in vmware edit menu.

All these things and no php info page coming up. Not sure what i've done wrong any hints as to which direction to go in order to find out whats not working would help greatly.

Thanks.
Open the /etc/httpd/conf/httpd.conf, search for the line:
Quote:
ServerName www.example.com:80
Edit the line in the following way:
Quote:
ServerName your_ip_address:80
Save and exit, then restart the apache and try again.
 
Old 04-16-2010, 09:27 PM   #6
hungry4knowhow
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
ok so i've figured out how to get into httpd.conf and find ServerName field edit and save via nano, now my question is I have a ton of different IP like numbers I get from different places. Which IP do I use when running ifconfig from the centos command line?

Last edited by hungry4knowhow; 04-16-2010 at 11:29 PM.
 
Old 04-17-2010, 06:42 AM   #7
hungry4knowhow
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Ok so after a bit of reasoning this morning, I realize that I had the right IP, but when I went to port forwarding website it said my port 80 is not open. And that many residential ISP's block this port.

So is there a way around this?
 
Old 04-18-2010, 04:26 AM   #8
barf14
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Rep: Reputation: 0
Yes, you need to use a service such a DynDns to redirect port 80 requests to another port such as 8080 and have your server listen on port 8080. My advice to you is to stick with server management company until you have acquired sufficient knowledge to safely deploy a secure server on the internet. Start by setting up an internal one and make your mistakes in private.
 
Old 04-18-2010, 11:05 PM   #9
hungry4knowhow
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I am stickign with server managment. I am learning linux via an Install through VMWare on my computer.

Thanks for the help I will try what you said.
 
Old 04-20-2010, 12:32 AM   #10
barf14
LQ Newbie
 
Registered: Apr 2010
Posts: 5

Rep: Reputation: 0
In that case might I suggest you get a copy of Rute. You can but the book or download it. It is an excellent learning resource for Linux.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to install php5.3.0 & run any php file in web browser in linux 5.0 anmol1986 Linux - General 4 11-09-2009 07:22 AM
Browser tries to download localhost/file.php KPryor Linux - Software 3 02-17-2009 01:59 AM
howto install 2007.1 for web/PHP/Mysql server setlec_seta Mandriva 4 06-01-2007 07:42 AM
LXer: Backing up your MySQL database using your web browser and a PHP script LXer Syndicated Linux News 0 04-21-2007 10:16 PM
Apache 2.2, Php 5.1, & Mysql on CentOS5 James_Ecker Linux - Software 2 04-15-2007 07:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration