LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   php,mysql and apache (https://www.linuxquestions.org/questions/linux-newbie-8/php-mysql-and-apache-903494/)

paruhang 09-17-2011 03:26 AM

php,mysql and apache
 
hi everybody,
i have installed php,mysql and apache manually,and i have checked it is installed properly or not,
[root@server ~]# rpm -q httpd
httpd-2.2.15-5.el6.x86_64
[root@server ~]# rpm -q mysql
mysql-5.1.47-4.el6.x86_64
[root@server ~]# rpm -q php
php-5.3.2-6.el6.x86_64
[root@server ~]#

i want to configure locally on my machine, i don't know about any configuration file and i don't know how to configure because iam newer to this rhel6 and after configure how to check php,mysql and apache is configured properly. if somebody guide me to right way i'll be greatful.

rahulkya 09-17-2011 04:40 AM

The webserver default folder is
Quote:

/var/www/
Run you web file's from this folder ...You can reach there by typing localhost/filename
or by you server's IP address ..

If you want to secure you website there are separate tutorials ...Do some google..

jsaravana87 09-17-2011 05:08 AM

paste phpinfo.php file in /var/www
go to url firefox
http://ipaddress/phpinfo.php
it will display the php info then ur php conf is wright

for apache got to firefox type
http://localhost
apache page will appears the apache is conf


for mysql

create a root user for mysql and assign password to it

mysql -uroot -p
prompt for password:password
mysql>

then ur login wright

TB0ne 09-17-2011 01:46 PM

Quote:

Originally Posted by rahulkya (Post 4474287)
The webserver default folder is /var/www
Run you web file's from this folder ...You can reach there by typing localhost/filename
or by you server's IP address ..

The web server MAY be at /var/www, depending on the distro. Some are /srv/www, some are in different places. Without knowing what version/distro of Linux the OP has (they didn't say), it's dangerous to speculate. OP, look into your apache.conf file(s), and see where your DocumentRoot directive is set.
Quote:

Originally Posted by arun5002
paste phpinfo.php file in /var/www, go to url firefox
http://ipaddress/phpinfo.php
it will display the php info then ur php conf is wright

Again, only IF the document root is /var/www, otherwise it won't work. And again, spell out your words.
Quote:

for apache got to firefox type
http://localhost
apache page will appears the apache is conf
The default page for Apache will display "It works!", and Apache may NOT be configured to work with PHP correctly, if apache2-mod_php5 isn't installed.
Quote:

for mysql
create a root user for mysql and assign password to it

mysql -uroot -p
prompt for passwordassword
mysql>

then ur login wright
A root user for MySQL is created by default, and if you re-create it without granting privileges to the tables correctly, you'll be in a bad spot. The best way to see if MySQL is running is just to type in "sudo mysql". If it's up and running and configured with default values, you'll see a "mysql>" prompt. If you do, it's working...type quit to get back to a prompt.

chrism01 09-18-2011 07:30 PM

Hate to disagree with you ;) , but in this case
Quote:

Without knowing what version/distro of Linux the OP has (they didn't say)
from OP post #1
Quote:

am newer to this rhel6

# and

rpm -q httpd
httpd-2.2.15-5.el6.x86_64

TB0ne 09-19-2011 09:43 AM

Quote:

Originally Posted by chrism01 (Post 4475550)
Hate to disagree with you ;) , but in this case
from OP post #1

Well fine, then. :) Missed it from the first post.....

lithos 09-19-2011 10:21 AM

Hi

Your server has the config files located at:
Apache (HTTP) : /etc/httpd/conf/httpd.conf
PHP : /etc/php.ini
MySQL : /etc/my.cnf (which isn't really that much to configure, more useful is to run it first with: service mysqld restart and then using TB0ne commands)

Remember: all services need to be started to have it checked if they work.
Apache can be easily misconfigured if you don't know what you're doing, so always check it first with: apachectl -t to see the output (must be: Syntax OK)

jsaravana87 09-20-2011 01:11 AM

Thanks tbone for ur reply


Regards
arun


All times are GMT -5. The time now is 03:17 AM.