LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   PHP/MySQL and Apache server setup (https://www.linuxquestions.org/questions/linux-software-2/php-mysql-and-apache-server-setup-288723/)

nenyo 02-10-2005 08:08 PM

PHP/MySQL and Apache server setup
 
this post has a lot that goes with it. ok. here goes...
i recently took a web design course that focused mostly on PHP and MySQL. i know how to use a little bit of the basics in both. of course i want to learn more so i want to set up a server on my comp. it was a highschool class useing windows computers(bleh) so of course we learned nothing of setup. i put PHP, MySQL, and Apache on my computer. i went to "0.0.0.0" and a page came up saying that the sever was working, but i cant upload anything when i try and log on as root or my username.

ok. now the questions...
1) How do I how do i set up a username to use for a login with an FTP prog?
2) Where are the files i upload actualy stored on my computer?
3) How do I set up a username and password for MySQL?
4) How do I change the IP "0.0.0.0" to something else?

I REALY REALY don't want to have to read a huge manual about each of these progs right now. i just want to know the basics of setup right now and i will read about them later.

Just so you know, i'm kind of new to linux. please speak in terms that a newbie would understand.
i'm running mandrake 10.1 on an averatec 3150 laptop.

rylan76 02-11-2005 12:12 AM

Re: PHP/MySQL and Apache server setup
 
ok. now the questions...
1) How do I how do i set up a username to use for a login with an FTP prog?

>As far as I know, you need to setup and configure a complete FTP server. This is not so tough (I've never done it, though) - look for a howto or FAQ there should be some easily obtainable.

2) Where are the files i upload actualy stored on my computer?

>As I have it you select a directory(ies) during configuration of the FTP server that will be available for the user to choose from when he uploads files.

3) How do I set up a username and password for MySQL?

> Do this:

1. Make sure the mysql server is running: In the /usr/local/mysql/bin directory do

mysql_safe --user=mysql &

2. Type in mysql -u root mysql

3. At the mysql> prompt type set password for root@localhost=password('your_password_here');

You have now created the root user. To create other users, I think all you need to do is login as root into mysql, then "Grant" privigeges to a name that will become the new user:

1. Log in: mysql -u root -p <ENTER>
2. At the Password: prompt, type the password you entered above.
3. You might need to have a database already existing fro this to work from 4 onward:
4. Type grant select, insert, update delete on <database name> to normaluser@localhost identified by 'your_user_pass_here';
5. Type flush privileges; <ENTER>

This should create a user called "normaluser" who can select items from, insert items into, update items and delete items in the <database name> database.

To log in as this user do

mysql -u normaluser -p

and at the password prompt enter the password you entered in step (4) above.

4) How do I change the IP "0.0.0.0" to something else?

> Dunno - I think you need to take a look at the ServerName paramter in Apahce's httpd.conf.

Just so you know, i'm kind of new to linux. please speak in terms that a newbie would understand.

>I hope these are clear enough? :) Write again if you still have problems.

Kind regards,

nenyo 02-11-2005 08:20 AM

THANK YOU!! mysql works fine. ill have to look for a faq on seting up ftp like you said. do you know of a good one?
(your directions were very clear btw. thx.) ;)

nicolas9510 02-11-2005 09:18 AM

personnaly i like proftpd
http://www.proftpd.org
i use webmin to configure stuff
its has a proftps sectionhope it helps

rylan76 02-12-2005 07:31 AM

Quote:

Originally posted by nenyo
THANK YOU!! mysql works fine. ill have to look for a faq on seting up ftp like you said. do you know of a good one?

>No, sorry! :) I've never needed to do something like that. What I've learned so far in using and supporting Linux commercially is LEARN -ONLY- WHAT YOU NEED.

>(your directions were very clear btw. thx.) ;)

Hey, thanks! It's a pleasure to help out.

nenyo 02-12-2005 01:19 PM

ok so i logged in as root and put in the line
=================================
grant select, insert, update, delete, create, drop, alter on user to nenyo@localhost identified by '**bla**';
=================================

i then went to the user table in the mysql database, and it said i had no privleges. root was all "Y" and nenyo was all "N". shouldn't it have changed those that i stated to "Y"??? what happened...

Code:

+-----------+-------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
| Host      | User  | Password        | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections |
+-----------+-------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
| localhost | root  | 2e782c85379a326e | Y          | Y          | Y          | Y          | Y          | Y        | Y          | Y            | Y            | Y        | Y          | Y              | Y          | Y          | Y    | Y          | Y                    | Y                | Y            | Y              | Y                | |            |            |              |            0 |          0 |              0 |
| localhost |      |                  | N          | N          | N          | N          | N          | N        | N          | N            | N            | N        | N          | N              | N          | N          | N    | N          | N                    | N                | N            | N              | N                | |            |            |              |            0 |          0 |              0 |
| localhost | nenyo | 1a4b9a0957282400 | N          | N          | N          | N          | N          | N        | N          | N            | N            | N        | N          | N              | N          | N          | N    | N          | N                    | N                | N            | N              | N                | |            |            |              |            0 |          0 |              0 |
+-----------+-------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+


btmiller 02-12-2005 01:37 PM

I think you need to specify the database and table both in your grant statement. Here's how I create a database named blahdb for a normal user (named blah) to use, as MyhSQL root:

create database blahdb;
grant usage on * to to 'blah'@'localhost' identified by 'whatever';
grant all on blahdb.* to 'blah'@'localhost';

User blah will now have all priviliges on database blahdb. You can assign a subset of priviliges such as select, insert, etc.

nenyo 02-12-2005 01:48 PM

ok that solves one problem but what if i wanted to create a database with someone other than root?

UPDATE=-=-=-
nope. sry. that didn't work either. my user still can do nothing but look at all the pretty letters. :p
(according to the user table)

UPDATE=-=-=-
once again i appolegize. i tend to reply before i get all the info. that did solve one problem, although it said differently in the user table, and i cannow edit a database but i can still not create one with a normal user. only root.


All times are GMT -5. The time now is 09:29 PM.