LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LAMP on vmware... (https://www.linuxquestions.org/questions/linux-newbie-8/lamp-on-vmware-791071/)

ajlisowski 02-23-2010 02:23 PM

LAMP on vmware...
 
Hey all, I am brand new to linix. Im a programmer who is trying to learn a bit more about linix so I know what the heck im talking about when I request stuff from our IT guys...

Basically I have VMware installed and installed CentOS on it. I have set up apache, mysql and php. I tested this by making a phpinfo page. I then installed gnome and firefox, went to localhost and its good to go.

My problem is, how do I access this from outside of linix? I want my host windows PC to be able to hit up the php site on the centos machine.

I did a ifconfig and determined my IP address, and I went to that on my browser but it did not work. What am I missing?

Rush_898 02-23-2010 03:09 PM

Hey dude, it sounds like (barring some other firewall problem or such) you need to tell apache to listen on the IP you are trying to connect on:

http://httpd.apache.org/docs/1.3/bind.html

avtandil_k 02-23-2010 03:52 PM

I've worked with Oracle Enterprise manager (web based) and managed to handle it through the port forwarding if you use NAT for VMware image (your CentOS) networking. If it is "Bridged" networking then your vmware image has it's own IP which you reference in the URL address in a web browser outside of linux. I also feel that the /etc/hosts needs an entry of the machine name your are connecting from outside linux. Through in your Centos IP to the hosts file (google the location based on the client's OS) on the client if using "Bridged" networking on vmware.

fusion1275 02-23-2010 05:12 PM

BTW it's Linux not Linix ;)

ajlisowski 02-24-2010 09:23 AM

Yeah..I...was typing Linix to make me seem like more of a noob so Id get pitty help?

I have no idea why I kept typing that :)

Anyway, so...this morning I go on my VM and now I cant even access localhost through the centos firefox. I also can not go to the IP address of the machine. I restarted apache and php is running fine. I have no idea why it suddenly broke more.

I DID disable and re-enable my firewall, so maybe that had something to do with it.

(actually it was an edit to my httpd.conf file that broke it, I changed that back and it works now)

The good news is disabling the firewall also allowed me to have access to the server from the host machine! So at least i know its the firewall stopping me :)

deci007 02-24-2010 09:48 AM

follow these step
 
I am assuming you are using this scenario for testing purpose.

this will figure out your ip address, make a backup of iptables files. and edit the iptables file so it can take traffic on port 80.

Code:

#ifconfig
#cp /etc/sysconfig/iptables /etc/sysconfig/iptables.old
#vi /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT

#iptables -F                  ---this will clear the ports
#setenforce=0                  ---this will disable the selinux.

#chkconfig --level 345 httpd on  ---set the apache to start every time  you are at run level 3,4, and 5

#service httpd stop            ---stop the apache is running
#service httpd start          ---start the apache

this will be perfect for a testing environment. but not on production.


All times are GMT -5. The time now is 12:19 AM.