localhost on centos
localhost on centos
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
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
-
- Posts: 1478
- Joined: 2006/05/29 16:50:11
- Location: San Francisco, CA
localhost on centos
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.
Bad question will get you a bad answer.
Re: localhost on centos
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
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
Re: localhost on centos
[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.
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.
Re: localhost on centos
[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.
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.
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: localhost on centos
You may also have to[code]
chkconfig httpd on
service httpd start
[/code]
chkconfig httpd on
service httpd start
[/code]
Re: localhost on centos
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]
/etc/rc.d/init.d/httpd start
Starting httpd: [FAILED]
-
- Posts: 1478
- Joined: 2006/05/29 16:50:11
- Location: San Francisco, CA
Re: localhost on centos
The log files for httpd are in /var/log/httpd. Look there for the cause.
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: localhost on centos
[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 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/...
Re: localhost on centos
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
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