localhost on centos

General support questions including new installations

localhost on centos

Postby 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
green-man
 
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

localhost on centos

Postby 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.
michaelnel
 
Posts: 1479
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: localhost on centos

Postby 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
green-man
 
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

Re: localhost on centos

Postby markkuk » 2009/10/21 17:59:12

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?

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.
markkuk
 
Posts: 697
Joined: 2007/09/07 10:56:28
Location: Finland

Re: localhost on centos

Postby CiaW » 2009/10/22 00:34:49

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?


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.
CiaW
 
Posts: 73
Joined: 2009/08/21 02:43:23
Location: Spokane, Washington USA

Re: localhost on centos

Postby pschaff » 2009/10/22 05:40:03

You may also have to
Code: Select all
chkconfig httpd on
service httpd start
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: localhost on centos

Postby 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]
green-man
 
Posts: 80
Joined: 2009/06/10 08:49:36
Location: Newcastle upon Tyne, UK

Re: localhost on centos

Postby michaelnel » 2009/10/22 23:05:16

The log files for httpd are in /var/log/httpd. Look there for the cause.
michaelnel
 
Posts: 1479
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: localhost on centos

Postby pschaff » 2009/10/23 00:58:25

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]


Is this with the CentOS packages? Did you remove all traces of the stuff in /opt/...
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

Re: localhost on centos

Postby 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 ... bian-unix/


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

Next

Return to CentOS 5 - General Support

Who is online

Users browsing this forum: No registered users and 3 guests