localhost on centos

General support questions including new installations
green-man
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

localhost on centos

Post by green-man » 2009/10/20 22:39:10

Dear A,,
I have Centos 5.3 installed on my pc. I have mysql, PHP and apache server running on my computer too.
Is there any way I can test my website on my pc without running any stack ( lampp )?

thanks in advance
green-man

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

localhost on centos

Post by michaelnel » 2009/10/20 22:46:20

What do you mean "without running any stack"? You mean without actually running httpd? Or do you mean without going over the internet? If it's the latter, just put "http://localhost" in your browser. If it's the former, I have no idea.

Bad question will get you a bad answer.

green-man
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

Re: localhost on centos

Post by green-man » 2009/10/21 15:56:15

thanks for reply,

I mean if I want to run a website on local machine I have to download XAMPP and install Lampp. To work on localhost I have to start XAMP "/opt/lampp/lampp start". Lampp has apache, php and mysql.

When I login to webmin on my machine under the Server I have Apache and Mysql running and I have installed PHP on my machine too. My question is, because I have apache and mysql running on my machine can I run a website if I don't run XAMP? How can I access my /var/www files on browser?

Please let me know if my answer still isn't clear.

thanks
green-man

markkuk
Posts: 739
Joined: 2007/09/07 10:56:28
Location: Finland

Re: localhost on centos

Post by markkuk » 2009/10/21 17:59:12

[quote]
green-man wrote:
When I login to webmin on my machine under the Server I have Apache and Mysql running and I have installed PHP on my machine too. My question is, because I have apache and mysql running on my machine can I run a website if I don't run XAMP? [/quote]
If you have already installed the CentOS versions of apache, PHP and MySql you don't need to install XAMPP or any other third-party apache/php/mysql packages. Open http://localhost/ in your browser.

CiaW
Posts: 73
Joined: 2009/08/21 02:43:23
Location: Spokane, Washington USA
Contact:

Re: localhost on centos

Post by CiaW » 2009/10/22 00:34:49

[quote]
When I login to webmin on my machine under the Server I have Apache and Mysql running and I have installed PHP on my machine too. My question is, because I have apache and mysql running on my machine can I run a website if I don't run XAMP? How can I access my /var/www files on browser?
[/quote]

I'm just adding to the answer from those who said to enter localhost (with http://) in your browser. However, do you have a file such as index.php in your /var/www folder for localhost to access? If so, it should pull it up. If not, you'll have to put one there, or if you're using a CMS (i.e. Drupal) then you may need to open localhost/install.php first -- but those instructions would be included in the CMS directions, too.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: localhost on centos

Post by pschaff » 2009/10/22 05:40:03

You may also have to[code]
chkconfig httpd on
service httpd start
[/code]

green-man
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

Re: localhost on centos

Post by green-man » 2009/10/22 23:03:26

any time I try to start httpd i get "Failed". when I go to log file there is mention of httpd.

/etc/rc.d/init.d/httpd start
Starting httpd: [FAILED]

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: localhost on centos

Post by michaelnel » 2009/10/22 23:05:16

The log files for httpd are in /var/log/httpd. Look there for the cause.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: localhost on centos

Post by pschaff » 2009/10/23 00:58:25

[quote]
green-man wrote:
any time I try to start httpd i get "Failed". when I go to log file there is mention of httpd.

/etc/rc.d/init.d/httpd start
Starting httpd: [FAILED][/quote]

Is this with the CentOS packages? Did you remove all traces of the stuff in /opt/...

green-man
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

Re: localhost on centos

Post by green-man » 2009/10/26 09:59:48

Thanks a lot for all replies,

I found the problem and it is solved.

Solution

I have SElinux on my server any time wanted to start the httpd it was blocked by SElinux.
I disabled the SElinux in cat /etc/selinux/config then restarted my pc it worked the apache is running fine and I can access http://localhost
if you want to read about it go the following link

http://www.thegeekstuff.com/2009/06/how-to-disable-selinux-redhat-fedora-debian-unix/


Thanks
Green-Man

Post Reply