LinuxQuestions.org

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

paruhang 10-18-2011 07:30 PM

httpd,php & mysql
 
hi everybody,

i have installed httpd on my laptop. i have create index.html on /var/www/html/index.html when i open mozilla and type 127.0.0.1 the code i have written "HELLOW WORLD...!" it displays that means it works properly if iam not wrong.


i try to install mysql the following messages displays:

# yum install mysql
Loaded plugins: aliases, refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package mysql-5.1.47-4.el6.x86_64 already installed and latest version
Nothing to do

rpm -q mysql
mysql-5.1.47-4.el6.x86_64


and i try to install php too the following messages displays:

# yum install php
Loaded plugins: aliases, refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Package php-5.3.2-6.el6.x86_64 already installed and latest version
Nothing to do

rpm -q php
php-5.3.2-6.el6.x86_64

before iam using wamp on my windows now iam using 64 bits rhel 6 so iam new to linux.can anybody help me how to configure httpd,php and mysql manually...? and give simple example of writing php and creating database on linux. what i want to do is i want write php code, work with database on my local machine.if someone gives me some an ideas i'll be greatful

Wild_Pointer 10-18-2011 11:17 PM

Setting Up A LAMP
 
The simplest way to set up a LAMP (Linux Apache MySQL PHP), is to do it using Ubuntu. There may be other operating systems that offer just as easy a setup, but I presently am unaware of them. You can setup a LAMP manually, but it can get a little involved. Ubuntu actually builds and configures and sets it to start on system start up. I did run into one problem. I had to set the MIME variable to read PHP files in the httpd-conf file of Apache (possibly found in the /etc/Apache/httpd-conf/ directory). Setting up the LAMP manually, is a little involved, but if you'd like to learn, the "LEARN (blank) IN 24 HOURS) published what I thought were excellent books on building LAMP's. I wish you the best. You can contact me if you like, but I'm pretty busy and may no be able to get right back to you.

Best regards

chrism01 10-19-2011 12:29 AM

The key pt is
Quote:

This system is not registered with RHN.
RHN support will be disabled.
The is a true RedHat install; you either pay them for a subscription (to get updates & support) and register with
Code:

rhn_register
at the cmd line as root, OR get Centos which is a free version of RHEL, inc updates but no support. Your choice....

paruhang 10-19-2011 01:12 PM

hellow wild pointer,
i have download lAMP but that folder doesn't contain .rpm file it contains lamp-0.0.9 folder and inside that folder it contains some folder and file they are as followd
clusters, examples, lamp, libsrc, merlin, changelog, makefile and readme. is that the lamp i have to download....? how do i install this file in my local machine..? or if there is link to download lamp plz share for me i'll be greatfull.

Mitchal 10-19-2011 05:00 PM

Quote:

Originally Posted by paruhang (Post 4502730)
hellow wild pointer,
i have download lAMP but that folder doesn't contain .rpm file it contains lamp-0.0.9 folder and inside that folder it contains some folder and file they are as followd
clusters, examples, lamp, libsrc, merlin, changelog, makefile and readme. is that the lamp i have to download....? how do i install this file in my local machine..? or if there is link to download lamp plz share for me i'll be greatfull.

Hi Paruhang,
LAMP is not so much a installable package as it is a common group of packages which run together to form a full functioning web/application server. So i dont the think the LAMP package that you downloaded is whatyou think it is. if you have already done a yum install of Apache (httpd), MySQL and PHP then you have got essentially what is called a LAMP configuration (LAMP stands for Linux Apache MySQL PHP)

i am running this configuration on both CENTOS and fedora flavours without too much configuration required. Do you have a support agreement with redhat? if not there would be no advantage with going with RHL6 and you might be better starting over with one of these free flavours.

If you need any further help fell free to get in touch with me.
Mitch

Tinkster 10-19-2011 07:52 PM

LAMP, or any other LA combo, really, can be quite easily
put into place on any distro. My personal preference is
LAPP (Linux, Apache, PostgreSQL, PHP), others chose Python
instead of PHP ... the key is: most distros come with all
those combos ready available.


Cheers,
Tink

paruhang 10-20-2011 11:51 AM

hi mitchal,
thankx for your reply,
i have configure local repo in my system so i use yum command to install locally, i have installed php,mysql and apache successfully but i dont have an idea to configure and run those php,mysql and apache, iam learning to write some basic php code and creating database so i need to practise in my local system, can anybody guide me to configure php,mysql and apache. iam new to linux.

Tinkster 10-20-2011 12:54 PM

A google for "redhat lamp how to" brought up a couple of interesting
links, one of them I found particularly useful:
http://www.howtoforge.com/quick-n-ea...er-centos-rhel


Amazing what ~ 30 seconds of search can get you ...



Cheers,
Tink

paruhang 10-20-2011 02:38 PM

hi tinkster, thankx for your reply
i have followed the instruction as given and i have changed password as follows:

mysql> USE mysql;
mysql> UPDATE user SET Password=password WHERE user='root';
mysql> FLUSH PRIVILEGES;

when i try to login using mysql -u root -p this error displays

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

so how can i login using root password or what does it means...?

yancek 10-20-2011 03:53 PM

If the line below is what you typed in, you didn't enter a password.

Quote:

mysql> UPDATE user SET Password=password WHERE user='root';
The link below shows the step. Where it says 'newpassword' you should type your actual password.

Quote:

UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
Did you do it this way and just not post correctly.

TB0ne 10-20-2011 03:55 PM

Quote:

Originally Posted by paruhang (Post 4503695)
hi tinkster, thankx for your reply
i have followed the instruction as given and i have changed password as follows:

mysql> USE mysql;
mysql> UPDATE user SET Password=password WHERE user='root';
mysql> FLUSH PRIVILEGES;

when i try to login using mysql -u root -p this error displays
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
so how can i login using root password or what does it means...?

Google also works for finding out how to correctly set passwords and MySQL privileges:

http://www.cyberciti.biz/faq/mysql-c...root-password/

rahulkya 10-20-2011 05:05 PM

I am using debian and this command works very well try this for yours
Quote:

mysql --user=root --password=your_root_passwd --database=mysql
As you have RHEL check the default directory i.e your http://localhost should point to directory below
Quote:

/var/www/html
put your index.php in this html directory and check whether you can run PHP or not from here.

paruhang 10-20-2011 05:05 PM

thankx everybody,
i have installed php and test its okay but while installing
yum install php-mbstring php-mcrypt php-devel these three packages such error occurs.

# yum install php-mbstring php-mcrypt php-devel
Loaded plugins: aliases, refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package php-mbstring available.
No package php-mcrypt available.
No package php-devel available.
Error: Nothing to do

is that packages are necessary to install.. or what to do.

paruhang 10-20-2011 05:21 PM

hi everybody,

when creating database called demo.from following this link http://www.howtoforge.com/quick-n-ea...er-centos-rhel


To Create A New MySQL User

To create a new mysql user 'guest' with 'all privileges' on the database 'demo':

mysql > create database demo
mysql >GRANT ALL PRIVILEGES ON demo.* TO 'guest'@'localhost' IDENTIFIED BY 'guest' WITH GRANT OPTION;
mysql> UPDATE user SET Password=PASSWORD('guest') WHERE user='guest';


following above link i was not able to create database demo but i have tried this i was able to create database called demo
mysql > create database demo;
i hope semicolon ';' is missing after demo. if iam not wrong.

TB0ne 10-20-2011 05:30 PM

Quote:

Originally Posted by paruhang (Post 4503806)
thankx everybody,
i have installed php and test its okay but while installing yum install php-mbstring php-mcrypt php-devel these three packages such error occurs.

# yum install php-mbstring php-mcrypt php-devel
Loaded plugins: aliases, refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package php-mbstring available.
No package php-mcrypt available.
No package php-devel available.
Error: Nothing to do

is that packages are necessary to install.. or what to do.

As you were told before...you need to PAY FOR REDHAT in order to register the system. If you don't pay...you don't get access to the RHEL repositories, period. So pay or use CentOS instead.


All times are GMT -5. The time now is 02:39 AM.